A data generation method and device, a storage medium and an electronic device
By adding a target transition operator to the action instruction sequence, the problem of high storage and computation costs in the generation of simulated attack videos is solved, and efficient data generation and effective face recognition functions are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU ANT KUAI TECHNOLOGY CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies suffer from excessive storage and computation costs and insufficient recognition efficiency when generating simulated attack videos, resulting in inadequate reliability of facial recognition functions.
By determining the state differences between adjacent action unit operators in the action instruction sequence, a target transition operator is added to generate smooth action execution data, thereby improving the coherence and accuracy of the action execution data.
It improves the efficiency of generating simulated attack videos and the utilization rate of data storage space, and enhances the effectiveness and adaptability of facial recognition functions.
Smart Images

Figure CN122135148A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and more specifically, to a data generation method, apparatus, storage medium, and electronic device in the field of computer technology. Background Technology
[0002] Nowadays, with the continuous development of the economy and the times, facial recognition is used to improve the accuracy of identity authentication when performing actions that require authentication. However, in order to ensure the reliability of the facial recognition function in the device, it is necessary to simulate attacks on the recognition device. Generating simulated attacks requires the pre-generation of a complete video of all action combinations, resulting in excessive storage and computing costs and insufficient recognition efficiency. Therefore, how to improve the generation efficiency of simulated attack videos and the utilization rate of data storage space has become an urgent problem to be solved. Summary of the Invention
[0003] This specification provides a data generation method, apparatus, storage medium, and electronic device. The method can determine the difference between the beginning and end states of the action unit operators corresponding to adjacent actions in an action instruction sequence, and add a target transition operator to the operators with large differences. This makes the sense of separation between adjacent actions in the generated action execution data more distinct, improves the execution coherence of each action in the real-time generated action execution data, and thus realizes the real-time generation of smooth action execution data based on the action instruction sequence. This improves the accuracy and adaptability of the real-time generated data, as well as the effectiveness of testing facial recognition functions.
[0004] Firstly, a data generation method is provided, which includes: Obtain the action unit operator corresponding to each action instruction in the action instruction sequence; Based on the execution order of each action instruction in the action instruction sequence, a first state difference value is determined between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator. The first action unit operator is any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator. If the first state difference value is greater than the difference threshold, then the target transition operator is obtained according to the action start trend of the second action unit operator, and the action execution data corresponding to the action instruction sequence is generated based on the target transition operator, the first action unit operator and the second action unit operator.
[0005] The above technical solution can obtain the action unit operators of the action instructions in the action instruction sequence. When the difference between the beginning and end states of adjacent action unit operators is large, a target transition operator is added to the adjacent action unit operators to generate the execution data corresponding to the action instruction sequence. By determining the difference between the beginning and end states of the action unit operators corresponding to adjacent actions in the action instruction sequence, and adding a target transition operator to the operators with large differences, the sense of separation between adjacent actions in the generated action execution data is reduced, improving the execution continuity of each action in the real-time generated action execution data. This enables the real-time generation of smooth action execution data based on the action instruction sequence, improving the accuracy and adaptability of the real-time generated data, as well as the effectiveness of testing facial recognition functions.
[0006] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the step of obtaining the action unit operator corresponding to each action instruction in the action instruction sequence includes: Obtain the action instructions from the action instruction sequence and determine the action identifier corresponding to each action instruction; The action unit operator corresponding to the action identifier is obtained by matching the action identifier with the operator identifiers in the pre-created unit operator set.
[0007] The above technical solution determines the action unit operator from a pre-built set of unit operators based on the action instructions in the action instruction sequence, so as to realize the instant generation of corresponding action execution data for the action instruction sequence.
[0008] In conjunction with the first aspect and the above implementation methods, in some possible implementation methods, determining the first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator based on the execution order of each action instruction in the action instruction sequence includes: Determine the execution order of each action instruction in the action instruction sequence, and obtain the first action unit operator corresponding to the first action instruction and the second action unit operator corresponding to the second action instruction based on the execution order; Obtain the target end portrait parameters of the first action unit operator and the target start portrait parameters of the second action unit operator; Calculate the first state difference value between the target end portrait parameters and the target start portrait parameters.
[0009] In conjunction with the first aspect and the above implementation methods, in some possible implementation methods, if the first state difference value is greater than the difference threshold, then obtaining the target transition operator based on the action initiation trend of the second action unit operator, and generating action execution data corresponding to the action instruction sequence based on the target transition operator, the first action unit operator, and the second action unit operator, includes: If the first state difference value is greater than the difference threshold, then the action start trend corresponding to the second action unit operator is determined; Based on the action initiation trend, search in the transition unit library to obtain the target transition operator corresponding to the action initiation trend; The target transition operator is connected to the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence.
[0010] Through the above technical solution, when the first state difference value between the target ending portrait parameter and the target starting portrait parameter is greater than the difference threshold, the target transition operator is obtained according to the action start trend corresponding to the second action unit operator. The target transition operator is used as a buffer between the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence, thereby realizing the instant generation of corresponding action execution data for the action instruction sequence and the smooth execution of each action instruction.
[0011] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the step of searching in the transition unit library based on the action initiation trend to obtain the target transition operator corresponding to the action initiation trend includes: Determine the trend identifier of the starting trend of the action, and obtain the transition action operator that matches the trend identifier from the transition unit library; Calculate the second state difference value between each of the transition action operators and the target starting face parameters, and determine the transition action operator corresponding to the minimum value among the second state difference values as the target transition operator corresponding to the action starting trend.
[0012] By using the above technical solution, each transition action operator is screened based on the second state difference value between each transition action operator and the target starting face parameters, thereby obtaining the target transition operator that matches the target starting face parameters. This improves the smoothness of executing each action instruction in the subsequently generated action execution data, thereby improving the accuracy and adaptability of the real-time generated data, as well as the effectiveness of testing the facial recognition function.
[0013] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the step of connecting the target transition operator with the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence includes: The target transition operator is set after the first action unit operator, and the second action unit operator is set after the target transition operator; Based on the execution order, each target transition operator is concatenated with each first action unit operator and each second action unit operator to generate action execution data corresponding to the action instruction sequence.
[0014] In combination with the first aspect and the above implementation methods, in some possible implementation methods, before generating the action execution data corresponding to the action instruction sequence, the method further includes: Based on each action instruction in the action instruction sequence, the number of the first action unit operator and the second action unit operator is detected to obtain the number of operators; If the number of operators is greater than a preset number, then the first action unit operator and the second action unit operator are replaced or deleted based on the action instruction sequence.
[0015] By using the above technical solution, the operators of each determined action unit are detected, and the number of action operators that exceeds the preset number are replaced or deleted, thereby avoiding too many repetitive actions in the generated action execution data, thus improving the accuracy of the real-time generated data and the effectiveness of testing the facial recognition function.
[0016] In combination with the first aspect and the above implementation methods, in some possible implementation methods, before obtaining the action unit operator corresponding to each action instruction in the action instruction sequence, the method further includes: Acquire the driving video of the motion commands, as well as sample human portrait images; Based on the driving video, generate an activated video corresponding to the sample portrait image; Determine the start frame and end frame corresponding to the activated video, and obtain the start portrait parameters corresponding to the start frame and the end portrait parameters corresponding to the end frame; Determine the action identifier corresponding to the activated video, and generate an action unit operator corresponding to the action identifier based on the activated video, the starting portrait parameters, the ending portrait parameters, the starting frame, the ending frame, and the action identifier.
[0017] By using the above technical solution, the activation video is generated based on the driving video and sample portrait images, and the starting portrait parameters and ending portrait parameters are determined. This enables the generated motion unit operator to accurately conform to the motion characteristics of the motion command and to make adaptive adjustments for different portraits, thereby improving the accuracy and adaptability of the real-time generated data.
[0018] Secondly, a data generation apparatus is provided, the apparatus comprising: The operator acquisition unit is used to acquire the action unit operator corresponding to each action instruction in the action instruction sequence; The difference value determination unit is used to determine a first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator based on the execution order of each action instruction in the action instruction sequence. The first action unit operator is any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator. The data generation unit is configured to, if the first state difference value is greater than the difference threshold, obtain the target transition operator based on the action start trend of the second action unit operator, and generate action execution data corresponding to the action instruction sequence based on the target transition operator, the first action unit operator, and the second action unit operator.
[0019] Thirdly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0020] Fourthly, a computer-readable storage medium is provided that stores computer program code, which, when executed on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0021] Fifthly, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method described above. Attached Figure Description
[0022] Figure 1 This is a system architecture diagram of a data generation method provided in the embodiments of this specification; Figure 2 This is a flowchart illustrating a data generation method provided in an embodiment of this specification; Figure 3 This is a flowchart illustrating a data generation method provided in an embodiment of this specification; Figure 4 This is an example diagram illustrating how to determine the initiation trend of an action, as provided in the embodiments of this specification. Figure 5 This is an example diagram illustrating the generation of action execution data provided in the embodiments of this specification; Figure 6 This is a schematic diagram of the structure of a data generation device provided in the embodiments of this specification; Figure 7 This is a schematic diagram of the structure of an electronic device provided in the embodiments of this specification. Detailed Implementation
[0023] The technical solutions in this specification will now be described clearly and in detail with reference to the accompanying drawings. In the description of the embodiments in this specification, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments in this specification, "multiple" refers to two or more than two.
[0024] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0025] Figure 1 This is a system architecture diagram of a data generation method provided in the embodiments of this specification. For example... Figure 1 As shown in the embodiments of this specification, the data generation method can be applied to a terminal device to realize the data generation process for a data generation task of a target transaction type. The system structure provided in the embodiments of this specification mainly includes a terminal device 10, an action instruction sequence 20, and action execution data 30. The terminal device 10 can be a device with data processing capabilities, such as a personal computer, smartphone, tablet computer, server, etc. The action instruction sequence 20 can be a sequence of actions to be performed, such as action instructions indicating actions like blinking, opening the mouth, shaking the head, or nodding. The action execution data 30 can be a video containing the sequential execution of each action instruction in the action instruction sequence.
[0026] In related technologies, the methods used to generate videos for simulated attacks include pre-recording complete videos and then identifying them based on the complete videos, or pre-generating videos for various actions, splicing the videos of various actions together, and then identifying them based on the spliced videos. The simulated attack videos generated by these methods have problems such as high storage costs or poor connection between different actions in the video.
[0027] Through the embodiments of this specification, the terminal device 10 obtains the action unit operator corresponding to each action instruction in the action instruction sequence 20. Based on the execution order of each action instruction in the action instruction sequence, it determines the first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator. If the first state difference value is greater than the difference threshold, it obtains the target transition operator according to the action start trend of the second action unit operator. Based on the target transition operator, the first action unit operator, and the second action unit operator, it generates action execution data 30 corresponding to the action instruction sequence. By determining the first and last state differences of the action unit operators corresponding to adjacent actions in the action instruction sequence, and adding target transition operators to operators with large differences, the sense of separation between adjacent actions in the generated action execution data is reduced, improving the execution continuity of each action in the real-time generated action execution data. This enables the real-time generation of smooth action execution data based on the action instruction sequence, improving the accuracy and adaptability of the real-time generated data, as well as the effectiveness of testing the portrait recognition function.
[0028] based on Figure 1 The system architecture shown below will be combined with Figures 2-5 This specification provides a detailed description of the data generation method provided in the embodiments.
[0029] Please see Figure 2 This is a flowchart illustrating a data generation method provided in an embodiment of this specification. Figure 2 As shown, the method in the embodiments of this specification may include the following steps S102-S106.
[0030] S102, Obtain the action unit operator corresponding to each action instruction in the action instruction sequence; In one embodiment, after obtaining the sequence of action instructions related to facial recognition, action unit operators are retrieved from a pre-created set of unit operators based on the action identifiers of each action instruction in the sequence. The action instruction sequence can be a sequence indicating the actions to be performed, such as action instructions indicating blinking, opening the mouth, shaking the head, or nodding. The action identifier can be an identifier representing the action corresponding to the action instruction. The set of unit operators can be a pre-created set including at least one unit operator, specifically a database or folder. A unit operator can be data representing various parameters related to the execution of the action, specifically including the activated video generated during the action execution process, the action identifier, the start and end frames of the activated video, and the start facial parameters corresponding to the start frame and the end facial parameters corresponding to the end frame. The action unit operator can be the unit operator corresponding to the action instruction. Specifically, the method for retrieving the action unit operator corresponding to the action instruction from the set of unit operators can be by searching based on the action identifier of the action instruction.
[0031] S104, Based on the execution order of each action instruction in the action instruction sequence, determine the first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator; In one embodiment, the execution order of each action instruction in the action instruction sequence is determined, and a first action unit operator and a second action unit operator are determined based on the execution order. The execution order can indicate the order in which each action instruction is executed, thus the order of each action unit operator can be determined based on the execution order. The first action unit operator can be any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator. The target end portrait parameter corresponding to the first action unit operator and the target start portrait parameter corresponding to the second action unit operator are determined. The target end portrait parameter can be the portrait parameter corresponding to the end frame in the first action unit operator, used to characterize the pose parameters, face shape coefficients, and facial expression coefficients of the portrait corresponding to the end frame. The target start portrait parameter can be the portrait parameter corresponding to the start frame in the second action unit operator. A first state difference value between the target end portrait parameter and the target start portrait parameter is calculated. The first state difference value can characterize the degree of state continuity between the target end portrait parameter and the target start portrait parameter; the larger the value of the first state difference value, the lower the degree of state continuity between the target end portrait parameter and the target start portrait parameter. The first state difference value can be calculated by using a formula to calculate the Euclidean distance between the target's ending portrait parameters and the target's starting portrait parameters, and then determining this Euclidean distance as the first state difference value. The specific calculation formula used can be set according to the actual situation.
[0032] S106, if the difference value of the first state is greater than the difference threshold, then the target transition operator is obtained according to the action start trend of the second action unit operator, and action execution data corresponding to the action instruction sequence is generated based on the target transition operator, the first action unit operator and the second action unit operator. In one embodiment, a first state difference value is compared with a preset difference threshold. The difference threshold can be a threshold used to determine whether the state difference value is too high and requires an action transition. The specific value of the difference can be set according to actual conditions, for example, it can be 0.8. If the first state difference value is greater than the difference threshold, the action start trend of the second action unit operator is determined. The action start trend can be a preparatory trend representing the action corresponding to the second action unit operator. For example, if the action corresponding to the second action unit operator is "head shaking," the action start trend can be a trend such as "slight head shaking buffer" preparing to execute the "head shaking" action. This trend can be manifested as a slight head tilt. A target transition operator is obtained based on the action start trend. The target transition operator can be an operator used to buffer the first and second action unit operators to reduce the disjointed action caused by directly playing the second activation video of the second action unit operator after playing the first activation video of the first action unit operator. The target transition operator is concatenated after the first action unit operator and before the second action unit operator. Based on the transition video in the target transition operator, the first activation video in the first action unit operator, and the second activation video in the second action unit operator, action execution data corresponding to the action command sequence is generated. The action execution data can include videos of each action command in the action command sequence executed sequentially, enabling the simulation of facial recognition based on the action execution data. This allows for the simulation of a liveness attack on a device with facial recognition capabilities, and the reliability of the device's facial recognition function can be determined based on the attack results.
[0033] In the embodiments of this specification, by acquiring the action unit operators of the action instructions in the action instruction sequence, when there is a large difference between the beginning and end states of adjacent action unit operators, a target transition operator is added to the adjacent action unit operators to generate execution data corresponding to the action instruction sequence. In this way, by determining the difference between the beginning and end states of the action unit operators corresponding to adjacent actions in the action instruction sequence, and adding a target transition operator to the operators with large differences, the sense of separation between adjacent actions in the generated action execution data is reduced, the execution coherence of each action in the real-time generated action execution data is improved, and smooth action execution data is generated in real-time according to the action instruction sequence. This improves the accuracy and adaptability of the real-time generated data, as well as the effectiveness of testing the facial recognition function.
[0034] The following will combine Figure 3 The present invention provides a detailed example of a data generation method provided in the embodiments of this specification.
[0035] S202, Obtain the action instructions in the action instruction sequence and determine the action identifier corresponding to each action instruction; In one embodiment, after obtaining the sequence of action commands related to facial recognition, the action commands included in the sequence are acquired, each action command is identified, and the corresponding action identifier is determined. The action command sequence can be a sequence indicating the action to be performed, such as action commands indicating blinking, opening the mouth, shaking the head, or nodding. The action commands can be actions required for facial recognition. The action identifier can be an identifier representing the action corresponding to the action command. It should be noted that an action command can correspond to one action identifier or multiple action identifiers. For example, if the action command is "blink," the corresponding action identifier can be "blink," or it can include "close eyes" and "open eyes," depending on the specific situation.
[0036] S204: Match the action identifier with each operator identifier in the pre-created set of unit operators to obtain the action unit operator corresponding to the action identifier; In one embodiment, action unit operators are obtained from a pre-created set of unit operators based on the action identifiers of each action instruction in the action instruction sequence. The set of unit operators can be a pre-created collection including at least one unit operator, specifically a database or folder. A unit operator can be data representing various parameters related to the execution of an action, specifically including the activated video generated during the action execution process, action identifiers, the start and end frames of the activated video, and the start and end portrait parameters corresponding to the start and end frames. The action unit operator can be the unit operator corresponding to the action instruction.
[0037] Specifically, the method for obtaining the action unit operator corresponding to the action instruction in the unit operator set can be as follows: match the action identifier of the action instruction with the action identifiers in each unit operator in the unit operator set, and determine the unit operator that matches the action identifier of the action instruction as the action unit operator.
[0038] It should be noted that, due to the significant differences in facial features between different sexual characteristics and different face shapes, even if the same action is performed, there may be obvious differences in the data features of the recorded video. Therefore, a feasible approach is to store corresponding unit operators for the same action based on different sexual characteristics and facial parameters such as face shape. In addition to indicating the action command, the action identifier in the unit operator can also include the corresponding facial parameters. The specific content of the facial parameters can be set according to the actual situation.
[0039] Furthermore, the generation unit operator can be achieved by: acquiring the driving video of the action command and the sample portrait image. The driving video can be a video recorded in response to the action command, and the behavioral features generated when executing the action command can be determined based on the driving video. An activation video corresponding to the sample portrait image is generated based on the driving video. The sample portrait image can be any portrait image. The activation video can be a video generated by adjusting the facial features of the sample portrait image according to the behavioral features in the driving video, and then executing the actions in the driving video based on the sample portrait image. The start frame and end frame corresponding to the activation video are determined, and the start portrait parameters corresponding to the start frame and the end portrait parameters corresponding to the end frame are acquired. The start frame can be the first frame image in the activation video, and the end frame can be the last frame image in the activation video. The start portrait parameters can be the parameters obtained by extracting facial parameters from the start frame, specifically including portrait pose parameters, face shape coefficients, and facial expression coefficients. The parameter types included in the start and end portrait parameters can be set according to the actual situation. It should be noted that, to improve data processing efficiency, a feasible approach is to extract facial parameters from the start and end frames, perform dimensionality reduction on the corresponding vectors, and use the dimensionality-reduced vectors as the start and end portrait parameters. The methods for extracting facial parameters and reducing the dimensionality of the vectors can be tailored to specific needs. For example, facial parameters can be extracted using a face reconstruction model based on FLAME (Faces Learned with an Articulated Model and Expressions), or the vectors can be reduced using MLP (Multilayer Perceptron). Next, the motion identifiers corresponding to the activated video are determined, and action unit operators corresponding to the motion identifiers are generated based on the activated video, start and end portrait parameters, start and end frames, and motion identifiers.
[0040] S206, determine the execution order of each action instruction in the action instruction sequence, and obtain the first action unit operator corresponding to the first action instruction and the second action unit operator corresponding to the second action instruction based on the execution order; In one embodiment, the execution order of each action instruction in the action instruction sequence is determined, and a first action unit operator and a second action unit operator are determined based on the execution order. The execution order can indicate the order in which each action instruction is executed, thus the order of each action unit operator can be determined based on the execution order. The first action unit operator can be any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator.
[0041] For example, if the action instruction sequence includes blinking and head shaking, and the execution order is blinking first and then head shaking, then the action unit operator corresponding to blinking is the first action unit operator, and the action unit operator corresponding to head shaking is the second action unit operator.
[0042] S208, obtain the target end portrait parameters of the first action unit operator and the target start portrait parameters of the second action unit operator; In one embodiment, target end portrait parameters corresponding to the first action unit operator and target start portrait parameters corresponding to the second action unit operator are determined. The target end portrait parameters can be portrait parameters corresponding to the end frame in the first action unit operator, used to characterize data such as pose parameters, face shape coefficients, and facial expression coefficients of the portrait corresponding to the end frame. The target start portrait parameters can be portrait parameters corresponding to the start frame in the second action unit operator.
[0043] S210, Calculate the first state difference value between the target end portrait parameters and the target start portrait parameters; In one embodiment, after obtaining the target end portrait parameters and the target start portrait parameters, a first state difference value is calculated between the target end portrait parameters and the target start portrait parameters. The first state difference value characterizes the degree of state continuity between the target end portrait parameters and the target start portrait parameters; a larger first state difference value indicates a lower degree of state continuity between the target end portrait parameters and the target start portrait parameters. The first state difference value can be calculated by using a formula to calculate the Euclidean distance between the target end portrait parameters and the target start portrait parameters, and then determining this Euclidean distance as the first state difference value. The specific calculation formula used can be set according to the actual situation.
[0044] S212, If the difference value of the first state is greater than the difference threshold, then determine the action start trend corresponding to the second action unit operator; In one embodiment, a first state difference value is compared with a preset difference threshold. The difference threshold can be a threshold used to determine whether the state difference value is too high and requires an action transition. The specific value at the difference point can be set according to actual conditions, for example, it can be 0.8. If the first state difference value is greater than the difference threshold, the action initiation trend of the second action unit operator is determined. The action initiation trend can be a preparatory trend representing the action corresponding to the second action unit operator. For example, if the action corresponding to the second action unit operator is "blinking," then the action initiation trend can be a trend such as "micro-blinking buffer" in preparation for executing the "blinking" action. This trend can be manifested as a slight closing of the eyes, etc.
[0045] For example, such as Figure 4 As shown, Figure 4The end frame of the first action unit operator is the state shown in "a", while the start frame of the second action unit operator is the state shown in "b". It can be seen that there is a situation in "a" and "b" where the eyelids of the eyes suddenly close to a certain extent. Therefore, it can be determined that the starting trend of the action is "micro-blink buffer" to increase the continuity of the action between "a" and "b".
[0046] Optionally, to facilitate the comparison of numerical values based on the difference threshold and the difference value of the first state, a feasible approach is to normalize the difference value of the first state and, when setting the difference threshold, normalize the experimentally obtained value and determine the normalized value as the difference threshold.
[0047] S214, Search the transition unit library based on the action start trend to obtain the target transition operator corresponding to the action start trend; In one embodiment, a search is performed in the transition unit library based on the initial trend of the action to obtain a target transition operator that matches the initial trend of the action. The target transition operator can be an operator used to buffer the first action unit operator and the second action unit operator, so as to reduce the sense of disjointed action caused by directly playing the second activation video in the second action unit operator after playing the first activation video of the first action unit operator.
[0048] Specifically, the method for obtaining the target transition operator can be as follows: determine the trend identifier of the action's initial trend, and obtain the transition action operator that matches the trend identifier from the transition unit library. The trend identifier can be an identifier used to characterize the action's initial trend, such as "slight head shaking buffer" or "slight mouth opening buffer." It can be understood that if only one transition action operator is obtained based on the trend identifier, then that transition action operator is determined as the target transition operator. If multiple transition action operators are obtained based on the trend identifier, then each transition action operator is further identified, and the target transition operator is determined among them. Specifically, the determination method can be as follows: calculate the second state difference value between each transition action operator and the target initial face parameters. The second state difference value can indicate the degree of state difference between the transition action operator and the target initial face parameters. The transition action operator corresponding to the minimum value among the second state difference values is determined as the target transition operator corresponding to the action's initial trend.
[0049] For example, after obtaining transition action operators "A", "B", and "C", the state difference value is calculated between the portrait parameters of each transition action operator and the target starting portrait parameters. The resulting second state difference values are 0.4, 0.5, and 0.55, respectively. Then, transition action operator "A" is determined as the target transition operator. It can be understood that if there are multiple cases where the second state difference value is the same and is the minimum value, a feasible approach is to calculate the state difference value between each transition action operator with the minimum value and the target ending portrait parameters, and determine the transition action operator corresponding to the minimum value among the obtained state difference values as the target transition operator.
[0050] Understandably, in order to reduce the degree of state difference between the first action unit operator and the second action unit operator, in addition to judging based on the calculation result obtained by calculating the state difference value with the target starting face parameter, it is also possible to calculate the state difference value with the target ending face parameter, average the obtained state difference value and the second state difference value, and obtain the target transition operator based on the third state difference value obtained by the average value. The specific execution method can be set according to the actual situation.
[0051] Furthermore, if no transition operator matching the action start trend is found in the transition unit library, a feasible approach is to call a frame interpolation network to calculate and generate transition frames based on the target end portrait parameters and the target start portrait parameters. The action operator generated for the transition frame is then identified as the target transition operator. The frame interpolation network used can be selected according to the actual situation, such as a Transformer-based temporal interpolation module. The number of frames generated as transition frames can be set according to the actual situation, for example, 1-3 frames.
[0052] S216, connect the target transition operator with the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence; In one embodiment, after determining the target transition operator, the target transition operator is set after the first action unit operator, and the second action unit operator is set after the target transition operator. Based on the execution order, each target transition operator is concatenated with each first action unit operator and each second action unit operator to generate action execution data corresponding to the action instruction sequence. The action execution data can be a video including each action instruction in the action instruction sequence executed sequentially, so that facial recognition can be simulated based on the action execution data to perform simulated liveness attacks on devices with facial recognition capabilities, and the reliability of the device's facial recognition function can be determined based on the attack results. It is understood that since the action instruction sequence can include two or more action instructions, the above behavior is performed for each adjacent action instruction to concatenate the action unit operators corresponding to each adjacent action instruction, thereby obtaining action execution data including each action instruction in the action instruction sequence.
[0053] For example, such as Figure 5 As shown, Figure 5 The transition video "V3" in the target transition operator is spliced after the first active video "V1" in the first action unit operator and before the second active video "V2" in the second action unit operator to generate the action execution data "VD" corresponding to the action instruction sequence.
[0054] Furthermore, before generating the action execution data corresponding to the action instruction sequence, to avoid excessive repetitive actions in the generated action execution data, such as multiple consecutive head shakes, it is necessary to detect the acquired action unit operators. The specific detection method can be as follows: based on each action instruction in the action instruction sequence, the number of the first and second action unit operators is detected to obtain the number of operators. The number of operators can indicate the number of each action unit operator. If the number of operators is greater than a preset number, the first and second action unit operators are replaced or deleted based on the action instruction sequence. The preset number can be a pre-set value used to determine whether the number of operators is excessive. The specific value of the preset number can be set according to the actual situation. The preset number is different for different action instructions; for example, if the action instruction is head shaking, the preset number can be 1; if the action instruction is opening the mouth, the preset number can be 2, and so on.
[0055] For example, if the action instructions included in the action instruction sequence are opening the mouth and shaking the head, then the preset number of the first action unit operator is 2 and the preset number of the second action unit operator is 1. Therefore, the number of operators of the first action unit operator is determined to be 2 and the number of operators of the second action unit operator is determined to be 2. Then the second action unit operator can be deleted.
[0056] Furthermore, to ensure that the generated motion execution data can simulate a liveness attack, the generated motion execution data is identified to determine whether there are any discontinuities in the execution of each action command. If significant interruptions or jumps are found, a video smoothing module can be invoked for visual quality optimization. The method for identifying display interruptions or jumps can be based on visual recognition models or manual identification, and the type of video smoothing module invoked can be set according to the actual situation.
[0057] In the embodiments of this specification, by acquiring the action unit operators of the action instructions in the action instruction sequence, when there is a large difference between the beginning and end states of adjacent action unit operators, a target transition operator is added to the adjacent action unit operators to generate execution data corresponding to the action instruction sequence. This process determines the difference between the beginning and end states of the action unit operators corresponding to adjacent actions in the action instruction sequence, and adds target transition operators to operators with large differences. This reduces the sense of disjointedness between adjacent actions in the generated action execution data, improves the execution coherence of each action in the real-time generated action execution data, and thus achieves real-time generation of smooth action execution data based on the action instruction sequence. This improves the accuracy, adaptability, and effectiveness of testing facial recognition functions. Furthermore, based on the second state difference value between each transition action operator and the target starting face parameters, each transition action operator is filtered to obtain target transition operators that match the target starting face parameters. This improves the smoothness of executing each action instruction in the subsequently generated action execution data, thereby improving the accuracy, adaptability, and effectiveness of testing facial recognition functions. Furthermore, the operators of each determined action unit are tested, and action operators with more than a preset number of operators are replaced or deleted, thereby avoiding too many repetitive actions in the generated action execution data, thus improving the accuracy of the real-time generated data and the effectiveness of testing the facial recognition function.
[0058] based on Figure 1 The system architecture will be discussed below. Figure 6 This specification provides a detailed description of the data generation apparatus provided in the embodiments. It should be noted that... Figure 6 The data generation device 1 in this specification is used to execute the data generation device 1 in this specification. Figures 2-5 The methods shown in the embodiments are illustrated for ease of explanation, showing only the parts related to the embodiments of this specification. For specific technical details not disclosed, please refer to this specification. Figures 2-5 The example shown.
[0059] Operator acquisition unit 11 is used to acquire the action unit operator corresponding to each action instruction in the action instruction sequence; The difference value determination unit 12 is used to determine a first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator based on the execution order of each action instruction in the action instruction sequence. The first action unit operator is any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator. The data generation unit 13 is used to obtain a target transition operator based on the action start trend of the second action unit operator if the first state difference value is greater than the difference threshold, and generate action execution data corresponding to the action instruction sequence based on the target transition operator, the first action unit operator and the second action unit operator.
[0060] Optionally, the operator acquisition unit 11 is also used for: Obtain the action instructions from the action instruction sequence and determine the action identifier corresponding to each action instruction; The action unit operator corresponding to the action identifier is obtained by matching the action identifier with the operator identifiers in the pre-created unit operator set.
[0061] Optionally, the difference value determination unit 12 is also used for: Determine the execution order of each action instruction in the action instruction sequence, and obtain the first action unit operator corresponding to the first action instruction and the second action unit operator corresponding to the second action instruction based on the execution order; Obtain the target end portrait parameters of the first action unit operator and the target start portrait parameters of the second action unit operator; Calculate the first state difference value between the target end portrait parameters and the target start portrait parameters.
[0062] Optionally, the data generation unit 13 is also used for: If the first state difference value is greater than the difference threshold, then the action start trend corresponding to the second action unit operator is determined; Based on the action initiation trend, search in the transition unit library to obtain the target transition operator corresponding to the action initiation trend; The target transition operator is connected to the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence.
[0063] Optionally, the data generation unit 13 is also used for: Determine the trend identifier of the starting trend of the action, and obtain the transition action operator that matches the trend identifier from the transition unit library; Calculate the second state difference value between each of the transition action operators and the target starting face parameters, and determine the transition action operator corresponding to the minimum value among the second state difference values as the target transition operator corresponding to the action starting trend.
[0064] Optionally, the data generation unit 13 is also used for: The target transition operator is set after the first action unit operator, and the second action unit operator is set after the target transition operator; Based on the execution order, each target transition operator is concatenated with each first action unit operator and each second action unit operator to generate action execution data corresponding to the action instruction sequence.
[0065] Optionally, the data generation unit 13 is also used for: Based on each action instruction in the action instruction sequence, the number of the first action unit operator and the second action unit operator is detected to obtain the number of operators; If the number of operators is greater than a preset number, then the first action unit operator and the second action unit operator are replaced or deleted based on the action instruction sequence.
[0066] Optionally, the data generation device 1 further includes an operator generation unit 14, used for: Acquire the driving video of the motion commands, as well as sample human portrait images; Based on the driving video, generate an activated video corresponding to the sample portrait image; Determine the start frame and end frame corresponding to the activated video, and obtain the start portrait parameters corresponding to the start frame and the end portrait parameters corresponding to the end frame; Determine the action identifier corresponding to the activated video, and generate an action unit operator corresponding to the action identifier based on the activated video, the starting portrait parameters, the ending portrait parameters, the starting frame, the ending frame, and the action identifier.
[0067] In the embodiments of this specification, by acquiring the action unit operators of the action instructions in the action instruction sequence, when there is a large difference between the beginning and end states of adjacent action unit operators, a target transition operator is added to the adjacent action unit operators to generate execution data corresponding to the action instruction sequence. This process determines the difference between the beginning and end states of the action unit operators corresponding to adjacent actions in the action instruction sequence, and adds target transition operators to operators with large differences. This reduces the sense of disjointedness between adjacent actions in the generated action execution data, improves the execution coherence of each action in the real-time generated action execution data, and thus achieves real-time generation of smooth action execution data based on the action instruction sequence. This improves the accuracy, adaptability, and effectiveness of testing facial recognition functions. Furthermore, based on the second state difference value between each transition action operator and the target starting face parameters, each transition action operator is filtered to obtain target transition operators that match the target starting face parameters. This improves the smoothness of executing each action instruction in the subsequently generated action execution data, thereby improving the accuracy, adaptability, and effectiveness of testing facial recognition functions. Furthermore, the operators of each determined action unit are tested, and action operators with more than a preset number of operators are replaced or deleted, thereby avoiding too many repetitive actions in the generated action execution data, thus improving the accuracy of the real-time generated data and the effectiveness of testing the facial recognition function.
[0068] This specification also provides a computer storage medium that can store multiple program instructions, which are adapted to be loaded and executed by a processor as described above. Figures 1-5 The method steps of the illustrated embodiment can be found in the following documentation for detailed execution. Figures 1-5 The specific details of the illustrated embodiments will not be elaborated here.
[0069] This specification also provides an embodiment of a computer program product, which stores at least one instruction, the at least one instruction being loaded and executed by the processor as described above. Figures 1-5 The item recommendation model training method described in the illustrated embodiment can be found in the following documentation for a detailed execution process. Figures 1-5 The specific details of the illustrated embodiments will not be elaborated here.
[0070] Please see Figure 7 This document provides a schematic diagram of the structure of an electronic device as an embodiment of the present specification. Figure 7As shown, the electronic device 1000 may include: at least one processor 1001, such as a CPU; at least one network interface 1004; an input / output interface 1003; a memory 1005; and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk drive. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 7 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, an input / output interface module, and a data generation application program.
[0071] exist Figure 7 In the electronic device 1000 shown, the input / output interface 1003 is mainly used to provide an input interface for the user and to obtain the user input data.
[0072] In one embodiment, the processor 1001 can be used to invoke a data generation application stored in the memory 1005, and specifically perform the following operations: Obtain the action unit operator corresponding to each action instruction in the action instruction sequence; Based on the execution order of each action instruction in the action instruction sequence, a first state difference value is determined between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator. The first action unit operator is any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator. If the first state difference value is greater than the difference threshold, then the target transition operator is obtained according to the action start trend of the second action unit operator, and the action execution data corresponding to the action instruction sequence is generated based on the target transition operator, the first action unit operator and the second action unit operator.
[0073] Optionally, when the processor 1001 executes the action unit operator corresponding to each action instruction in the action instruction sequence, it specifically performs the following operations: Obtain the action instructions from the action instruction sequence and determine the action identifier corresponding to each action instruction; The action unit operator corresponding to the action identifier is obtained by matching the action identifier with the operator identifiers in the pre-created unit operator set.
[0074] Optionally, when the processor 1001 determines the first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator based on the execution order of each action instruction in the action instruction sequence, it specifically performs the following operations: Determine the execution order of each action instruction in the action instruction sequence, and obtain the first action unit operator corresponding to the first action instruction and the second action unit operator corresponding to the second action instruction based on the execution order; Obtain the target end portrait parameters of the first action unit operator and the target start portrait parameters of the second action unit operator; Calculate the first state difference value between the target end portrait parameters and the target start portrait parameters.
[0075] Optionally, when the processor 1001 executes the operation of obtaining a target transition operator based on the action initiation trend of the second action unit operator if the first state difference value is greater than the difference threshold, and generating action execution data corresponding to the action instruction sequence based on the target transition operator, the first action unit operator, and the second action unit operator, the processor 1001 specifically performs the following operations: If the first state difference value is greater than the difference threshold, then the action start trend corresponding to the second action unit operator is determined; Based on the action initiation trend, search in the transition unit library to obtain the target transition operator corresponding to the action initiation trend; The target transition operator is connected to the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence.
[0076] Optionally, when the processor 1001 performs a search in the transition unit library based on the action initiation trend to obtain the target transition operator corresponding to the action initiation trend, it specifically performs the following operations: Determine the trend identifier of the starting trend of the action, and obtain the transition action operator that matches the trend identifier from the transition unit library; Calculate the second state difference value between each of the transition action operators and the target starting face parameters, and determine the transition action operator corresponding to the minimum value among the second state difference values as the target transition operator corresponding to the action starting trend.
[0077] Optionally, when the processor 1001 connects the target transition operator with the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence, it specifically performs the following operations: The target transition operator is set after the first action unit operator, and the second action unit operator is set after the target transition operator; Based on the execution order, each target transition operator is concatenated with each first action unit operator and each second action unit operator to generate action execution data corresponding to the action instruction sequence.
[0078] Optionally, before executing the action execution data corresponding to the action instruction sequence, the processor 1001 further performs the following operations: Based on each action instruction in the action instruction sequence, the number of the first action unit operator and the second action unit operator is detected to obtain the number of operators; If the number of operators is greater than a preset number, then the first action unit operator and the second action unit operator are replaced or deleted based on the action instruction sequence.
[0079] Optionally, before executing the action unit operator corresponding to each action instruction in the sequence of acquisition action instructions, the processor 1001 also performs the following operations: Acquire the driving video of the motion commands, as well as sample human portrait images; Based on the driving video, generate an activated video corresponding to the sample portrait image; Determine the start frame and end frame corresponding to the activated video, and obtain the start portrait parameters corresponding to the start frame and the end portrait parameters corresponding to the end frame; Determine the action identifier corresponding to the activated video, and generate an action unit operator corresponding to the action identifier based on the activated video, the starting portrait parameters, the ending portrait parameters, the starting frame, the ending frame, and the action identifier.
[0080] In the embodiments of this specification, by acquiring the action unit operators of the action instructions in the action instruction sequence, when there is a large difference between the beginning and end states of adjacent action unit operators, a target transition operator is added to the adjacent action unit operators to generate execution data corresponding to the action instruction sequence. This process determines the difference between the beginning and end states of the action unit operators corresponding to adjacent actions in the action instruction sequence, and adds target transition operators to operators with large differences. This reduces the sense of disjointedness between adjacent actions in the generated action execution data, improves the execution coherence of each action in the real-time generated action execution data, and thus achieves real-time generation of smooth action execution data based on the action instruction sequence. This improves the accuracy, adaptability, and effectiveness of testing facial recognition functions. Furthermore, based on the second state difference value between each transition action operator and the target starting face parameters, each transition action operator is filtered to obtain target transition operators that match the target starting face parameters. This improves the smoothness of executing each action instruction in the subsequently generated action execution data, thereby improving the accuracy, adaptability, and effectiveness of testing facial recognition functions. Furthermore, the operators of each determined action unit are tested, and action operators with more than a preset number of operators are replaced or deleted, thereby avoiding too many repetitive actions in the generated action execution data, thus improving the accuracy of the real-time generated data and the effectiveness of testing the facial recognition function.
[0081] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0082] The above-disclosed embodiments are merely preferred embodiments of this specification and should not be construed as limiting the scope of this specification. Therefore, any equivalent variations made in accordance with the claims of this specification shall still fall within the scope of this specification.
Claims
1. A data generation method, the method comprising: Obtain the action unit operator corresponding to each action instruction in the action instruction sequence; Based on the execution order of each action instruction in the action instruction sequence, a first state difference value is determined between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator. The first action unit operator is any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator. If the first state difference value is greater than the difference threshold, then the target transition operator is obtained according to the action start trend of the second action unit operator, and the action execution data corresponding to the action instruction sequence is generated based on the target transition operator, the first action unit operator and the second action unit operator.
2. The method according to claim 1, wherein obtaining the action unit operator corresponding to each action instruction in the action instruction sequence comprises: Obtain the action instructions from the action instruction sequence and determine the action identifier corresponding to each action instruction; The action unit operator corresponding to the action identifier is obtained by matching the action identifier with the operator identifiers in the pre-created unit operator set.
3. The method according to claim 1, wherein determining the first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator based on the execution order of each action instruction in the action instruction sequence includes: Determine the execution order of each action instruction in the action instruction sequence, and obtain the first action unit operator corresponding to the first action instruction and the second action unit operator corresponding to the second action instruction based on the execution order; Obtain the target end portrait parameters of the first action unit operator and the target start portrait parameters of the second action unit operator; Calculate the first state difference value between the target end portrait parameters and the target start portrait parameters.
4. The method according to claim 1, wherein if the first state difference value is greater than a difference threshold, then obtaining a target transition operator based on the action initiation trend of the second action unit operator, and generating action execution data corresponding to the action instruction sequence based on the target transition operator, the first action unit operator, and the second action unit operator, includes: If the first state difference value is greater than the difference threshold, then the action start trend corresponding to the second action unit operator is determined; Based on the action initiation trend, search in the transition unit library to obtain the target transition operator corresponding to the action initiation trend; The target transition operator is connected to the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence.
5. The method according to claim 4, wherein the step of searching in the transition unit library based on the action initiation trend to obtain the target transition operator corresponding to the action initiation trend includes: Determine the trend identifier of the starting trend of the action, and obtain the transition action operator that matches the trend identifier from the transition unit library; Calculate the second state difference value between each of the transition action operators and the target starting face parameters, and determine the transition action operator corresponding to the minimum value among the second state difference values as the target transition operator corresponding to the action starting trend.
6. The method according to claim 4, wherein connecting the target transition operator with the first action unit operator and the second action unit operator to generate action execution data corresponding to the action instruction sequence comprises: The target transition operator is set after the first action unit operator, and the second action unit operator is set after the target transition operator; Based on the execution order, each target transition operator is concatenated with each first action unit operator and each second action unit operator to generate action execution data corresponding to the action instruction sequence.
7. The method according to claim 6, further comprising, before generating the action execution data corresponding to the action instruction sequence: Based on each action instruction in the action instruction sequence, the number of the first action unit operator and the second action unit operator is detected to obtain the number of operators; If the number of operators is greater than a preset number, then the first action unit operator and the second action unit operator are replaced or deleted based on the action instruction sequence.
8. The method according to claim 1, further comprising, before obtaining the action unit operator corresponding to each action instruction in the action instruction sequence: Acquire the driving video of the motion commands, as well as sample human portrait images; Based on the driving video, generate an activated video corresponding to the sample portrait image; Determine the start frame and end frame corresponding to the activated video, and obtain the start portrait parameters corresponding to the start frame and the end portrait parameters corresponding to the end frame; Determine the action identifier corresponding to the activated video, and generate an action unit operator corresponding to the action identifier based on the activated video, the starting portrait parameters, the ending portrait parameters, the starting frame, the ending frame, and the action identifier.
9. A data generation apparatus, the apparatus comprising: The operator acquisition unit is used to acquire the action unit operator corresponding to each action instruction in the action instruction sequence; The difference value determination unit is used to determine a first state difference value between the target end portrait parameter of the first action unit operator and the target start portrait parameter of the second action unit operator based on the execution order of each action instruction in the action instruction sequence. The first action unit operator is any action unit operator, and the sequence number of the second action unit operator is located after the first action unit operator. The data generation unit is configured to, if the first state difference value is greater than the difference threshold, obtain the target transition operator based on the action start trend of the second action unit operator, and generate action execution data corresponding to the action instruction sequence based on the target transition operator, the first action unit operator, and the second action unit operator.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program code that, when executed, implements the method as described in any one of claims 1 to 8.
11. An electronic device, comprising: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method as claimed in any one of claims 1 to 8.
12. A computer program product having at least one instruction stored thereon, wherein the at least one instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.