Face image authentic identification method and device, electronic equipment and storage medium
By integrating a temporal generation model and a lighting simulation model into the generator network, dynamic face images containing dynamic expressions and complex lighting conditions are generated, solving the problem of low image generation accuracy in existing technologies and improving the accuracy of face authentication.
Patent Information
- Application Number
- CN202511392511.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies that generate static face images based on deep learning and generative adversarial networks have low image accuracy, resulting in low accuracy in fake image detection.
By integrating a temporal generation model and an illumination simulation model through a generator network, dynamic features and illumination features are generated. Dynamic face images are then generated using an attention mechanism and used as training samples to train a face authentication model.
It generates dynamic face images with dynamic expressions and complex lighting conditions, improving the quality and accuracy of face image generation, enhancing the accuracy of face authentication, and adapting to complex face recognition scenarios.
Smart Images

Figure CN121330733A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of biometrics or other related technical fields, and more specifically, to a method, apparatus, electronic device, and storage medium for authenticating facial images. Background Technology
[0002] With the advent of the digital age, facial recognition technology is not only a key component of modern security systems but also the cornerstone of intelligent services, personalized experiences, and privacy protection. In various industries such as finance, security, and healthcare, facial recognition provides convenient identity verification solutions, greatly improving user convenience and service efficiency. However, as facial spoofing technology becomes increasingly sophisticated, the challenges it poses to facial recognition systems are becoming more severe, threatening not only personal privacy but also potentially leading to significant economic losses and social problems.
[0003] To address the problem of face spoofing, a large number of facial images are often needed as training data to iteratively train face detection models, enabling them to accurately identify various types of forged faces. Therefore, the generation of facial sample data has become a crucial step in the field of biometrics.
[0004] In related technologies, realistic static face images generated based on deep learning and generative adversarial networks can simulate real people in terms of expressions and movements. However, they cannot simulate dynamic face images in complex environments, resulting in unnatural face images with low accuracy and poor image quality. This fails to meet the requirements of advanced anti-spoofing systems, leading to problems such as low accuracy and poor anti-spoofing capabilities.
[0005] There is currently no effective solution to the above problems. Summary of the Invention
[0006] This invention provides a method, apparatus, electronic device, and storage medium for detecting fake faces, in order to at least solve the technical problem in related technologies where the generation of static face images based on deep learning and generative adversarial networks has low image accuracy, resulting in low accuracy in detecting fake faces.
[0007] According to one aspect of the present invention, a method for detecting fake faces in images is provided, comprising: generating a random noise vector and inputting the random noise vector into a generator network to generate an initial facial feature vector; inputting the initial facial feature vector as input data into a temporal generation model of the generator network and outputting a dynamic feature vector, wherein the temporal generation model is a pre-constructed model for generating dynamic features; inputting the initial facial feature vector as input data into an illumination simulation model of the generator network and outputting an illumination feature vector, wherein the illumination simulation model is a pre-constructed model for generating simulated illumination conditions and generating illumination features; fusing the dynamic feature vector and the illumination feature vector based on an attention mechanism to obtain a fused feature vector, and generating a dynamic face image set based on the fused feature vector through the generator network; using the generated dynamic face image set as training samples to train a face detection model, and detecting fake faces in real face images based on the trained face detection model.
[0008] Further, the step of inputting the initial facial feature vector as input data into the temporal generation model of the generator network and outputting a dynamic feature vector includes: defining conditional parameters for each time step, and generating dynamic control signals for each time step based on the conditional parameters, wherein the conditional parameters include at least one of the following: head rotation angle, blinking state, and mouth movement amplitude, wherein the time step represents each discrete time point in the time series; inputting the dynamic control signals and the initial facial feature vector for each time step as input data into the temporal generation model; and transforming the initial facial feature vector based on the dynamic control signals for each time step to obtain the dynamic feature vector.
[0009] Further, the steps of defining the conditional parameters for each time step include: defining the head rotation angle, and constructing a rotation matrix for each time step based on the initial angle and the head rotation angle; modeling the blinking degree for each time step based on the time-varying modulation function to obtain the eye features for each time step; modeling the mouth opening degree for each time step based on the time-varying modulation function to obtain the mouth features for each time step; and obtaining the conditional parameters based on the rotation matrix, the eye features, and the mouth features for each time step.
[0010] Further, the step of inputting the initial facial feature vector as input data into the illumination simulation model of the generator network and outputting the illumination feature vector includes: inputting the initial facial feature vector into the illumination simulation model, generating illumination parameters for each time step through the illumination simulation model, wherein the illumination parameters include at least one of the following: illumination intensity, light source position, light source color, shadow coefficient, and light reflection coefficient; mapping the illumination parameters to the facial feature vector through the illumination simulation model to obtain the illumination feature vector for each time step.
[0011] Furthermore, the step of mapping the lighting parameters to the facial feature vector through the lighting simulation model includes: calculating the lighting intensity of each pixel at each time step based on the lighting intensity and the position of the light source through the lighting simulation model; calculating the reflection intensity of each pixel at each time step based on the color of the light source and the light reflection coefficient through the lighting simulation model; and calculating the shadow feature vector at each time step based on the shadow coefficient through the lighting simulation model.
[0012] Furthermore, the step of fusing the dynamic feature vector and the illumination feature vector based on the attention mechanism to obtain the fused feature vector includes: transforming the dynamic feature vector and the illumination feature vector respectively through a learnable projection matrix to obtain the query vector corresponding to the dynamic feature and the key vector corresponding to the illumination feature vector; calculating the attention weight based on the query vector and the illumination feature vector, and performing a weighted calculation on the illumination feature vector based on the attention weight to obtain a weighted illumination feature vector; and performing a dot product operation on the dynamic feature vector and the weighted illumination feature vector to obtain the fused feature vector.
[0013] Further, the generator network and discriminator network constitute a generative adversarial network (GAN). The steps for constructing the GAN include: Step 1, acquiring historical dynamic face images and preprocessing them, and constructing training samples based on the preprocessed historical dynamic face images; Step 2, selecting a generator network architecture and a discriminator network architecture to construct an initial GAN, wherein the generator network architecture integrates the temporal generation model and the illumination simulation model; Step 3, iteratively training the discriminator network based on the training samples and the dynamic face images randomly generated by the generator network, obtaining the trained discriminator network; Step 4, iteratively updating the parameters of the generator network based on the trained discriminator network, obtaining the trained discriminator network; Step 5, repeating steps 3 to 4 above, based on N rounds of iterative training, determining the final generator network and discriminator network, obtaining the trained GAN, where N is a positive integer.
[0014] According to another aspect of the present invention, a face image authentication device is also provided, comprising: a first generation unit, configured to generate a random noise vector and input the random noise vector into a generator network to generate an initial facial feature vector; a first output unit, configured to input the initial facial feature vector as input data into a temporal generation model of the generator network and output a dynamic feature vector, wherein the temporal generation model is a pre-constructed model for generating dynamic features; a second output unit, configured to input the initial facial feature vector as input data into a lighting simulation model of the generator network and output a lighting feature vector, wherein the lighting simulation model is a pre-constructed model for generating simulated lighting conditions and generating lighting features; a second generation unit, configured to fuse the dynamic feature vector and the lighting feature vector based on an attention mechanism to obtain a fused feature vector, and generate a dynamic face image set based on the fused feature vector through the generator network; and an authentication unit, configured to train a face authentication model using the generated dynamic face image set as training samples, and perform face image authentication based on the trained face authentication model.
[0015] Further, the first output unit includes: a first definition module, used to define conditional parameters for each time step, and generate dynamic control signals for each time step based on the conditional parameters, wherein the conditional parameters include at least one of the following: head rotation angle, blinking state, and mouth movement amplitude, wherein the time step represents each discrete time point in the time series; a first input module, used to input the dynamic control signals of each time step and the initial facial feature vector as input data into the time series generation model; and a first transformation module, used by the time series generation model to transform the initial facial feature vector based on the dynamic control signals of each time step to obtain the dynamic feature vector.
[0016] Further, the first definition module includes: a first construction submodule, used to define the head rotation angle and construct rotation matrices for each time step based on the initial angle and the head rotation angle; a first modeling submodule, used to model the blinking degree at each time step based on a time-varying modulation function to obtain eye features at each time step; a second modeling submodule, used to model the mouth opening degree at each time step based on the time-varying modulation function to obtain mouth features at each time step; and a first acquisition submodule, used to obtain the condition parameters based on the rotation matrix, the eye features, and the mouth features at each time step.
[0017] Further, the second output unit includes: a first generation module, used to input the initial facial feature vector into the lighting simulation model, and generate lighting parameters for each time step through the lighting simulation model, wherein the lighting parameters include at least one of the following: light intensity, light source position, light source color, shadow coefficient, and light reflection coefficient; and a first mapping module, used to map the lighting parameters to the facial feature vector through the lighting simulation model to obtain the lighting feature vector for each time step.
[0018] Further, the first mapping module includes: a first calculation submodule, used to calculate the illumination intensity of each pixel at each time step based on the illumination intensity and the position of the light source using the illumination simulation model; a second calculation submodule, used to calculate the reflection intensity of each pixel at each time step based on the color of the light source and the light reflection coefficient using the illumination simulation model; and a third calculation submodule, used to calculate the shadow feature vector at each time step based on the shadow coefficient using the illumination simulation model.
[0019] Further, the second generation unit includes: a first transformation module, used to transform the dynamic feature vector and the illumination feature vector respectively using a learnable projection matrix to obtain a query vector corresponding to the dynamic feature and a key vector corresponding to the illumination feature vector; a first calculation module, used to calculate attention weights based on the query vector and the illumination feature vector, and perform weighted calculation on the illumination feature vector based on the attention weights to obtain a weighted illumination feature vector; and a first operation module, used to perform a dot product operation on the dynamic feature vector and the weighted illumination feature vector to obtain the fused feature vector.
[0020] Furthermore, the generator network and discriminator network constitute a generative adversarial network (GAN). The face image authentication device further includes: a first construction module, used in step one to acquire historical dynamic face images, preprocess the historical dynamic face images, and construct training samples based on the preprocessed historical dynamic face images; a second construction module, used in step two to select a generator network architecture and a discriminator network architecture to construct an initial GAN, wherein the generator network architecture integrates the temporal generation model and the illumination simulation model; a first training module, used in step three to iteratively train the discriminator network based on the training samples and the dynamic face images randomly generated by the generator network, to obtain the trained discriminator network; a first update module, used in step four to iteratively update the parameters of the generator network based on the trained discriminator network, to obtain the trained discriminator network; and a first repetition module, used in step five to repeat steps three to four above, based on N rounds of iterative training, to determine the final generator network and discriminator network, to obtain the trained GAN, where N is a positive integer.
[0021] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute any of the above-described methods for detecting fake faces.
[0022] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-described methods for detecting fake faces.
[0023] In this application, the following steps are performed: a random noise vector is generated and input into a generator network to generate an initial facial feature vector. This initial facial feature vector is then used as input data to a temporal generation model of the generator network, outputting a dynamic feature vector. The temporal generation model is a pre-built model for generating dynamic features. The initial facial feature vector is also used as input data to a lighting simulation model of the generator network, outputting a lighting feature vector. This lighting simulation model is a pre-built model for generating simulated lighting conditions and lighting features. Finally, the dynamic feature vector and the lighting feature vector are fused using an attention mechanism to obtain a fused feature vector. A dynamic face image set is then generated by the generator network based on this fused feature vector. The generated dynamic face image set is used as training samples to train a face authentication model, and the trained face authentication model is used to authenticate real face images.
[0024] In this application, a temporal generation model and an illumination simulation model are integrated into the generator network. This enables the generation of dynamic features and illumination features based on set parameters, thereby generating dynamic face images containing dynamic expressions and complex lighting conditions. These dynamic face images are then used as training samples to train a face authentication model for accurate authentication of real faces. This achieves the technical objective of generating complex face images, adapting to complex face recognition scenarios and improving the quality and accuracy of face image generation. This enhances the accuracy of face authentication and solves the technical problem in related technologies where the generation of static face images based on deep learning and generative adversarial networks results in low image accuracy and consequently low authentication accuracy. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0026] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for detecting fake faces in images is shown.
[0027] Figure 2 This is a flowchart of an optional face image authentication method according to an embodiment of the present invention;
[0028] Figure 3 This is an optional discriminator network and generator network architecture diagram according to an embodiment of the present invention;
[0029] Figure 4 This is a schematic diagram of an optional face image authentication device according to an embodiment of the present invention;
[0030] Figure 5 This is a hardware structure block diagram of an electronic device (or mobile device) that performs an optional method for detecting fake faces in an image according to an embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0033] It should be noted that the face image authentication method and apparatus in this application can be used in the field of biometrics when generating dynamic face images based on dynamic features and illumination features, and can also be used in any field other than biometrics when generating dynamic face images based on dynamic features and illumination features. This application does not limit the application field of the face image authentication method and apparatus.
[0034] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision-making results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.
[0035] The following embodiments of the present invention can be applied to various face image authentication systems / applications / devices. The present invention integrates a temporal generation network and an illumination simulation model into the generator network, thereby constructing a dynamic face generation model. This model overcomes the shortcomings of existing technologies in terms of precisely controlling dynamic features, simulating multi-color face reflection effects under complex lighting conditions, and providing more diverse fake face generation. The face authentication model is trained based on the generated dynamic face images, thereby improving the security and accuracy of the face authentication model.
[0036] The present invention will now be described in detail with reference to various embodiments.
[0037] Example 1
[0038] According to an embodiment of the present invention, an embodiment of a method for detecting fake faces is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0039] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a method to detect fake faces in images is shown. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0040] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0041] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the face image authentication method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the face image authentication method described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0042] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0043] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0044] Under the aforementioned operating environment, this application provides the following: Figure 2 The method shown is a method for detecting fake faces in facial images. The main body implementing this method is a facial image detection system.
[0045] Figure 2 This is a flowchart of an optional face image authentication method according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:
[0046] To address the challenge of identifying forged faces, it's often necessary to generate fake face images to train face authentication models / systems. This improves the accuracy of these models / systems in recognizing various forged faces in application scenarios, ensuring the security of financial transactions. For applications involving forged face generation, especially in high-security environments, the forged face images not only need to be highly realistic but also possess sufficient diversity and complexity to meet different authentication requirements and anti-fraud detection methods. In particular, controlling factors such as facial expressions, dynamic features, and lighting conditions to generate diverse and highly credible forged images presents a significant challenge.
[0047] This invention is based on generative adversarial networks and integrates a temporal generation model and a lighting simulation model into the generator. By combining dynamic features, it precisely controls the dynamic actions and facial expressions in the generated face images. At the same time, it simulates different light sources, light reflections, and shadow effects based on the lighting simulation model. Combined with lighting features, it ensures that the generated fake face images have a high degree of realism under different lighting conditions, thereby generating highly realistic and natural face images to meet the face authentication needs in high-security environments such as financial scenarios.
[0048] Step S201: Generate a random noise vector and input the random noise vector into the generator network to generate an initial facial feature vector.
[0049] In step S201 above, a random algorithm is first used to generate initial random noise vectors corresponding to one or more face images. These vectors are typically composed of a string of random numbers, forming the basis of the generator network input. The purpose of generating random noise vectors is to provide a diverse starting point, making the generated face images unpredictable and diverse. The generated random noise vectors are then input into the generator network, which learns from the random noise and generates vectors with specific facial features. In this embodiment, the generator network transforms the random noise into an initial facial feature vector, which contains the basic structural information of the face to be generated, such as facial contours, facial feature distribution, and other static features.
[0050] Step S202: The initial facial feature vector is used as input data and fed into the temporal generation model of the generator network to output a dynamic feature vector.
[0051] In step S202 above, the initial facial feature vector is input as input data to the temporal generation model. The temporal generation model is a pre-built model for generating dynamic features. Based on the initial facial feature vector, the temporal generation model combines dynamic parameters (such as head rotation angle, blinking frequency, etc.) to generate a series of dynamic feature vectors that reflect the dynamic changes of the face at different time points.
[0052] Dynamic feature vectors contain information about the dynamic changes of the face at different points in time, such as subtle head movements, eye opening and closing, and mouth movements. Temporal generation models learn from the time series of facial dynamic features in training data to generate feature sequences similar to the dynamic changes of real faces. This process enables the generated facial images to exhibit natural and smooth expressions and movements, increasing the realism and complexity of the images.
[0053] Furthermore, the generator network and the discriminator network constitute a generative adversarial network (GAN). The steps for constructing the GAN include: Step 1, acquiring historical dynamic face images and preprocessing them, and constructing training samples based on the preprocessed historical dynamic face images; Step 2, selecting the generator network architecture and the discriminator network architecture to construct an initial GAN, wherein the generator network architecture integrates a temporal generation model and an illumination simulation model; Step 3, iteratively training the discriminator network based on the training samples and randomly generated dynamic face images from the generator network to obtain a trained discriminator network; Step 4, iteratively updating the parameters of the generator network based on the trained discriminator network to obtain a trained discriminator network; Step 5, repeating steps 3 to 4 above, and determining the final generator network and discriminator network based on N rounds of iterative training to obtain a trained GAN, where N is a positive integer.
[0054] Specifically, the generator network is a part of the generative adversarial network (GAN), which includes a generator network and a discriminator network. During the training phase, the discriminator network guides the iterative training of the generator network. First, a large dataset of historical dynamic face images is collected. This image data should cover various facial expressions, head movements, and facial images under different lighting conditions. The preprocessing stage includes data cleaning, standardization, and possible augmentation operations, such as random cropping and flipping, to ensure the quality and diversity of the training data. The preprocessed dynamic face images are used as the foundation for building training samples to guide the learning of the GAN. Suitable generator and discriminator network architectures are selected to build the initial GAN. In this process, the generator network is designed as a composite network integrating a temporal generation model and a lighting simulation model. The temporal generation model is responsible for generating dynamic features, while the lighting simulation model is used to simulate reflection effects under complex lighting conditions. The choice of the discriminator network architecture must consider its ability to distinguish between real and fake images. Based on the preprocessed training samples, the discriminator network begins iterative training. This process involves simultaneously feeding a discriminator with real facial images and randomly generated images, allowing the discriminator to learn to distinguish between real and fake images. As training progresses, the discriminator's accuracy gradually improves, enabling it to more accurately identify the fake features of the generated images.
[0055] After the discriminator network reaches a certain training level, the parameters of the generator network are iteratively updated based on the information fed back from the discriminator. The goal of this stage is to make the images generated by the generator as misleading as possible to the discriminator, that is, to make the generated images look more realistic and not easily distinguishable as fake images. The generator continuously optimizes the transformation between noise vectors and feature vectors to produce more realistic face images. The iterative training of the discriminator network and the generator network needs to be repeated N times (N is a positive integer) until the adversarial training of the generator network and the discriminator network reaches an equilibrium state, that is, the generator network can stably output high-quality, hard-to-detect dynamic face images, while the discriminator network can also accurately distinguish between real and fake images. This process, through continuous iteration, allows the generator and discriminator networks to compete with each other and evolve together, ultimately resulting in a trained generative adversarial network.
[0056] Furthermore, the steps of inputting the initial facial feature vector as input data into the temporal generation model of the generator network and outputting the dynamic feature vector include: defining conditional parameters for each time step and generating dynamic control signals for each time step based on the conditional parameters, wherein the conditional parameters include at least one of the following: head rotation angle, blinking state, and mouth movement amplitude, wherein the time step represents each discrete time point in the time series; inputting the dynamic control signals of each time step and the initial facial feature vector as input data into the temporal generation model; and transforming the initial facial feature vector based on the dynamic control signals of each time step to obtain the dynamic feature vector.
[0057] Specifically, when generating dynamic feature vectors, the conditional parameters for each time step are first defined. These parameters guide the generation of dynamic features. Conditional parameters include, but are not limited to, head rotation angle, blinking state, and mouth movement amplitude. Each time step represents a discrete point in a predefined time series. By setting the conditional parameters at these points, the dynamic performance of the face in the image sequence can be finely controlled. Based on the defined conditional parameters, the temporal generation model of the generator network generates corresponding dynamic control signals to control the changes in facial features in the image. These dynamic control signals are calculated based on the conditional parameters at each time step and are used to guide the generator network to generate specific dynamic feature vectors at each time point. The dynamic control signals at each time step are combined with the initial facial feature vector as input to the temporal generation model. In this way, the model not only has basic facial information but also dynamic control instructions that change over time, ensuring that the generated face image exhibits continuous and coordinated dynamic effects.
[0058] After receiving the dynamic control signal and the initial facial feature vector, the temporal generation model uses its internal transformation mechanism to adjust the initial facial feature vector based on the temporal correlation between images, so as to reflect the changes in the conditional parameters in the dynamic control signal. This process is repeated at each time step, thereby generating a series of dynamic feature vectors, each vector corresponding to a time point in the time series and containing the dynamic facial feature information at that time point.
[0059] Furthermore, the steps for defining the conditional parameters for each time step include: defining the head rotation angle and constructing the rotation matrix for each time step based on the initial angle and the head rotation angle; modeling the blinking degree at each time step based on the time-varying modulation function to obtain the eye features at each time step; modeling the mouth opening and closing degree at each time step based on the time-varying modulation function to obtain the mouth features at each time step; and obtaining the conditional parameters based on the rotation matrix, eye features, and mouth features at each time step.
[0060] Specifically, the conditional parameters include: head rotation angle, blink rate, and mouth opening / closing. Regarding head rotation, during dynamic face generation, the head rotation angle changes over time. The initial head angle and the head rotation angle are used to construct rotation matrices for each time step. Where θ(t) represents the head rotation angle at time t.
[0061] Blinking is the process of the eyelids closing and opening, which is represented by changes in pixel values in the eye area of a face image. The degree of blinking, E(t), can be modeled using a time-varying modulation function: Where T is the blink cycle, and the degree of blinking changes periodically during this cycle, thus obtaining eye features.
[0062] Mouth changes are characterized by mouth opening and closing, and the mouth opening and closing M(t) can also be modeled based on a time-varying modulation function: Where T is the mouth opening cycle, thus obtaining mouth features.
[0063] Conditional parameters are obtained based on the rotation matrix, eye features, and mouth features at each of the above time steps.
[0064] Step S203: The initial facial feature vector is used as input data and fed into the illumination simulation model of the generator network to output the illumination feature vector.
[0065] In step S203 above, the initial facial feature vector is used as input data and simultaneously input to the lighting simulation model. The lighting simulation model is integrated into the generator network and is a pre-built model used to generate simulated lighting conditions and generate lighting features. By training on a large number of facial images under real lighting conditions, it learns how to predict the effect of lighting on the reflection effect of the face according to different lighting conditions (such as the position, intensity, color, etc. of the light source), thereby generating the lighting feature vector.
[0066] Furthermore, the step of inputting the initial facial feature vector as input data into the illumination simulation model of the generator network and outputting the illumination feature vector includes: inputting the initial facial feature vector into the illumination simulation model, generating illumination parameters for each time step through the illumination simulation model, wherein the illumination parameters include at least one of the following: illumination intensity, light source position, light source color, shadow coefficient, and light reflection coefficient; mapping the illumination parameters to the facial feature vector through the illumination simulation model to obtain the illumination feature vector for each time step.
[0067] In some optional embodiments, simulating lighting conditions using a lighting simulation model to generate face images under different lighting conditions during the generation of dynamic face images is one of the core steps to improve image realism. Real-world face images are significantly affected by lighting; different lighting conditions alter the shadows, highlights, and colors of the face, thus affecting the perception of facial features and making face recognition more difficult. The lighting simulation model can generate or adjust these lighting effects, making the synthesized face images closer to reality in detail and texture, increasing the image's realism.
[0068] Specifically, firstly, the initial facial feature vector is used as input to the lighting simulation model. Based on this vector, the model generates a series of lighting parameters that vary at different time steps to simulate the dynamic changes in lighting in the real world. These lighting parameters can include, but are not limited to, light intensity, light source position, light source color, shadow coefficient, and reflectance coefficient. Even subtle adjustments to each parameter can significantly affect the visual effect of the final image. Next, the lighting simulation model maps the generated lighting parameters onto facial features. This process involves deep adjustments to the initial facial feature vector to reflect the impact of lighting changes. For example, adjusting the light intensity and position parameters can alter the highlights and shadows of the face; while adjusting the source color and reflectance coefficient affects the color and texture of the face, making it more consistent with real-world lighting conditions. Through this mapping process, the initial facial feature vector is transformed into a description of the face's appearance under specific lighting conditions—that is, a lighting feature vector.
[0069] Furthermore, the step of mapping lighting parameters to facial feature vectors using a lighting simulation model includes: calculating the lighting intensity of each pixel at each time step based on the lighting intensity and light source position using a lighting simulation model; calculating the reflection intensity of each pixel at each time step based on the light source color and light reflection coefficient using a lighting simulation model; and calculating the shadow feature vector at each time step based on the shadow coefficient using a lighting simulation model.
[0070] The mapping process ensures that facial features in the image accurately reflect changes in lighting parameters, thus visually creating an image highly consistent with real lighting effects, increasing the realism and complexity of the forged face image. Specifically, firstly, based on the light intensity and light source position, the lighting simulation model calculates the light intensity of each pixel in the initial face image step by step. This quantifies how the light source illuminates different parts of the face and how this illumination is affected by facial structure and posture. Then, based on the light source color and reflectance coefficient, the lighting simulation model continues to calculate the reflection intensity of each pixel at different time steps. The light source color affects the color of the reflected light, while the reflectance coefficient determines how the facial surface reflects light. Combining these two factors allows for the simulation of reflection effects of different colors and intensities, further enhancing the realism of the image. Finally, based on the shadow coefficient, the lighting simulation model calculates the shadow distribution of the face at each time step, forming a shadow feature vector. The shadow coefficient represents the degree of light source occlusion and the depth of the shadow, ensuring that the shadow is consistent with the light source position, light intensity, and facial structure, making the image more closely resemble a real scene in terms of lighting complexity.
[0071] Step S204: The dynamic feature vector and the illumination feature vector are fused based on the attention mechanism to obtain the fused feature vector, and a set of dynamic face images is generated based on the fused feature vector through the generator network.
[0072] In step S204 above, an attention mechanism is used to fuse the generated dynamic feature vector and illumination feature vector. The attention mechanism calculates the correlation between the two vectors and performs weighted fusion to produce a fused feature vector. This process allows dynamic features and illumination features to work together to determine the final appearance of the generated image, especially in dynamic changes and illumination detail processing, enhancing the realism and naturalness of the image.
[0073] The generator network generates a dynamic set of face images based on the fused feature vectors. This set comprises multiple frames, each reflecting different dynamic features (such as slight head movements and blinking) and lighting conditions (such as natural light and indoor lighting at different times). This ensures the generated image set not only possesses high realism in individual frames but also smoothly displays dynamic changes in the face, consistent with real-world observation. The generated dynamic face image set is used as sample data to train a face authentication model in financial scenarios, improving the model's authentication capabilities and thus enhancing data and business security.
[0074] In another alternative embodiment, the decoder of the generator network receives a fused feature vector as input. The decoder's task is to transform the abstract feature vector into visual image data. This process is similar to reconstructing the geometry, texture, and dynamic changes of a face from a set of numerical codes describing facial features, while also taking into account the effects of lighting conditions. The decoder reconstructs the image progressively through multiple layers of neural networks, with each layer adding more detail to the input feature vector until a complete dynamic face image is finally output. Since the fused feature vector contains dynamic feature information that changes over time, the next step for the generator network is to unfold this information in a time sequence to generate a series of dynamic image frames. To ensure the high fidelity of the dynamic face image set, the generator network needs to generate high-resolution images. This can be achieved through upsampling layers or a specific generative network architecture, ensuring rich image details, clear textures, and the ability to simulate subtle features of a real face, such as skin texture and hair details, maintaining a high degree of realism even when viewed at magnification.
[0075] Finally, the generator network outputs high-resolution dynamic face images frame by frame, with each frame containing all the details specified by the fused feature vector. These images are arranged chronologically to form a dynamic face image set, where each image shows the facial state and lighting conditions of a person at a specific point in time, forming a coherent dynamic sequence that can be used to simulate realistic face videos or dynamic photographs.
[0076] Furthermore, the steps for fusing dynamic feature vectors and illumination feature vectors based on an attention mechanism to obtain a fused feature vector include: transforming the dynamic feature vectors and illumination feature vectors respectively using a learnable projection matrix to obtain the query vector corresponding to the dynamic feature vector and the key vector corresponding to the illumination feature vector; calculating attention weights based on the query vector and illumination feature vector, and performing weighted calculations on the illumination feature vector based on the attention weights to obtain a weighted illumination feature vector; and performing a dot product operation on the dynamic feature vector and the weighted illumination feature vector to obtain the fused feature vector.
[0077] Specifically, firstly, the dynamic feature vector and illumination feature vector are transformed using a learnable projection matrix. This matrix is optimized through a deep learning process, converting the dynamic feature vector into a query vector and the illumination feature vector into a key vector. The generation of the query and key vectors provides the necessary format for subsequent attention weight calculations. Then, attention weights are obtained based on the similarity or relevance between the query and key vectors. The core of this calculation process is to measure the relative importance of dynamic and illumination features in the image generation process, thereby determining the weighting ratio of the illumination feature vector in the fusion process. Using the attention weights calculated above, the illumination feature vector is weighted to obtain a weighted illumination feature vector. This weighting process ensures that the lighting effect is more refined and natural in the final image, especially in lighting changes triggered by dynamic features, such as shadow displacement when the head rotates or highlight adjustment when blinking. Finally, the dynamic feature vector and the weighted illumination feature vector are multiplied by a dot product to obtain the fused feature vector.
[0078] Step S205: Use the generated set of dynamic face images as training samples to train the face authentication model, and use the trained face authentication model to authenticate real face images.
[0079] In step S205 above, the generated set of dynamic face images is used as training samples to train a face authentication model. This model is then used to authenticate real face images, thereby improving the authentication capabilities of financial institutions in face authentication scenarios. The real face images can be either static or dynamic.
[0080] A dynamic set of face images is ready as training samples. This set of images not only includes a variety of dynamic changes (such as slight head movements, blinking, smiling, etc.), but also takes into account the reflection effects under complex lighting conditions, ensuring that the images are visually highly similar to real faces. At the same time, subtle differences and forgery features are added to simulate various possible attack scenarios.
[0081] The face authentication model begins training on a dynamic set of face images. These dynamically generated images serve as negative samples, guiding the model to distinguish between real and fake faces. Through iterative training, the model gradually optimizes its internal parameters to improve accuracy under dynamic changes and complex lighting conditions. During this stage, the model learns how dynamic features and lighting effects relate to real faces, and how to identify subtle forgery cues that appear natural but are actually created by the generator network. This iterative training process yields the face authentication model, which is then applied to face authentication scenarios.
[0082] Through the above steps, a random noise vector is generated and input into the generator network to generate an initial facial feature vector. This initial facial feature vector is then used as input data to the temporal generation model of the generator network, outputting a dynamic feature vector. The temporal generation model is a pre-built model for generating dynamic features. The initial facial feature vector is also used as input data to the illumination simulation model of the generator network, outputting an illumination feature vector. This illumination simulation model is a pre-built model for generating simulated illumination conditions and illumination features. Finally, the dynamic feature vector and the illumination feature vector are fused using an attention mechanism to obtain a fused feature vector. The generator network then generates a dynamic face image set based on this fused feature vector. This generated dynamic face image set is used as training samples to train a face authentication model, which is then used to authenticate real face images.
[0083] In this embodiment, a temporal generation model and an illumination simulation model are integrated into the generator network. This enables the generation of dynamic features and illumination features based on set parameters, thereby generating dynamic face images containing dynamic expressions and complex lighting conditions. These dynamic face images are then used as training samples to train a face authentication model for accurate authentication of real faces. This achieves the technical objective of generating complex face images, adapting to complex face recognition scenarios and improving the quality and accuracy of face image generation. This enhances the accuracy of face authentication and solves the technical problem in related technologies where the generation of static face images based on deep learning and generative adversarial networks results in low image accuracy and consequently low authentication accuracy.
[0084] The following describes in detail another optional implementation method.
[0085] Figure 3 This is an optional discriminator network and generator network architecture diagram according to an embodiment of the present invention, such as... Figure 3 As shown, this embodiment of the invention constructs a dynamic face image generation network, which includes a generator network and a discriminator network. The generator network integrates a temporal generation model and an illumination simulation model, which are used to generate dynamic features and illumination features of face images, respectively. During the training phase, the generator network generates random images based on random noise. The generated images and real images are input into the discriminator, which judges the authenticity of the images generated by the generator network to obtain the discrimination result. The parameters of the generator network are adjusted according to the discrimination result to achieve iterative training of the generator network.
[0086] In practical applications, random noise is input into the generator network. The time-series generation model and the illumination simulation model integrated in the generator network generate dynamic feature vectors and illumination feature vectors based on the random noise, respectively. These dynamic and illumination feature vectors are then fused to obtain a fused feature vector. Finally, a dynamic set of face images is output based on this fused feature vector. Specifically,
[0087] The generation process of the generator network is as follows:
[0088] G(z t ,c t )→x fake,t .
[0089] Where G is the generator, z t It is a noise vector, c t It is the aggregated feature at the current time t, x fake,t It is a fake image generated at time step t.
[0090] The input to the time series generation model is the conditional parameter c. t For example, the head rotation angle, blinking state, and mouth opening amplitude at the current time step, combined with the noise vector z. t Generate dynamic features at a specific time t.
[0091] Regarding head rotation, the rotation matrix applies to each pixel in the image. In dynamic face image generation, the head rotation angle changes over time. If the head rotation angle at time t is θ(t), then the corresponding rotation matrix is:
[0092]
[0093] Blinking is the process of the eyelids closing and opening, which is represented in an image as changes in pixel values in the eye area. The degree of blinking, E(t), can be modeled using a time-varying modulation function:
[0094]
[0095] Where T represents the blink cycle, and the degree of blinking changes periodically within this cycle. Similarly, the opening and closing degree M(t) of the mouth opening action can also be represented in this way. Combining the above transformations, the dynamic characteristics can be obtained:
[0096] I dynamic (t)=R(θ(t))·I0+E(t)·E0+M(t)·M0;
[0097] Among them, I dynamic (t) represents the dynamic features, I0 represents the initial head features, E0 represents the initial eye features, and M0 represents the initial mouth features.
[0098] In addition, to address the problem of generating unnatural facial images under complex lighting conditions using existing technologies, this invention presents a lighting simulation model based on lighting conditions modeling. This model can simulate different light sources, light reflections, and shadow effects to ensure that the generated fake facial images have a high degree of realism under different lighting conditions.
[0099] Specifically, this invention combines real-world lighting data with multiple parameters of the light source (such as direction, intensity, and color) and the generated initial facial image to dynamically simulate complex lighting and reflection effects during the generation process. At time t, if there are N light sources, each with a direction, intensity, and color of […],… I i C i (i = 1, 2, ..., N). The reflection effect of the generated face image can be simulated using the following physical model:
[0100]
[0101] Among them, I reflect (x) represents the intensity of the reflected light at position x, I i Let be the intensity of the i-th light source. It is the direction vector of the i-th light source. C is the facial normal vector at position x. i It is the color of the i-th light source. This is a reflective model that calculates reflection intensity based on the direction of the light source, the surface normal, and the color of the light source. Φ(x) is an adjustment factor used to control the effect of illumination on that location.
[0102] In this embodiment of the invention, a temporal generation network and an illumination simulation model are integrated into the generator network to construct a dynamic face generation model. This model can overcome the shortcomings of existing technologies in terms of accurately controlling dynamic features, simulating multi-color face reflection effects under complex illumination conditions, and providing more diverse fake face generation. Based on the generated dynamic face images, a face authentication model is trained, thereby improving the security and accuracy of the face authentication model.
[0103] The following is a detailed description with reference to another embodiment.
[0104] Example 2
[0105] The face image authentication device provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in the above embodiment one. The specific implementation method and beneficial effects can be referred to the aforementioned method embodiment, and will not be repeated here.
[0106] Figure 4This is a schematic diagram of an optional face image authentication device according to an embodiment of the present invention, such as... Figure 4 As shown, the face image authentication device may include: a first generation unit 41, a first output unit 42, a second output unit 43, and a second generation unit 44, wherein,
[0107] The first generation unit 41 is used to generate a random noise vector and input the random noise vector into the generator network to generate an initial facial feature vector.
[0108] The first output unit 42 is used to input the initial facial feature vector as input data into the temporal generation model of the generator network and output a dynamic feature vector. The temporal generation model is a pre-built model for generating dynamic features.
[0109] The second output unit 43 is used to input the initial facial feature vector as input data into the illumination simulation model of the generator network and output the illumination feature vector. The illumination simulation model is a pre-built model for generating simulated illumination conditions and generating illumination features.
[0110] The second generation unit 44 is used to fuse the dynamic feature vector and the illumination feature vector based on the attention mechanism to obtain the fused feature vector, and then generate a dynamic face image set based on the fused feature vector through the generator network.
[0111] The fake detection unit 45 is used to train the face fake detection model by using the generated dynamic face image set as training samples, and to perform fake detection on real face images based on the trained face fake detection model.
[0112] The aforementioned face image authentication device generates a random noise vector through a first generation unit 41, and inputs the random noise vector into a generator network to generate an initial facial feature vector. A first output unit 42 takes the initial facial feature vector as input data and inputs it into the temporal generation model of the generator network, outputting a dynamic feature vector. The temporal generation model is a pre-built model for generating dynamic features. A second output unit 43 takes the initial facial feature vector as input data and inputs it into the illumination simulation model of the generator network, outputting an illumination feature vector. The illumination simulation model is a pre-built model for generating simulated illumination conditions and illumination features. A second generation unit 44 fuses the dynamic feature vector and the illumination feature vector based on an attention mechanism to obtain a fused feature vector, and the generator network generates a dynamic face image set based on the fused feature vector. An authentication unit 45 uses the generated dynamic face image set as training samples to train a face authentication model, and uses the trained face authentication model to authenticate real face images.
[0113] In this embodiment, a temporal generation model and an illumination simulation model are integrated into the generator network. This enables the generation of dynamic features and illumination features based on set parameters, thereby generating dynamic face images containing dynamic expressions and complex lighting conditions. These dynamic face images are then used as training samples to train a face authentication model for accurate authentication of real faces. This achieves the technical objective of generating complex face images, adapting to complex face recognition scenarios and improving the quality and accuracy of face image generation. This enhances the accuracy of face authentication and solves the technical problem in related technologies where the generation of static face images based on deep learning and generative adversarial networks results in low image accuracy and consequently low authentication accuracy.
[0114] Furthermore, the first output unit includes: a first definition module, used to define the conditional parameters for each time step, and generate dynamic control signals for each time step based on the conditional parameters, wherein the conditional parameters include at least one of the following: head rotation angle, blinking state, and mouth movement amplitude, wherein the time step represents each discrete time point in the time series; a first input module, used to input the dynamic control signals for each time step and the initial facial feature vector as input data into the time series generation model; and a first transformation module, used by the time series generation model to transform the initial facial feature vector based on the dynamic control signals for each time step to obtain a dynamic feature vector.
[0115] Furthermore, the first definition module includes: a first construction submodule, used to define the head rotation angle and construct the rotation matrix for each time step based on the initial angle and the head rotation angle; a first modeling submodule, used to model the blinking degree at each time step based on the time-varying modulation function to obtain the eye features at each time step; a second modeling submodule, used to model the mouth opening degree at each time step based on the time-varying modulation function to obtain the mouth features at each time step; and a first acquisition submodule, used to obtain conditional parameters based on the rotation matrix, eye features, and mouth features at each time step.
[0116] Furthermore, the second output unit includes: a first generation module, used to input the initial facial feature vector into the lighting simulation model, and generate lighting parameters for each time step through the lighting simulation model, wherein the lighting parameters include at least one of the following: light intensity, light source position, light source color, shadow coefficient, and light reflection coefficient; and a first mapping module, used to map the lighting parameters to the facial feature vector through the lighting simulation model to obtain the lighting feature vector for each time step.
[0117] Furthermore, the first mapping module includes: a first calculation submodule, used to calculate the illumination intensity of each pixel at each time step based on the illumination intensity and the position of the light source using a lighting simulation model; a second calculation submodule, used to calculate the reflection intensity of each pixel at each time step based on the color of the light source and the light reflection coefficient using a lighting simulation model; and a third calculation submodule, used to calculate the shadow feature vector at each time step based on the shadow coefficient using a lighting simulation model.
[0118] Furthermore, the second generation unit includes: a first transformation module, used to transform the dynamic feature vector and the illumination feature vector respectively through a learnable projection matrix to obtain the query vector corresponding to the dynamic feature and the key vector corresponding to the illumination feature vector; a first calculation module, used to calculate the attention weight based on the query vector and the illumination feature vector, and perform weighted calculation on the illumination feature vector based on the attention weight to obtain a weighted illumination feature vector; and a first operation module, used to perform a dot product operation on the dynamic feature vector and the weighted illumination feature vector to obtain a fused feature vector.
[0119] Furthermore, the generator network and discriminator network constitute a generative adversarial network (GAN). The face image authentication device further includes: a first construction module, used in step one to acquire historical dynamic face images and preprocess them, constructing training samples based on the preprocessed historical dynamic face images; a second construction module, used in step two to select the generator network architecture and discriminator network architecture to construct an initial GAN, wherein the generator network architecture integrates a temporal generation model and an illumination simulation model; a first training module, used in step three to iteratively train the discriminator network based on the training samples and randomly generated dynamic face images from the generator network, obtaining a trained discriminator network; a first update module, used in step four to iteratively update the parameters of the generator network based on the trained discriminator network, obtaining a trained discriminator network; and a first repetition module, used in step five to repeat steps three to four above, conducting N rounds of iterative training to determine the final generator network and discriminator network, obtaining a trained GAN, where N is a positive integer.
[0120] It should be noted that the first generation unit 41, the first output unit 42, the second output unit 43, the second generation unit 44, and the counterfeit detection unit 45 mentioned above correspond to steps S201 to S205 in Embodiment 1. The instances and application scenarios implemented by the above units and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware components or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules or units can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0121] The invention will now be described in conjunction with another alternative embodiment.
[0122] Example 3
[0123] The present invention can also provide an electronic device. Figure 5 This is a hardware structure block diagram of an electronic device (or mobile device) that performs an optional method for detecting fake faces in an embodiment of the present invention, as shown below. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 Only one of the components is shown: processor 502, memory 504, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module, and display.
[0124] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0125] The processor can access information and applications stored in memory via a transmission device to execute the following steps: generating a random noise vector and inputting it into a generator network to generate an initial facial feature vector; inputting the initial facial feature vector as input data into a temporal generation model of the generator network and outputting a dynamic feature vector, wherein the temporal generation model is a pre-built model for generating dynamic features; inputting the initial facial feature vector as input data into a lighting simulation model of the generator network and outputting a lighting feature vector, wherein the lighting simulation model is a pre-built model for generating simulated lighting conditions and generating lighting features; fusing the dynamic feature vector and the lighting feature vector based on an attention mechanism to obtain a fused feature vector, and generating a dynamic face image set based on the fused feature vector through the generator network; using the generated dynamic face image set as training samples to train a face authentication model, and performing authentication of real face images based on the trained face authentication model.
[0126] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: defining the conditional parameters for each time step, and generating dynamic control signals for each time step based on the conditional parameters, wherein the conditional parameters include at least one of the following: head rotation angle, blinking state, and mouth movement amplitude, wherein the time step represents each discrete time point in the time series; inputting the dynamic control signals of each time step and the initial facial feature vector as input data into the time series generation model; the time series generation model transforms the initial facial feature vector based on the dynamic control signals of each time step to obtain the dynamic feature vector.
[0127] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: define the head rotation angle and construct the rotation matrix for each time step based on the initial angle and the head rotation angle; model the blinking degree for each time step based on the time-varying modulation function to obtain the eye features for each time step; model the mouth opening degree for each time step based on the time-varying modulation function to obtain the mouth features for each time step; and obtain the conditional parameters based on the rotation matrix, eye features, and mouth features for each time step.
[0128] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: inputting the initial facial feature vector into the lighting simulation model, generating lighting parameters for each time step through the lighting simulation model, wherein the lighting parameters include at least one of the following: light intensity, light source position, light source color, shadow coefficient, and light reflection coefficient; mapping the lighting parameters to the facial feature vector through the lighting simulation model to obtain the lighting feature vector for each time step.
[0129] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: calculating the illumination intensity of each pixel at each time step using a lighting simulation model based on illumination intensity and light source position; calculating the reflection intensity of each pixel at each time step using a lighting simulation model based on light source color and light reflection coefficient; and calculating the shadow feature vector at each time step using a lighting simulation model based on shadow coefficient.
[0130] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: transform the dynamic feature vector and the illumination feature vector respectively through the learnable projection matrix to obtain the query vector corresponding to the dynamic feature and the key vector corresponding to the illumination feature vector; calculate the attention weight based on the query vector and the illumination feature vector, and perform weighted calculation on the illumination feature vector based on the attention weight to obtain the weighted illumination feature vector; perform a dot product operation on the dynamic feature vector and the weighted illumination feature vector to obtain the fused feature vector.
[0131] The processor can also access information and applications stored in memory via a transmission device to perform the following steps:
[0132] Step 1: Acquire historical dynamic face images and preprocess them. Construct training samples based on the preprocessed historical dynamic face images. Step 2: Select a generator network architecture and a discriminator network architecture to construct an initial generative adversarial network (GAN). The generator network architecture integrates a temporal generation model and a lighting simulation model. Step 3: Iteratively train the discriminator network based on the training samples and randomly generated dynamic face images from the generator network to obtain a trained discriminator network. Step 4: Iteratively update the parameters of the generator network based on the trained discriminator network to obtain a trained discriminator network. Step 5: Repeat steps 3 and 4 for N rounds of iterative training to determine the final generator network and discriminator network, resulting in a trained GAN, where N is a positive integer.
[0133] This invention provides a method for detecting fake faces in facial images. By integrating a temporal generation model and an illumination simulation model into a generator network, dynamic features and illumination features can be generated according to set parameters. This results in dynamic facial images containing dynamic expressions and complex lighting conditions, which are then used as training samples to train a facial fake-detection model for accurate detection of real faces. This achieves the technical objective of generating complex facial images, adapting to complex facial recognition scenarios and improving the quality and accuracy of generated facial images. This enhances the accuracy of facial fake-detection and solves the problem in related technologies where methods based on deep learning and generative adversarial networks generate static facial images, resulting in low image accuracy and consequently low fake-detection accuracy.
[0134] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 5 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 5 The different configurations shown.
[0135] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0136] The invention will now be described in conjunction with another alternative embodiment.
[0137] Example 4
[0138] This invention also provides a computer-readable storage medium. Optionally, in this invention, the computer-readable storage medium can be used to store the program code executed by the face image authentication method provided in Embodiment 1.
[0139] Optionally, in this embodiment of the invention, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0140] This invention also provides a computer program product, which, when executed on a data processing device, is suitable for performing the steps of a face image authentication method: generating a random noise vector and inputting the random noise vector into a generator network to generate an initial facial feature vector; inputting the initial facial feature vector as input data into a temporal generation model of the generator network and outputting a dynamic feature vector, wherein the temporal generation model is a pre-built model for generating dynamic features; inputting the initial facial feature vector as input data into a lighting simulation model of the generator network and outputting a lighting feature vector, wherein the lighting simulation model is a pre-built model for generating simulated lighting conditions and generating lighting features; fusing the dynamic feature vector and the lighting feature vector based on an attention mechanism to obtain a fused feature vector, and generating a dynamic face image set based on the fused feature vector through the generator network; using the generated dynamic face image set as training samples to train a face authentication model, and performing authentication of real face images based on the trained face authentication model.
[0141] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0142] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0143] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0144] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0145] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0146] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0147] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for authenticating facial images, characterized in that, include: A random noise vector is generated and input into the generator network to generate an initial facial feature vector; The initial facial feature vector is used as input data and fed into the temporal generation model of the generator network to output a dynamic feature vector. The temporal generation model is a pre-built model for generating dynamic features. The initial facial feature vector is used as input data and fed into the illumination simulation model of the generator network to output an illumination feature vector. The illumination simulation model is a pre-built model used to generate simulated illumination conditions and generate illumination features. The dynamic feature vector and the illumination feature vector are fused based on the attention mechanism to obtain a fused feature vector, and a dynamic face image set is generated by the generator network based on the fused feature vector. The generated set of dynamic face images is used as training samples to train a face authentication model, and the trained face authentication model is used to authenticate real face images.
2. The method according to claim 1, characterized in that, The steps of using the initial facial feature vector as input data and feeding it into the temporal generation model of the generator network to output a dynamic feature vector include: Define conditional parameters for each time step, and generate dynamic control signals for each time step based on the conditional parameters. The conditional parameters include at least one of the following: head rotation angle, blinking state, and mouth movement amplitude. The time step represents each discrete time point in the time series. The dynamic control signals and the initial facial feature vector at each time step are input into the time series generation model as input data; The time-series generation model transforms the initial facial feature vector based on the dynamic control signal at each time step to obtain the dynamic feature vector.
3. The method according to claim 2, characterized in that, The steps for defining the conditional parameters for each time step include: Define the head rotation angle and construct the rotation matrix for each time step based on the initial angle and the head rotation angle; The blinking intensity at each time step is modeled based on a time-varying modulation function to obtain the eye features at each time step. The mouth opening and closing degree at each time step is modeled based on the time-varying modulation function to obtain the mouth features at each time step. The conditional parameters are obtained based on the rotation matrix, the eye features, and the mouth features at each time step.
4. The method according to claim 1, characterized in that, The steps of inputting the initial facial feature vector as input data into the illumination simulation model of the generator network and outputting the illumination feature vector include: The initial facial feature vector is input into the lighting simulation model, and the lighting simulation model generates lighting parameters for each time step. The lighting parameters include at least one of the following: light intensity, light source position, light source color, shadow coefficient, and light reflection coefficient. The illumination parameters are mapped to the facial feature vector using the illumination simulation model to obtain the illumination feature vector at each time step.
5. The method according to claim 4, characterized in that, The step of mapping the lighting parameters to the facial feature vector using the lighting simulation model includes: Based on the light intensity and the position of the light source, the light intensity of each pixel at each time step is calculated using the light simulation model. Based on the light source color and light reflection coefficient, the reflection intensity of each pixel at each time step is calculated using the lighting simulation model. Based on the shadow coefficient, the shadow feature vector at each time step is calculated using the lighting simulation model.
6. The method according to claim 1, characterized in that, The steps for fusing the dynamic feature vector and the illumination feature vector based on an attention mechanism to obtain the fused feature vector include: The dynamic feature vector and the illumination feature vector are transformed by a learnable projection matrix to obtain the query vector corresponding to the dynamic feature and the key vector corresponding to the illumination feature vector. The attention weight is calculated based on the query vector and the illumination feature vector, and the illumination feature vector is weighted based on the attention weight to obtain a weighted illumination feature vector. The dynamic feature vector and the weighted illumination feature vector are multiplied by a dot product to obtain the fused feature vector.
7. The method according to claim 1, characterized in that, The generator network and the discriminator network constitute a generative adversarial network (GAN). The steps for constructing the GAN include: Step 1: Acquire historical dynamic face images, preprocess the historical dynamic face images, and construct training samples based on the preprocessed historical dynamic face images; Step 2: Select the generator network architecture and the discriminator network architecture to construct the initial generative adversarial network, wherein the generator network architecture integrates the temporal generation model and the illumination simulation model; Step 3: Iteratively train the discriminator network based on the training samples and the randomly generated dynamic face images by the generator network to obtain the trained discriminator network; Step 4: Iteratively update the parameters of the generator network based on the trained discriminator network to obtain the trained discriminator network; Step 5: Repeat steps 3 and 4 above. Based on N rounds of iterative training, determine the final generator network and discriminator network to obtain the trained generative adversarial network, where N is a positive integer.
8. A device for detecting forgery of facial images, characterized in that, include: The first generation unit is used to generate a random noise vector and input the random noise vector into the generator network to generate an initial facial feature vector; The first output unit is used to input the initial facial feature vector as input data into the temporal generation model of the generator network and output a dynamic feature vector, wherein the temporal generation model is a pre-built model for generating dynamic features. The second output unit is used to input the initial facial feature vector as input data into the illumination simulation model of the generator network and output the illumination feature vector. The illumination simulation model is a pre-built model for generating simulated illumination conditions and generating illumination features. The second generation unit is used to fuse the dynamic feature vector and the illumination feature vector based on an attention mechanism to obtain a fused feature vector, and then generate a dynamic face image set based on the fused feature vector through the generator network. The fake detection unit is used to train a face fake detection model using the generated set of dynamic face images as training samples, and to perform fake detection on face images based on the trained face fake detection model.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method for detecting fake faces as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, The device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for detecting fake faces as described in any one of claims 1 to 7.