Sample acquisition method, device, electronic device and machine-readable storage medium
By extracting and fusing the target feature information of the first negative sample data, a large amount of second negative sample data is generated, which solves the problem of difficulty in obtaining negative sample data in deep learning models and improves training efficiency.
Patent Information
- Application Number
- CN201910858414.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-11
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2039-09-11
AI Technical Summary
In the training of deep learning models, it is difficult to obtain negative sample data, especially in live recognition scenarios. It is impossible to directly determine the differential characteristics that distinguish between live and non-living, resulting in difficulty in obtaining negative sample data.
By obtaining a small amount of first negative sample data, extracting its target feature information, including differential feature information, and fusing it into the positive sample data, and processing it through frequency domain transformation and inverse transformation, a large number of second negative sample data are generated.
It realizes the rapid acquisition of large amounts of negative sample data, which reduces the time and cost of obtaining negative sample data, and improves the training efficiency of deep learning models.
Smart Images

Figure CN112488137B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data enhancement technology, and in particular to a sample acquisition method, device, electronic device and machine-readable storage medium. Background Art
[0002] Deep learning models are often used as discriminators for type recognition. Deep learning models have many model parameters. In order to optimize the model parameters, a large amount of sample data is required to train the deep learning model. Among them, positive sample data is usually easier to obtain, but in some scenarios, it is difficult to obtain negative sample data. Summary of the invention
[0003] In view of this, one of the objects of the present invention is to provide a sample acquisition method, device, electronic device and machine-readable storage medium, which can quickly acquire a large amount of negative sample data.
[0004] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0005] In a first aspect, an embodiment of the present invention provides a sample acquisition method, the method comprising:
[0006] Obtain first negative sample data;
[0007] Extracting target feature information from the first negative sample data, wherein the target feature information includes difference feature information for distinguishing the first negative sample data from the positive sample data;
[0008] The positive sample data is processed according to the target feature information to obtain second negative sample data.
[0009] In an optional implementation, the positive sample data is a living human face image, the first negative sample data is a non-living human face image, and the difference feature information is non-living feature information.
[0010] In an optional implementation, extracting target feature information from the first negative sample data includes:
[0011] Performing frequency domain transformation on the non-living human face image to obtain a frequency spectrum of the non-living human face image;
[0012] A first frequency domain block containing the non-living body feature information is obtained from the spectrum diagram of the non-living body face image as the target feature information.
[0013] In an optional implementation, the frequency domain transformation is a Fourier transform, and the target feature information is at least one high-frequency frequency domain block in a spectrum diagram of the non-living face image; or,
[0014] The frequency domain transformation is discrete cosine transformation, and the target feature information is at least one low-frequency frequency domain block in the spectrum diagram of the non-living face image.
[0015] In an optional implementation manner, the processing the positive sample data according to the target feature information to obtain the second negative sample data includes:
[0016] Performing the frequency domain transformation on the living human face image to obtain a first frequency spectrum diagram of the living human face image;
[0017] Determine a second frequency domain block corresponding to each of the first frequency domain blocks from the first frequency spectrum, and replace each of the determined second frequency domain blocks with the corresponding first frequency domain block to obtain a second frequency spectrum;
[0018] An inverse transformation corresponding to the frequency domain transformation is performed on the second spectrum graph, and the obtained face image is used as the second negative sample data.
[0019] In an optional implementation, the target feature information includes at least one of a texture feature, an image quality feature, and a color feature of the non-living face image;
[0020] The processing of the positive sample data according to the target feature information to obtain the second negative sample data includes:
[0021] The target feature information is fused into the living face image, and the obtained face image is used as the second negative sample data.
[0022] In an optional implementation manner, the processing the positive sample data according to the target feature information to obtain the second negative sample data includes:
[0023] A plurality of living face images containing different faces are processed respectively according to the target feature information to obtain a plurality of second negative sample data containing different faces.
[0024] In an optional embodiment, the method further comprises:
[0025] The positive sample data and the second negative sample data are used to train or test a live face recognition model.
[0026] In a second aspect, an embodiment of the present invention provides a sample acquisition device, comprising:
[0027] An acquisition module, used for acquiring first negative sample data;
[0028] An extraction module, configured to extract target feature information from the first negative sample data, wherein the target feature information includes difference feature information for distinguishing the first negative sample data from the positive sample data;
[0029] The sample processing module is used to process the positive sample data according to the target feature information to obtain second negative sample data.
[0030] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed, the processor is prompted to implement any one of the methods described in the implementation scheme of the first aspect above.
[0031] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium having machine-executable instructions stored thereon, wherein the machine-executable instructions, when executed, implement the method described in any one of the embodiments of the first aspect.
[0032] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0033] The sample acquisition method, device, electronic device and machine-readable storage medium provided in the embodiments of the present invention only need to directly produce a small amount of first negative sample data, and then process the positive sample data to include the difference feature information of the first negative sample data, so as to quickly obtain a large amount of second negative sample data, thereby greatly saving the time and cost required to obtain negative sample data.
[0034] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A schematic diagram of a flow chart of a sample acquisition method provided by an embodiment of the present invention is shown;
[0037] Figure 2 Shows Figure 1 A schematic diagram of a sub-step of step S120 is shown;
[0038] Figure 3 shows a spectrum diagram of a face image in an example provided by an embodiment of the present invention;
[0039] Figure 4A schematic diagram of region division of a frequency spectrum diagram of a face image is shown in another example provided by an embodiment of the present invention;
[0040] Figure 5 Shows Figure 1 A schematic diagram of a sub-step of step S130 is shown;
[0041] Figure 6 The following is a flow chart showing a process for generating second negative sample data in an example provided by an embodiment of the present invention;
[0042] Figure 7 Shown in accordance with Figure 6 A schematic diagram showing the effect of the second negative sample data generated by the process shown;
[0043] Figure 8 A block diagram of an electronic device provided by an embodiment of the present invention is shown;
[0044] Fig. 9 A functional module block diagram of a sample acquisition device provided by an embodiment of the present invention is shown.
[0045] Icons: 100 - electronic device; 101 - processor; 102 - machine-readable storage medium; 103 - system bus; 110 - sample acquisition device; 111 - acquisition module; 112 - extraction module; 113 - sample processing module. DETAILED DESCRIPTION
[0046] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0047] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0048] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0049] In some scenarios where deep learning models are used for category determination, the training data used to train the deep learning models usually includes positive sample data and negative sample data. For example, for a deep learning model used to determine whether an object to be identified belongs to a target category, the positive sample data required for training it is usually sample data belonging to the target category, and the negative sample data is usually sample data belonging to other categories different from the target category.
[0050] In practical applications, sometimes it is impossible to determine the specific features used to judge the target category and other categories different from the target category, and it is impossible to directly use the specific features to generate negative sample data. Instead, it is necessary to simulate the appearance scenarios of other categories of data in practical applications to obtain the corresponding negative sample data. However, simulating the appearance scenarios of other categories of data takes a lot of time and money, which is costly and inefficient.
[0051] Based on this, the embodiments of the present invention provide a sample acquisition method, device, electronic device and machine-readable storage medium, which can easily and quickly acquire a large number of negative samples. The content is described below.
[0052] Please refer to Figure 1 , Figure 1 This is a flow chart of a sample acquisition method provided by this embodiment, which can be executed by any electronic device with data processing function. Each step of the method is described in detail below.
[0053] Step S110, obtaining first negative sample data.
[0054] The first negative sample data may be obtained in advance by simulating an occurrence scenario of data that does not belong to the target category.
[0055] Step S120: extracting target feature information from the first negative sample data, wherein the target feature information includes difference feature information for distinguishing the first negative sample data from positive sample data.
[0056] The difference feature information refers to information in the first negative sample data that can be distinguished from the positive sample data, that is, information that can identify that the first negative sample data does not belong to the target category.
[0057] After research, it is found that although it is impossible to directly determine the difference feature information used to distinguish the target category from other categories different from the target category, based on the scenarios and relevant experience of generating target category data and other category data, it is possible to predetermine which parts of the data the difference feature information is usually hidden in. Among them, part of the information of the difference feature information hidden in the first negative sample data is the target feature information described in this embodiment.
[0058] Step S130: Process the positive sample data according to the target feature information to obtain second negative sample data.
[0059] There are many ways to process the positive sample data based on the target feature information, which are not limited in this embodiment, as long as the positive sample data can be processed into data containing the target feature information. For example, the target feature information can be used to replace part of the feature information in the positive sample data to obtain the second negative sample data. For another example, the target feature information can be fused into the positive sample data to obtain the second negative sample data.
[0060] During implementation, a large amount of positive sample data and a small amount of first negative sample data can be obtained in advance, wherein the positive sample data can usually be captured from the Internet, and the first negative sample data can be obtained by simulating the scene where the data appears. There are multiple ways to obtain the second negative sample data based on the large amount of positive sample data and the small amount of first negative sample data:
[0061] In one implementation, target feature information may be extracted from each first negative sample data in turn, and for each extracted target feature information, each positive sample data may be processed according to the target feature information to obtain a corresponding plurality of second negative sample data.
[0062] In another embodiment, a first negative sample data and a positive sample data can be randomly selected each time, target feature information can be extracted from the randomly selected first negative sample data, and the randomly selected positive sample data can be processed according to the target feature information to obtain a corresponding second negative sample data. By repeating the above process, a large amount of second negative sample data can be obtained.
[0063] Therefore, through Figure 1 The method shown can add the target feature information containing the difference feature information in the first negative sample data to the positive sample data to construct the second negative sample data containing the difference feature information of the first negative sample data. Through this method, only a small amount of negative sample data needs to be obtained by simulating the data appearance scene, and a large amount of other negative sample data can be obtained by data processing, which greatly saves time and the cost required for simulating scenes, reduces costs, and improves efficiency.
[0064] The sample acquisition method provided in this embodiment can be applied to different scenarios.
[0065] For example, as face recognition technology matures, its applications are becoming more and more widespread. However, face recognition systems are very vulnerable to malicious attacks from non-real face data, which affects the accuracy of recognition results. Therefore, face recognition systems usually use liveness recognition technology to determine whether the captured face is a real face or a fake face attack, such as a face printed on color paper, a face image on an electronic device screen, a face mask, a 3D printed face model, etc.
[0066] At present, the technologies for implementing liveness recognition are divided into two categories: the first category uses action instructions to perform liveness recognition, that is, prompting the user to perform actions in a specified order. If the action order does not match, the currently recognized object is determined to be non-live (that is, not a real face); the second category is a non-cooperative solution for liveness recognition based on the physical features of the collected face image. Since the first method requires user cooperation and has a poor experience, the second method is currently used more often.
[0067] However, the second method mentioned above mainly relies on the implementation of a deep learning model, and training the deep learning model usually requires positive sample data and negative sample data. In this scenario, the positive sample data is a live face image (i.e., a real face image directly acquired by an image acquisition device), and the negative sample data is a non-live face image. Among them, live face images are relatively easy to obtain, such as being captured from the Internet.
[0068] However, in actual application scenarios, it is impossible to directly determine the difference features that distinguish between living and non-living objects. Therefore, it is impossible to directly create non-living face data as negative sample data based on the difference features. Instead, negative sample data can only be created in a manner similar to non-living attacks. For example, negative sample data is usually obtained by reshooting facial images, recoding facial videos, obtaining facial portrait models through 3D printing, and making facial masks. These methods take a long time and are costly.
[0069] By applying the sample acquisition method provided in this embodiment to a liveness recognition scenario, the above problems can be improved. Specifically, in a liveness recognition scenario, the positive sample data in step S110 can be a liveness face image, the first negative sample data in step S120 can be a non-liveness face image, and the difference feature information can be a non-liveness feature, that is, feature information in a non-liveness face image used to distinguish a non-liveness face image from a liveness face image.
[0070] Taking the liveness recognition scenario as an example, there may be multiple target feature information containing differential feature information in a non-liveness face image.
[0071] Research has found that after transforming the image from the spatial domain to the frequency domain, the differential feature information for distinguishing living and non-living objects in the image is usually concentrated in a specific frequency range.
[0072] Therefore, in the first implementation, the non-living face image as the first negative sample data can be converted from the spatial domain to the frequency domain, and then the corresponding target feature information can be extracted from the spectrum of the non-living face image. Figure 2 As shown, step S120 may include the following steps.
[0073] Step S120 - 1 , performing frequency domain transformation on the non-living human face image to obtain a frequency spectrum of the non-living human face image.
[0074] Step S120 - 2 , obtaining a first frequency domain block containing the non-living feature information from the spectrum diagram of the non-living face image as the target feature information.
[0075] In step S120 - 1 , the frequency domain transformation may be implemented in a variety of ways.
[0076] In one example, the frequency domain transform may be, for example, a Fourier transform (FT). The difference between a pixel point on a non-living face image and its adjacent pixel points may be represented by a gradient, and the gradient corresponds to a frequency point in the spectrum of the non-living face image. It can be seen that the frequency in the spectrum reflects the speed of change of pixel information in the non-living face image, and the image detail information (such as edge information, texture information, etc.) that changes faster is usually concentrated in the high-frequency part of the spectrum.
[0077] According to research and analysis, there is usually a difference in edge information between non-live face images and live face images, and non-live face images will have obvious mirror reflection, blur, and moiré information in the image details, which live face images do not have. According to the above description of the characteristics of the spectrum graph, edge information, mirror reflection, blur, moiré information and other image details with obvious changes are usually concentrated in the high-frequency part of the spectrum graph of non-live face images.
[0078] Therefore, in step S120 - 2 , a high-frequency frequency domain block may be selected from the spectrum diagram of the non-living face image as the first frequency domain block.
[0079] In this embodiment, when the frequency domain transform is Fourier transform, the center of the spectrum diagram of the non-living face image usually represents the average grayscale of the non-living face image, and the frequency is 0, that is, the center is low-frequency information and the periphery is high-frequency information.
[0080] Please refer to Figure 3 , Figure 3A face image A1 and a spectrum graph A1 obtained by Fourier transforming the face image A1 are shown. A frequency domain block of a preset size including its center point can be determined from the spectrum graph I1, such as a frequency domain block block1 of 1×1 size. In implementation, at least one frequency domain block of a preset size can be selected from other areas of the spectrum graph I1 except block1, and each extracted frequency domain block is the first frequency domain block in this embodiment. For example, n (n is an integer greater than or equal to 1) frequency domain blocks of m×m size are extracted from other areas except block1, where m can be, for example, 4, 8, 16, etc.
[0081] In another example, the frequency domain transform may be, for example, a discrete cosine transform (DCT). Through the discrete cosine transform, the image detail information in the original image (e.g., a living face image or a non-living face image) may be mapped to the low-frequency part of the spectrogram. In other words, based on the low-frequency information in the spectrogram obtained by the discrete cosine transform, it is possible to well identify whether the original image is a living face image.
[0082] In this case, in step S120 - 2 , a low-frequency frequency domain block may be extracted from the spectrum diagram of the non-living face image as the first frequency domain block.
[0083] Correspondingly, when the frequency domain is transformed into discrete cosine transform, in the spectrum of the non-living face image, the low-frequency information is usually concentrated in the upper left corner of the spectrum, and the high-frequency information is usually concentrated in the lower right corner of the spectrum. Therefore, for the spectrum of the non-living face image obtained by discrete cosine transform, the spectrum can be divided into the following Figure 4 The four regions S1, S2, S3, and S4 shown in the figure can, during implementation, extract at least one frequency domain block of a preset size from the region S1 located at the upper left corner, and each extracted frequency domain block is a first frequency domain block.
[0084] It can be understood that the frequency domain transformation can also be implemented by other algorithms, and this embodiment has no limitation on this.
[0085] In this embodiment, when the target feature information is the first frequency domain block in the spectrum diagram of the non-living face image, the living face image as the positive sample data can be processed based on the first frequency domain block, and there can be multiple specific processing methods.
[0086] In one way, please refer again to Figure 5 , step S130 may include the following steps.
[0087] Step S130 - 1 , performing the frequency domain transformation on the living human face image to obtain a first frequency spectrum of the living human face image.
[0088] The method of performing frequency domain transformation on the living human face image is the same as the method of performing frequency domain transformation on the non-living human face image in the above step S120 - 1 , and will not be described in detail here.
[0089] Step S130-2: determine a second frequency domain block corresponding to each of the first frequency domain blocks from the first frequency domain graph, and replace each of the determined second frequency domain blocks with the corresponding first frequency domain block to obtain a second frequency domain graph.
[0090] In this embodiment, the living face image as the positive sample data and the non-living face image as the first negative sample data can be pre-processed into images of the same size, so that the spectrogram of the non-living face image obtained in step S120-1 and the first spectrogram obtained in step S130-1 will also have the same size. In this case, the frequency domain block in the first spectrogram that is located at the same position as the first frequency domain block can be the corresponding second frequency domain block.
[0091] Step S130 - 3 , performing an inverse transformation corresponding to the frequency domain transformation on the second spectrum graph, and using the obtained face image as the second negative sample data.
[0092] Among them, when the frequency domain transform is Fourier transform, its corresponding inverse transform is inverse Fourier transform; when the frequency domain transform is discrete cosine transform, its corresponding inverse transform is inverse discrete cosine transform.
[0093] Please refer to Figure 6 , wherein the frequency domain transformation is Fourier transform as an example, showing the specific process of generating the second negative sample data based on the spectrum diagram of the living face image and the first spectrum diagram of the non-living face image.
[0094] Among them, the living face image A1 is transformed by Fourier transform to obtain the first spectrum graph I1, and the non-living face image A2 is transformed by Fourier transform to obtain the second spectrum graph I2. The four first frequency domain blocks c1, c2, c3, and c4 are extracted from the first spectrum graph I1 as target feature information. In the second spectrum graph I2, the second frequency domain block c1' is replaced with the corresponding first frequency domain block c1, the second frequency domain block c2' is replaced with the corresponding first frequency domain block c2, the second frequency domain block c3' is replaced with the corresponding first frequency domain block c3, and the second frequency domain block c4' is replaced with the corresponding first frequency domain block c4, and the replaced spectrum graph I3 can be obtained. Then, the spectrum graph I3 is inversely Fourier transformed, and the obtained image A3 is the second negative sample data.
[0095] Please refer to Figure 7 , which shows a partial schematic diagram of image A3. The basic outline of the face in image A3 has not changed, but the image details have the difference feature information of the non-living face image.
[0096] In other methods, the first frequency domain block can be superimposed with the second frequency domain block at the corresponding position in the spectrum diagram of the living face image to obtain a new spectrum diagram, and then the new spectrum diagram is inversely transformed corresponding to the frequency domain transformation to obtain the second negative sample data.
[0097] Research has found that some non-live face images are obtained by reshooting or recording live face images, so there is a certain difference in image quality between non-live face images and live face images. In addition, some other non-live face images are obtained through 3D face models and face masks, and their texture information and color information are different from those of live face images.
[0098] Based on this, in the second implementation of this embodiment, the target feature information may also be at least one of texture features, image quality features, and color features. In this embodiment, an existing feature extraction algorithm or model may be used to extract the above texture features, image quality features, and color features from a non-living face image as the first negative sample data, and then a feature-level image fusion algorithm may be used to fuse the extracted features into a living face image as the positive sample data. In this way, the fused new image contains at least one of the texture features, image quality features, and color features of the non-living face image, and may be used as the second negative sample data.
[0099] In the prior art, non-live facial images are created by simulating non-live attacks, such as creating 3D face models, face masks, etc., which are often limited by the number of people of different identities that the data collector can contact in a short period of time. In addition, since the creation process is time-consuming, it is usually difficult to create a large number of non-live facial images containing different faces in a short period of time.
[0100] In order to improve the above problem, the sample acquisition method provided in this embodiment may further include the following steps:
[0101] A plurality of living face images containing different faces are processed respectively according to the target feature information to obtain a plurality of second negative sample data containing different faces.
[0102] In other words, you can follow Figure 1 The process shown processes multiple living face images containing different faces to obtain a large number of non-living face images with differences, so that the deep learning model subsequently trained based on the non-living face images still has a high accuracy rate when detecting different faces, that is, it has good generalization ability.
[0103] The second negative sample data obtained by the sample acquisition method provided in this embodiment can be coordinated with other positive sample data for training or testing a deep learning model, such as training or testing a deep learning model for living body recognition.
[0104] Please refer to Figure 8 , Figure 8 A block diagram of an electronic device 100 provided in this embodiment is shown. The electronic device 100 includes a processor 101 and a machine-readable storage medium 102, and the processor 101 and the machine-readable storage medium 102 can be communicatively connected via a system bus 103. The machine-readable storage medium 102 stores machine-executable instructions, which, when executed, prompt the processor 101 to implement the processing flow of the sample acquisition method provided in this embodiment.
[0105] Among them, the machine-readable storage medium 102 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0106] It is worth mentioning that Figure 8 The structure shown is for illustration only. The electronic device 100 may also have Figure 8 More or fewer components as shown, or with Figure 8 The completely different configurations shown, for example, Figure 8 The electronic device 100 may further include a communication unit for communicating with an external device, which is not limited in this embodiment.
[0107] Please refer to Fig. 9 , Fig. 9 The functional module block diagram of a sample acquisition device 110 provided in this embodiment is shown. The sample acquisition device 110 includes at least one functional module that can be stored in the machine-readable storage medium 102 in the form of software. From the functional point of view, the sample acquisition device 110 can include an acquisition module 111, an extraction module 112 and a sample processing module 113.
[0108] The acquisition module 111 is used to acquire first negative sample data.
[0109] The extraction module 112 is used to extract target feature information from the first negative sample data, wherein the target feature information includes difference feature information used to distinguish the first negative sample data from the positive sample data.
[0110] The sample processing module 113 is used to process the positive sample data according to the target feature information to obtain second negative sample data.
[0111] In a live body recognition scenario, the positive sample data may be a live face image, the first negative sample data may be a non-live face image, and the difference feature information may be non-live feature information.
[0112] For a detailed description of the above functional modules, please refer to the detailed description of the relevant steps in the previous text, which will not be repeated here.
[0113] In summary, the sample acquisition method, device, electronic device and machine-readable storage medium provided in the embodiments of the present invention only need to directly produce a small amount of first negative sample data, and then process the positive sample data to include the difference feature information of the first negative sample data, so as to quickly obtain a large amount of second negative sample data, thereby greatly saving the time and cost required to obtain negative sample data.
[0114] It should be noted that in several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0116] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0117] The above description is only a selected embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A sample acquisition method, characterized in that: The method comprises: Acquire first negative sample data, where the first negative sample data is a non-living face image; Performing frequency domain transformation on the non-living human face image to obtain a frequency spectrum of the non-living human face image; Acquire a first frequency domain block containing the non-live feature information from the spectrum diagram of the non-live face image as target feature information, wherein the target feature information contains difference feature information for distinguishing the first negative sample data from positive sample data, the positive sample data is a live face image, and the difference feature information is non-live feature information; The positive sample data is processed according to the target feature information to obtain second negative sample data.
2. The method according to claim 1, characterized in that The frequency domain transformation is Fourier transformation, and the target feature information is at least one high-frequency frequency domain block in the spectrum diagram of the non-living face image; or, The frequency domain transformation is discrete cosine transformation, and the target feature information is at least one low-frequency frequency domain block in the spectrum diagram of the non-living face image.
3. The method according to claim 1 or 2, characterized in that: The processing of the positive sample data according to the target feature information to obtain the second negative sample data includes: Performing the frequency domain transformation on the living human face image to obtain a first frequency spectrum diagram of the living human face image; Determine a second frequency domain block corresponding to each of the first frequency domain blocks from the first frequency spectrum, and replace each of the determined second frequency domain blocks with the corresponding first frequency domain block to obtain a second frequency spectrum; An inverse transformation corresponding to the frequency domain transformation is performed on the second spectrum graph, and the obtained face image is used as the second negative sample data.
4. The method according to claim 1, characterized in that The target feature information includes at least one of a texture feature, an image quality feature, and a color feature of the non-living face image; The processing of the positive sample data according to the target feature information to obtain the second negative sample data includes: The target feature information is fused into the living face image, and the obtained face image is used as the second negative sample data.
5. The method according to claim 1, characterized in that The processing of the positive sample data according to the target feature information to obtain the second negative sample data includes: A plurality of living face images containing different faces are processed respectively according to the target feature information to obtain a plurality of second negative sample data containing different faces.
6. The method according to any one of claims 1 to 2 and 5, characterized in that: The method further comprises: The positive sample data and the second negative sample data are used to train or test a live face recognition model.
7. A sample acquisition device, characterized in that: include: An acquisition module, configured to acquire first negative sample data, wherein the first negative sample data is a non-living face image; An extraction module, used for performing frequency domain transformation on the non-living face image to obtain a frequency spectrum of the non-living face image; Acquire a first frequency domain block containing the non-live feature information from the spectrum diagram of the non-live face image as target feature information, wherein the target feature information contains difference feature information for distinguishing the first negative sample data from positive sample data, the positive sample data is a live face image, and the difference feature information is non-live feature information; The sample processing module is used to process the positive sample data according to the target feature information to obtain second negative sample data.
8. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed, the processor is prompted to implement the method according to any one of claims 1 to 6.
9. A machine-readable storage medium having machine-executable instructions stored thereon, characterized in that: When the machine executable instructions are executed, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device used for generating image
CN108509916A
Method and device for generating negative sample of face recognition and computer equipment
CN110163053A