Test data generation method and device for face recognition model and electronic equipment

By converting the video file into the data calling format of the smart terminal camera, replacing the camera data, simulating attack data, and testing the face recognition model, it solves the problem in the existing technology that the face recognition model has not been tested against adversarial attacks, and improves the accuracy of face recognition. Identification accuracy and security.

CN118691928APending Publication Date: 2024-09-24PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410739162.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing face recognition models have not been tested against adversarial attacks and are easily affected by deception, leading to misjudgments, reducing the accuracy of face recognition, and affecting user property security.

Method used

By obtaining a specific video file, converting it into the data calling format of the smart terminal camera, replacing the original camera data, inputting the face recognition model to be tested, simulating attack data, generating test results, and improving the reliability and reliability of the face recognition model. Security.

Benefits of technology

It achieves effective testing of face recognition models, improves the accuracy and security of face recognition, and enhances defense capabilities against attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691928A
    Figure CN118691928A
Patent Text Reader

Abstract

The invention discloses a test data generation method and device for a face recognition model and electronic equipment, and the method comprises the steps: obtaining a specific video file, and converting the video file into test data in a specific format which is a data call format of an intelligent terminal camera; replacing original camera data called by an intelligent terminal camera with the test data; inputting the test data into a to-be-tested face recognition model, and obtaining an output result of the face recognition model; and obtaining a test result of the face recognition model according to the output result. According to the embodiment of the invention, the image output by the camera can be replaced by the specific video file, the replaced video can be customized, different attack data can be simulated through the test data, and the reliability and safety of the face recognition model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, and in particular to a method, device and electronic device for generating test data for a face recognition model. Background Art

[0002] With the development of technology, face recognition technology has been widely used in social production, life and other fields. Financial institutions actively use face recognition technology to simplify payment, credit and other business processes, optimize business management, enhance customer experience, and promote the improvement of financial services quality and efficiency.

[0003] At present, face recognition technology has been integrated into financial services and widely used in outlets, mobile banking, corporate security and other fields, identifying customers through face verification and recognition. On the one hand, it replaces the manual processing process, simplifies procedures and improves efficiency; on the other hand, as an effective way of remote and contactless business identity recognition, it is widely used in scenarios such as smart finance and mobile finance.

[0004] Financial institutions usually use face recognition models to perform face recognition. In order to improve the security of face recognition models, it is necessary to conduct security tests on face recognition models. Face recognition algorithm models in the prior art have not been tested for adversarial attacks. They are easily affected by some deceptive means and misjudgment during the face recognition process, which reduces the accuracy of face recognition and poses a risk to the property safety of users.

[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0006] In view of the above-mentioned deficiencies in the prior art, the present invention provides a test data generation method, device and electronic device for a face recognition model, aiming to solve the problem that the face recognition algorithm model in the prior art has not been tested for adversarial attacks, is easily affected by some deceptive means during the face recognition process, and makes misjudgments, thereby reducing the accuracy of face recognition and posing a danger to the user's property safety.

[0007] The technical solution of the present invention is as follows:

[0008] A first embodiment of the present invention provides a method for generating test data for a face recognition model, the method comprising:

[0009] Obtain a specific video file, and convert the video file into test data in a specific format, wherein the specific format is a data calling format of a smart terminal camera;

[0010] Replacing the original camera data called by the smart terminal camera with the test data;

[0011] Input the test data into a face recognition model to be tested, and obtain an output result of the face recognition model;

[0012] According to the output result, the test result of the face recognition model is obtained.

[0013] Furthermore, the obtaining of a specific video file includes:

[0014] The specific video file is loaded through the ffmpeg library, wherein the specific video file is a pre-recorded video file.

[0015] Furthermore, the step of converting the video file into test data in a specific format includes:

[0016] Decoding the video file to obtain a decoded file;

[0017] Convert the decoded file into a format file corresponding to the data call format of the smart terminal camera;

[0018] A data class having the same parameter format as the preset one is generated based on the format file and recorded as test data.

[0019] Furthermore, the step of inputting the test data into a face recognition model to be tested and obtaining an output result of the face recognition model includes:

[0020] The test instruction of the face recognition model is detected, and the camera function of the smart terminal is called;

[0021] The test data is input into the face recognition model to be tested to obtain the output result of the face recognition model.

[0022] Further, loading the specific video file through the ffmpeg library includes:

[0023] Get pre-recorded video files;

[0024] The video file is attacked and processed by the ffmpeg library to obtain a specific video file.

[0025] Furthermore, the video file is attacked and processed by the ffmpeg library to obtain a specific video file, including:

[0026] The video file is dyed or artificially replaced with a face through the ffmpeg library to obtain a specific video file.

[0027] Furthermore, the test data generation method for the face recognition model is applied to a smart terminal using an Android system, and the test instruction of the face recognition model is detected, and the camera function of the smart terminal is called, including:

[0028] Detect the test instruction of the face recognition model and call Android Framework's Camera.open();

[0029] Enter the bottom layer of android_hardware_camera.cpp and call new JNICameraContext to finally construct a camera context object to complete the camera function call of the smart terminal. Among them, there is a PostData function in the JNICameraContext class that receives the data buffer dataPtr obtained by the system from the camera.

[0030] Another embodiment of the present invention provides a test data generating device for a face recognition model, the device comprising:

[0031] A data encryption, decoding and conversion module is used to obtain a specific video file and convert the video file into test data in a specific format, wherein the specific format is the data call format of the smart terminal camera;

[0032] The data replacement module is used to replace the test parameters called by the original camera with the pre-generated data class;

[0033] A model testing module, used to input the test parameters into a trained face recognition model to obtain an output result of the face recognition model;

[0034] The model performance determination module is used to obtain the test result of the face recognition model according to the output result.

[0035] Another embodiment of the present invention provides an electronic device, the electronic device comprising at least one processor; and,

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

[0037] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned test data generation method for the face recognition model.

[0038] Another embodiment of the present invention also provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned test data generation method for the face recognition model.

[0039] Beneficial effect: The test data generation method for a face recognition model of an embodiment of the present invention can realize that the image output by the camera is replaced by a specific video file, and the replaced video can also be customized. Different attack data can be simulated through the test data to improve the reliability and security of the face recognition model. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0041] Figure 1 A flowchart of a preferred embodiment of a method for generating test data for a face recognition model according to the present invention;

[0042] Figure 2 A schematic diagram of functional modules of a preferred embodiment of a test data generating device for a face recognition model of the present invention;

[0043] Figure 3 The figure is a schematic diagram of the hardware structure of a preferred embodiment of an electronic device of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0045] In the prior art, different face recognition technologies call different system APIs for obtaining system camera images, and the front-end reinforcement obfuscation security protection makes it difficult to reverse crack the front end, and it is difficult to generate test data in the same format as the camera, which brings inconvenience to the testing of face recognition models. In the embodiment of the present invention, the image output by the camera is replaced by a specific video file, and the replaced video can also be customized to generate negative samples for face recognition testing, thereby improving the reliability of the face recognition model.

[0046] The embodiments of the present invention are described below with reference to the accompanying drawings.

[0047] In view of the above problems, an embodiment of the present invention provides a method for generating test data for a face recognition model. Figure 1 , Figure 1 FIG. 1 is a flow chart of a preferred embodiment of a method for generating test data for a face recognition model according to the present invention. Figure 1 As shown, it includes:

[0048] Step S100, obtaining a specific video file, and converting the video file into test data in a specific format, wherein the specific format is a data calling format of a smart terminal camera;

[0049] Step S200, replacing the original camera data called by the smart terminal camera with the test data;

[0050] Step S300: input the test data into the face recognition model to be tested, and obtain the output result of the face recognition model;

[0051] Step S400: Obtain a test result of the face recognition model according to the output result.

[0052] In a specific implementation, the embodiment of the present invention obtains a specific video file and converts the video file into test data in a specific format. The specific video file is a pre-generated video file. The specific format data is the data call format data of the smart terminal camera. The original camera's raw data is replaced with the test data, the test instruction of the face recognition model is detected, and the test data is called; the test data is input into the face recognition model to be tested, and the output result of the face recognition model is obtained;

[0053] The test result of the face recognition model is determined based on the output result. If the output result of the face recognition model is a successful face recognition, it means that the current face recognition model has defects and needs to be trained further. If the output result of the face recognition model is a failed face recognition, it means that the current detection is fine and more video files can be used for testing. If the test results of all pre-generated video files are failed face recognition, it means that the current face recognition model is highly reliable.

[0054] The embodiment of the present invention allows the image output by the camera to be replaced by a specific video file, and the replaced video can also be customized. Different attack data can be simulated through test data to improve the reliability and security of the face recognition model.

[0055] In one embodiment, obtaining a specific video file includes:

[0056] The specific video file is loaded through the ffmpeg library, wherein the specific video file is a pre-recorded video file.

[0057] In specific implementation, FFmpeg is an open source computer program that can be used to record, convert digital audio and video, and convert them into streams. It has very powerful functions, including video acquisition, video format conversion, video capture, video processing, etc. Pre-recorded video files are loaded through the ffmpeg library.

[0058] In one embodiment, converting the video file into test data in a specific format includes:

[0059] Decoding the video file to obtain a decoded file;

[0060] Convert the decoded file into a format file corresponding to the data call format of the smart terminal camera;

[0061] A data class having the same parameter format as the preset one is generated based on the format file and recorded as test data.

[0062] In the specific implementation, the pre-recorded video file is loaded through the ffmpeg library, and the decoded file is obtained after decoding. The decoded file is converted into a format file corresponding to the data call format of the normal smart terminal camera, and the format file is generated into a data class with the same data call parameter format as the smart terminal, which is recorded as test data.

[0063] In one embodiment, inputting the test data into a face recognition model to be tested and obtaining an output result of the face recognition model includes:

[0064] The test instruction of the face recognition model is detected, and the camera function of the smart terminal is called;

[0065] The test data is input into the face recognition model to be tested to obtain the output result of the face recognition model.

[0066] In the specific implementation, the test instruction of the face recognition model is detected, and the camera function of the smart terminal is called, wherein the camera function has been captured in advance, so the camera function of the smart terminal is called, and the system of the smart terminal inputs the generated test data into the face recognition model to be tested, which is a pre-trained model, and obtains the output result of the face recognition model. The output result of the face recognition model is face recognition success or face recognition failure.

[0067] In one embodiment, loading the specific video file through the ffmpeg library includes:

[0068] Get pre-recorded video files;

[0069] The video file is attacked and processed by the ffmpeg library to obtain a specific video file.

[0070] In specific implementation, in order to increase the reliability of the face recognition model, a pre-recorded video file containing a face may be obtained, and the video file containing the face may be attacked to obtain a specific video file.

[0071] In one embodiment, the video file is attacked and processed by the ffmpeg library to obtain a specific video file, including:

[0072] The video file is dyed or artificially replaced with a face through the ffmpeg library to obtain a specific video file.

[0073] In the specific implementation, the ffmpeg library is used to perform coloring, face-changing and other processing on the video to be replaced, and then a video stream is formed to replace the output of the real camera. Operations such as coloring and face-changing on the video belong to the existing technology and will not be repeated here.

[0074] In one embodiment, the method is applied to a smart terminal using an Android system, wherein the test instruction of detecting a face recognition model and calling a camera function of the smart terminal include:

[0075] Detect the test instruction of the face recognition model and call Android Framework's Camera.open();

[0076] Enter the bottom layer of android_hardware_camera.cpp and call new JNICameraContext to finally construct a camera context object to complete the camera function call of the smart terminal. Among them, there is a PostData function in the JNICameraContext class that receives the data buffer dataPtr obtained by the system from the camera.

[0077] In the specific implementation, Android's open source project AOSP supports self-customized systems for mobile devices. By modifying the AOSP Camera code and adding code logic for video stream replacement, automatic coloring of replaced videos, and real-time face replacement, the ability of the face recognition technology algorithm model to defend against such attacks is tested.

[0078] AOSP is an open source Android system project led by Google, which can be compiled into an installable Android system image. Based on AOSP, special modifications can be made to the underlying system (system camera related libraries) to compile an installable Android system image with specific functions.

[0079] In the normal process of APP calling the camera function, the APP will call Android Framework's Camera.open(), enter the bottom layer of android_hardware_camera.cpp, and call new JNICameraContext, and finally construct a camera context object before using the camera function. There is a PostData function in the JNICameraContext class that receives the image buffer dataPtr obtained by the system from the hardware. And generate a class consistent with the format of the PostData parameter dataPtr. Replace the original parameter dataPtr in the PostData function with the generated new class to replace the original data transmitted by the real camera, thereby achieving the effect of hijacking the camera.

[0080] Compared with the prior art, the customized ROM method in the embodiment of the present invention can achieve a universal camera output replacement function effect regardless of the complexity of the application layer because the modification location is in the system lib.

[0081] Different manufacturers have different client security policies for apps. Self-compiled systems can improve system information and modify default system parameters, especially the system information returned by system functions that can be modified. The above methods can bypass most app client environment security detection policies.

[0082] The system lib is modified so that the image output by the camera is replaced by a specific video file, and the replacement video can also be customized. For example, the color of the screen can be captured in real time to dye the replaced video frame to test bypassing glare biopsy. If the performance of the mobile device allows, the background and facial expressions of the real camera image can be retained in real time, and only specific faces can be replaced to test bypassing motion biopsy.

[0083] In the future, a friendly operating interface can be created and compiled into a universal system image, which can be distributed to other teams that need to do security testing of facial recognition technology.

[0084] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0085] Another embodiment of the present invention provides a test data generating device for a face recognition model, such as Figure 2 As shown, the device 1 comprises:

[0086] The data encryption, decoding and conversion module 11 is used to obtain a specific video file and convert the video file into test data in a specific format, wherein the specific format is the data calling format of the smart terminal camera;

[0087] The data replacement module 12 is used to replace the test parameters called by the original camera with the pre-generated data class;

[0088] A model testing module 13, used to input the test parameters into a trained face recognition model to obtain an output result of the face recognition model;

[0089] The model performance determination module 14 is used to obtain the test result of the face recognition model according to the output result.

[0090] The specific implementation method is shown in the method embodiment, which will not be described in detail here.

[0091] In one embodiment, the data encryption, decoding and conversion module 11 is specifically used for:

[0092] The specific video file is loaded through the ffmpeg library, wherein the specific video file is a pre-recorded video file.

[0093] The specific implementation method is shown in the method embodiment, which will not be described here in detail.

[0094] In one embodiment, the data encryption, decoding and conversion module 11 is further used for:

[0095] Decoding the video file to obtain a decoded file;

[0096] Convert the decoded file into a format file corresponding to the data call format of the smart terminal camera;

[0097] A data class having the same parameter format as the preset one is generated based on the format file and recorded as test data.

[0098] The specific implementation method is shown in the method embodiment, which will not be described in detail here.

[0099] In one embodiment, the model testing module 13 is specifically used for:

[0100] The test instruction of the face recognition model is detected, and the camera function of the smart terminal is called;

[0101] The test data is input into the face recognition model to be tested to obtain the output result of the face recognition model.

[0102] The specific implementation method is shown in the method embodiment, which will not be described here in detail.

[0103] In one embodiment, the data encryption, decoding and conversion module 11 is further used for:

[0104] Get pre-recorded video files;

[0105] The video file is attacked and processed by the ffmpeg library to obtain a specific video file.

[0106] The specific implementation method is shown in the method embodiment, which will not be described in detail here.

[0107] In one embodiment, the data encryption, decoding and conversion module 11 is further used for:

[0108] The video file is dyed or artificially replaced with a face through the ffmpeg library to obtain a specific video file.

[0109] The specific implementation method is shown in the method embodiment, which will not be described in detail here.

[0110] In one embodiment, the test data generation device for a face recognition model according to the embodiment of the present invention is applied to a smart terminal using an Android system, and the model testing module 13 is further used to:

[0111] Detect the test instruction of the face recognition model and call Android Framework's Camera.open();

[0112] Enter the bottom layer of android_hardware_camera.cpp and call new JNICameraContext to finally construct a camera context object to complete the camera function call of the smart terminal. Among them, there is a PostData function in the JNICameraContext class that receives the data buffer dataPtr obtained by the system from the camera.

[0113] The specific implementation method is shown in the method embodiment, which will not be described in detail here.

[0114] Another embodiment of the present invention provides an electronic device, such as Figure 3 As shown, the electronic device 10 includes:

[0115] One or more processors 110 and memory 120, Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0116] The processor 110 is used to complete various control logics of the electronic device 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware control, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0117] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the test data generation method for the face recognition model in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the test data generation method for the face recognition model in the above method embodiment.

[0118] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store applications required for operating the device and at least one function; the data storage area may store data created according to the use of the device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0119] One or more units are stored in the memory 120, and when executed by one or more processors 110, the test data generation method for the face recognition model in any of the above method embodiments is executed, for example, the above described Figure 1 The method comprises steps S100 to S400.

[0120] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S400.

[0121] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory controls or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0122] Another embodiment of the present invention provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the processor executes the test data generation method for a face recognition model of the above method embodiment. For example, executing the above described Figure 1 The method comprises steps S100 to S400.

[0123] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0124] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0125] Conditional language such as "can," "can," "might," or "may," among other things, unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey that particular embodiments can include (while other embodiments do not) particular features, elements, and / or operations. Thus, such conditional language is also generally intended to imply that features, elements, and / or operations are anyway required for one or more embodiments or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.

[0126] What has been described herein in this specification and the accompanying drawings includes examples of test data generation methods and devices that can be provided for face recognition models. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it is recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is apparent that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure. In addition, or in an alternative, other embodiments of the present disclosure may be apparent from consideration of this specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples set forth in this specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for limiting purposes.

Claims

1. A method for generating test data for a face recognition model, characterized in that , the method comprises: Obtain a specific video file, and convert the video file into test data in a specific format, wherein the specific format is a data calling format of a smart terminal camera; Replacing the original camera data called by the smart terminal camera with the test data; Input the test data into a face recognition model to be tested, and obtain an output result of the face recognition model; According to the output result, the test result of the face recognition model is obtained.

2. The method according to claim 1, characterized in that The obtaining of a specific video file comprises: The specific video file is loaded through the ffmpeg library, wherein the specific video file is a pre-recorded video file.

3. The method according to claim 2, characterized in that The step of converting the video file into test data in a specific format includes: Decoding the video file to obtain a decoded file; Convert the decoded file into a format file corresponding to the data call format of the smart terminal camera; A data class having the same parameter format as the preset one is generated based on the format file and recorded as test data.

4. The method according to claim 3, characterized in that The step of inputting the test data into a face recognition model to be tested and obtaining an output result of the face recognition model comprises: The test instruction of the face recognition model is detected, and the camera function of the smart terminal is called; The test data is input into the face recognition model to be tested to obtain the output result of the face recognition model.

5. The method according to claim 4, characterized in that The specific video file is loaded through the ffmpeg library, including: Get pre-recorded video files; The video file is attacked and processed by the ffmpeg library to obtain a specific video file.

6. The method according to claim 5, characterized in that The attack processing of the video file by the ffmpeg library to obtain a specific video file includes: The video file is dyed or artificially replaced with a face through the ffmpeg library to obtain a specific video file.

7. The method according to claim 6, characterized in that Applied to a smart terminal using an Android system, the test instruction for detecting a face recognition model and calling a camera function of the smart terminal include: Detect the test instruction of the face recognition model and call Android Framework's Camera.open(); Enter the bottom layer of android_hardware_camera.cpp and call new JNICameraContext to finally construct a camera context object to complete the camera function call of the smart terminal. Among them, there is a PostData function in the JNICameraContext class that receives the data buffer dataPtr obtained by the system from the camera.

8. A test data generation device for a face recognition model, characterized in that: The device comprises: A data encryption, decoding and conversion module is used to obtain a specific video file and convert the video file into test data in a specific format, wherein the specific format is the data call format of the smart terminal camera; The data replacement module is used to replace the test parameters called by the original camera with the pre-generated data class; A model testing module, used to input the test parameters into a trained face recognition model to obtain an output result of the face recognition model; The model performance determination module is used to obtain the test result of the face recognition model according to the output result.

9. An electronic device, characterized in that: The electronic device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the test data generation method for a face recognition model described in any one of claims 1-7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the test data generation method for a face recognition model as described in any one of claims 1-7.