CN112766208A - Model training method and device - Google Patents

Model training method and device Download PDF

Info

Publication number
CN112766208A
CN112766208A CN202110121077.4A CN202110121077A CN112766208A CN 112766208 A CN112766208 A CN 112766208A CN 202110121077 A CN202110121077 A CN 202110121077A CN 112766208 A CN112766208 A CN 112766208A
Authority
CN
China
Prior art keywords
image
face image
sample
face
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110121077.4A
Other languages
Chinese (zh)
Inventor
邱迪
敖莹莹
甄成
闫鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202110121077.4A priority Critical patent/CN112766208A/en
Publication of CN112766208A publication Critical patent/CN112766208A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Abstract

The specification discloses a model training method and a model training device, wherein a real face image is obtained, the real face image is a face image with a set obstruction in a face portion shot really, a service platform can generate a model through a preset sample, and a target image is a face image with a set obstruction in the face portion generated by the sample generation model. The business platform can input the target image and the real image into a preset discrimination model to obtain a discrimination result for representing the similarity degree between the target image and the real image, and can train the sample generation model by taking the similarity degree between the target image and the real image in the maximized discrimination result as an optimization target.

Description

Model training method and device
Technical Field
The present disclosure relates to the field of machine learning, and in particular, to a method and an apparatus for model training.
Background
Currently, due to the influence of epidemic situations, people all need to wear the mask in many cases, for example, the distributor needs to wear the mask all the time in the distribution process. For another example, people also need to wear masks while riding in public transportation. Therefore, in some cases, it is necessary to detect whether or not a mask is worn for a specific person or a person in a specific occasion.
Based on this, the service platform needs to obtain a large number of face images wearing the mask, and the face images are used as training samples to train the recognition model of whether the detection personnel wear the mask. In the prior art, such a training sample can also be obtained by pasting a mask image into a face image, but the training sample obtained by this method is not true.
Therefore, how to efficiently acquire a relatively real training sample is an urgent problem to be solved.
Disclosure of Invention
The present specification provides a method and apparatus for model training to partially solve the above problems in the prior art.
The technical scheme adopted by the specification is as follows:
the present specification provides a method of model training, comprising:
acquiring a real face image, wherein the real face image is a face image of a real shot face with a set occlusion;
generating a target image through a preset sample generation model, wherein the target image is a human face image which is generated by the sample generation model and has a set obstruction;
inputting the target image and the real face image into a preset discrimination model to obtain a discrimination result for representing the similarity degree between the target image and the real face image;
and training the sample generation model by taking the maximum similarity degree between the target image and the real face image in the discrimination result as an optimization target.
Optionally, the method further comprises:
generating a sample set through the trained sample generation model, wherein the sample set comprises a sample face image of the set occlusion object on the face generated by the trained sample generation model;
inputting the sample face image into a preset identification model aiming at each sample face image contained in the sample set to obtain an identification result;
and training the recognition model according to the recognition result, wherein the recognition model is used for judging whether the set occlusion exists on the face according to the input face image.
Optionally, generating a sample set by using the trained sample generation model specifically includes:
generating a human face image with the set occlusion object on the human face through the trained sample generation model, and taking the human face image as a basic human face image;
determining image processing parameters corresponding to each image processing mode as target processing parameters, wherein the image processing mode comprises at least one of brightness adjustment, fuzzy processing and rotation transformation processing;
performing image processing on the basic face image according to the target processing parameters to obtain a processed face image;
and taking the processed face image and the basic face image as sample face images to generate the sample set.
Optionally, generating a sample set by using the trained sample generation model specifically includes:
generating a human face image with the set occlusion object on the human face through the trained sample generation model, and taking the human face image as a basic human face image;
carrying out target detection on the basic face image, and detecting an image area where the set occlusion object is located in the basic face image as a first image area;
performing color transformation on the first image area to obtain a processed face image;
and taking the processed face image and the basic face image as sample face images to generate the sample set.
Optionally, generating a sample set by using the trained sample generation model specifically includes:
generating a human face image with the set occlusion object on the human face through the trained sample generation model, and taking the human face image as a basic human face image;
identifying the set occlusion from the basic face image;
adjusting the position of the image of the set shielding object in the basic face image to obtain an adjusted face image;
and taking the adjusted face image and the basic face image as sample face images to generate the sample set.
Optionally, adjusting the position of the image of the set obstruction in the basic face image to obtain an adjusted face image, specifically including:
removing the image of the set shielding object contained in the basic face image, and completing the image of the set target object in the basic face image from which the set shielding object is removed to obtain a completed face image;
determining an image area of the set target object in the completed face image as a second image area, and determining other image areas adjacent to the second image area;
and adding the image of the set occlusion object in the supplemented face image according to the other image areas and the boundary of the set occlusion object in the basic face image to obtain an adjusted face image.
Optionally, for each sample face image included in the sample set, inputting the sample face image into a preset recognition model to obtain a recognition result, and specifically including:
and inputting the sample face image into a preset identification model to obtain an identification result, wherein the identification result is used for indicating whether the set occlusion object in the sample face image covers the set target object of the face in the sample face image.
Optionally, the face image of the face with the set obstruction is the face image of the wearing mask.
The present specification provides an apparatus for model training, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a real face image, and the real face image is a face image of a real shot face with a set occlusion;
the generating module is used for generating a target image through a preset sample generating model, wherein the target image is a human face image with a set obstruction on a human face generated by the sample generating model;
the judging module is used for inputting the target image and the real image into a preset judging model to obtain a judging result for expressing the similarity degree between the target image and the real image;
and the optimization module is used for training the sample generation model by taking the maximum similarity degree between the target image and the real image in the judgment result as an optimization target.
The present specification provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the above-described method of model training.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above-described method of model training when executing the program.
The technical scheme adopted by the specification can achieve the following beneficial effects:
in the model training method and apparatus provided in this specification, a service platform may obtain a real face image, where the real face image is a face image in which a set blocking object exists on a face portion that is actually photographed, and the service platform may generate a target image by generating a model from a preset sample, where the target image is a face image in which the set blocking object exists on a face portion that is generated by the sample generation model. The business platform can input the target image and the real image into a preset discrimination model to obtain a discrimination result for representing the similarity degree between the target image and the real image, and the business platform can train the sample generation model by taking the similarity degree between the target image and the real image in the maximized discrimination result as an optimization target.
It can be seen from the above method that, in the method, the service platform can train the sample generation model through the real face image of the face portion which is shielded by the set shielding object, and since the optimization goal is to maximize the similarity between the target image generated by the sample generation model and the real image, after the training of the sample generation model is completed, an image of the real face portion with the set shielding object can be generated, and such an image can be used as a training sample and provided for the identification model which needs to detect whether the face portion has the set shielding object to train. Therefore, compared with the prior art, the method can effectively generate a relatively real training sample.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
FIG. 1 is a schematic flow chart of a method of model training in the present specification;
FIG. 2 is a schematic diagram of a sample generation model and a discriminant model provided herein;
FIG. 3 is a schematic diagram of an adjusted face image provided herein;
FIG. 4 is a schematic diagram of an apparatus for model training in the present specification;
fig. 5 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a model training method in this specification, which specifically includes the following steps:
s101: and acquiring a real face image, wherein the real face image is a face image of a real shot face with a set occlusion.
In practical application, a business platform needs to train an identification model for judging whether a set occlusion exists on a face of a human face in a face image, and the identification model needs a large number of face images with the set occlusion existing on the face of the human face as training samples.
Based on this, the service platform may obtain some real face images, where the real face images are face images with set blocking objects existing on the face portion photographed really, and the service platform needs to train a sample generation model through the real face images, and after the training of the sample generation model is completed, a large number of training samples for training the recognition model are generated through the sample generation model.
S102: generating a target image through a preset sample generation model, wherein the target image is a human face image generated by the sample generation model and provided with a set obstruction.
S103: and inputting the target image and the real image into a preset discrimination model to obtain a discrimination result for representing the similarity degree between the target image and the real image.
S104: and training the sample generation model by taking the maximum similarity degree between the target image and the real image in the discrimination result as an optimization target.
In this specification, training of the sample generation model requires a discriminant model to assist implementation, as shown in fig. 2.
Fig. 2 is a schematic diagram of a sample generation model and a discriminant model provided in this specification.
As can be seen from fig. 2, the randomly generated vector may be input into a sample generation model, the sample generation model generates a target image, and after the sample generation model generates the target image, the service platform may input the target image and the real face image into the discrimination model, so as to obtain a discrimination result for representing a degree of similarity between the target image and the real face image. The service platform needs to train the sample generation model by taking the maximum similarity degree between the target image and the real face image in the discrimination result as an optimization target, wherein the randomly generated vector can be random noise, gaussian noise or uniform noise.
It should be noted that before the sample generation model is trained, the discrimination model needs to be trained, so that the discrimination model has a certain capability of discriminating a difference between a target image and a real image, and the discrimination model can be trained by using the difference between the target image and the real image maximally discriminated by the discrimination model as an optimization target.
That is to say, the sample generation model is enabled to generate a target image with a set obstruction on a face that is nearly real, so that the degree of similarity between the target image and a real face image is determined by a determination model to the maximum, that is, the difference between the target image and the real face image cannot be determined by the determination model as much as possible, wherein the sample generation model and the determination model may be a generated confrontation network (GAN) or other machine learning models.
The method comprises the steps that a discrimination model and a sample generation model are continuously trained, the trained sample generation model can generate an image of a human face image with a set shielding object, therefore, a business platform can generate a sample set through the trained sample generation model, the mentioned sample set comprises a sample human face image with the set shielding object on the human face after a randomly generated vector is input into the trained sample generation model, the business platform can input the sample human face image into a preset identification model aiming at each sample human face image in the sample set to obtain an identification result, and the identification model is trained by taking the minimum deviation between the identification result and the labeling information corresponding to the sample human face image as an optimization target. The identification model is used for judging whether the human face has the set occlusion according to the input human face image.
In addition to the sample face images generated by the sample generation model in the sample set, the service platform may further perform image processing on the sample face images generated by the sample generation model to increase the images in the sample set, so as to increase the number of training samples for training the recognition model.
The business platform can further process the sample face image generated by the sample generation model through a plurality of methods. For example, the service platform may generate, through the trained sample generation model, a face image with a set occlusion in the face as a base face image, and determine image processing parameters corresponding to image processing modes as target processing parameters, where the image processing modes mentioned herein may include brightness adjustment, blur processing, rotation transformation processing, and the like.
The service platform can determine image processing parameters corresponding to each image processing mode as target processing parameters, and perform image processing on the basic face image according to the target processing parameters to obtain a processed face image, wherein a plurality of image processing parameters in the image processing modes can be preset as the image processing parameters corresponding to the image processing modes for each image processing mode, and the plurality of image processing parameters in different image processing modes can be combined at will, that is, one image processing parameter can be selected in each image processing mode, and the image processing parameters selected in different image processing modes can be combined to obtain one target processing parameter.
The service platform can perform image processing on each basic face image according to various target processing parameters, so that a large number of processed face images can be obtained, and the service platform can generate a sample set by taking the processed face images and the basic face images as sample face images. Of course, the service platform may also determine the target processing parameters in other manners, and the service platform may determine the image processing parameters according to normal distribution, uniform distribution, and the like for each image processing manner, and then arbitrarily combine the image processing parameters of different image processing manners to obtain a plurality of target processing parameters.
For another example, the service platform may further generate a face image with a set occlusion on the face through a trained sample generation model, use the face image as a basic face image, perform target detection on the basic face image, detect an image area where the set occlusion is located in the basic face image, use the image area as a first image area, perform color transformation on the first image area to obtain a processed face image, and use the processed face image and the basic face image as sample face images to generate a sample set. If the mask is set, the service platform can detect a first image area where the mask is located in the basic face image, perform color conversion on the first image area, and convert the color in the first image area into blue if the image in the first image area is white.
It should be noted that, the recognition model can determine whether the set occlusion object exists on the face of the human face in the human face image, and also can determine whether the set occlusion object covers the set target object in the face of the human face. If the recognition model needs to judge whether the set occlusion object covers the set target object in the face (for example, whether the mask covers the mouth and nose) normally, the service platform needs to adjust the training sample according to the situation, wherein the set target object mentioned here may be mouth, nose, etc.
Based on the method, the business platform generates a model through a trained sample to generate a face image with a set obstruction on the face, the face image is used as a basic face image, the set obstruction can be recognized from the basic face image, the position of the image of the set obstruction in the basic face image is adjusted to obtain an adjusted face image, and the adjusted face image and the basic face image are used as sample face images to generate a sample set.
The method for adjusting the position of the image of the set obstruction in the basic face image can be various. For example, the service platform may move the image with the set occlusion object downward in the basic face image to set a pixel value, and then complete the vacant image after the occlusion object is moved and set in the basic face image. If the business platform moves the mask image downwards by 30 pixels in the basic face image, and a part of pixels are left in the basic face image and do not have any image, and the part of pixels are the images of the nose and the skin, the business platform can complete the image of the part of pixels, so that the adjusted face image is the image of the face without a standard mask.
For another example, the service platform may also remove an image of the setting obstruction included in the basic face image, and complement the image of the setting target object in the basic face image from which the setting obstruction is removed to obtain a supplemented face image, and then the service platform may determine an image area of the setting target object in the supplemented face image, as the second image area, and determine other image areas adjacent to the second image area. The service platform may add the image with the set occlusion in the complemented face image according to the other image areas and the boundary of the set occlusion in the basic face image, to obtain the adjusted face image, as shown in fig. 3.
Fig. 3 is a schematic diagram of an adjusted face image provided in this specification.
In fig. 3, the face image after adjustment and the target object of setting the nose are described by taking the mask as an example, and it should be noted that fig. 3 is only an example, and the base face image, the face sample image, and the like in this specification are all real face images in practical application. The leftmost image in fig. 3 is a basic face image, the service platform needs to remove a mask image in the basic face image and complete the basic face image to obtain a complete face image, the service platform may only complete an image of a nose in the basic face image or complete all image regions that are vacant, the service platform may identify an image region where the nose in the complete face image is located as a second image region, and after determining other image regions adjacent to the lower side of the second image region, the mask image may be added to the other image regions. In fig. 3, only the nose is used as the setting target object, but the setting target object may be the mouth, that is, an image region where the mouth is located in the completed face image may be recognized as the second image region, another image region adjacent to the lower side of the second image region may be identified, and the mask image may be added to the other image region.
As can be seen from the above description, the adjusted face image is an image in which the setting cover does not cover the setting target object in the face portion, and the base face image is an image in which the setting cover covers the setting target object in the face portion, so that the adjusted face image and the base face image can be used together as a sample face image in a sample set to train a recognition model for determining whether the setting cover covers the setting target object in the face portion.
Specifically, the annotation information corresponding to the adjusted face image indicates that the setting blocking object does not cover the setting target object of the face, and the basic face image indicates that the setting blocking object covers the setting target object of the face. The service platform takes the adjusted face image and the basic face image as sample face images, generates a sample set, and inputs the sample face images into an identification model for each sample face image to obtain an identification result, wherein the identification result can be used for indicating whether a set occlusion object in the sample face images covers a set target object of the face in the sample face images, and the service platform needs to train the identification model by taking the deviation between the minimum identification result and the labeling information corresponding to the sample face images as an optimization target.
In practical application, the recognition model can determine whether a person in the face image wears a mask or whether the mask worn by the person in the face image covers the mouth and nose in a standard manner according to the input face image. Therefore, the mask is applied to an actual scene, if the business platform determines that a person needing to wear the mask does not wear the mask through the recognition model, the person can be reminded of wearing the mask through modes such as voice reminding and character reminding, if the business platform determines that the person needing to wear the mask does not cover the mouth and the nose with the mask in a standard mode through the recognition model, the person can be reminded of moving the mask to a position capable of covering the mouth and the nose through modes such as voice reminding and character reminding.
According to the method, a large number of sample face images with the set shielding object on the face can be determined through the sample generation model and used as training samples to train the recognition model for judging whether the set shielding object exists in the face images, and in the method, the service platform can further adjust the generated sample face images, so that the adjusted images can also be used as the training samples for judging the recognition model whether the set target object in the face images is completely shielded by the set shielding object.
Based on the same idea, the present specification further provides a corresponding model training apparatus, as shown in fig. 4.
Fig. 4 is a schematic diagram of a model training apparatus provided in this specification, which specifically includes:
an obtaining module 401, configured to obtain a real face image, where the real face image is a face image of a real photographed face with a set occlusion;
a generating module 402, configured to generate a target image through a preset sample generation model, where the target image is a face image in which a set obstruction exists on a face generated by the sample generation model;
a judging module 403, configured to input the target image and the real face image into a preset judging model, and obtain a judging result used for representing a similarity degree between the target image and the real face image;
an optimizing module 404, configured to train the sample generation model by taking maximizing a similarity degree between the target image and the real face image in the determination result as an optimization target.
Optionally, the apparatus further comprises:
a training module 405, configured to generate a sample set through the trained sample generation model, where the sample set includes a sample face image in which the set occlusion exists on a face generated by the trained sample generation model; inputting the sample face image into a preset identification model aiming at each sample face image contained in the sample set to obtain an identification result; and training the recognition model according to the recognition result, wherein the recognition model is used for judging whether the set occlusion exists on the face according to the input face image.
Optionally, the training module 405 is specifically configured to generate, through the trained sample generation model, a face image of a face with the set occlusion as a basic face image; determining image processing parameters corresponding to each image processing mode as target processing parameters, wherein the image processing mode comprises at least one of brightness adjustment, fuzzy processing and rotation transformation processing; performing image processing on the basic face image according to the target processing parameters to obtain a processed face image; and taking the processed face image and the basic face image as sample face images to generate the sample set.
Optionally, the training module 405 is specifically configured to generate, through the trained sample generation model, a face image of a face with the set occlusion as a basic face image; carrying out target detection on the basic face image, and detecting an image area where the set occlusion object is located in the basic face image as a first image area; performing color transformation on the first image area to obtain a processed face image; and taking the processed face image and the basic face image as sample face images to generate the sample set.
Optionally, the training module 405 is specifically configured to generate, through the trained sample generation model, a face image of a face with the set occlusion as a basic face image; identifying the set occlusion from the basic face image; adjusting the position of the image of the set shielding object in the basic face image to obtain an adjusted face image; and taking the adjusted face image and the basic face image as sample face images to generate the sample set.
Optionally, the training module 405 is specifically configured to remove the image of the set obstruction included in the basic face image, and complement the image of the set target object in the basic face image from which the set obstruction is removed, so as to obtain a supplemented face image; determining an image area of the set target object in the completed face image as a second image area, and determining other image areas adjacent to the second image area; and adding the image of the set occlusion object in the supplemented face image according to the other image areas and the boundary of the set occlusion object in the basic face image to obtain an adjusted face image.
Optionally, the training module 405 is specifically configured to input the sample face image into a preset recognition model to obtain a recognition result, where the recognition result is used to indicate whether the set occlusion object in the sample face image covers the set target object of the face in the sample face image.
Optionally, the face image of the face with the set obstruction is the face image of the wearing mask.
The present specification also provides a computer-readable storage medium having stored thereon a computer program, the computer program being operable to perform the method of model training illustrated in fig. 1 described above.
This specification also provides a schematic block diagram of the electronic device shown in fig. 5. As shown in fig. 5, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads a corresponding computer program from the non-volatile memory into the memory and then runs the computer program to implement the model training method described in fig. 1. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (11)

1. A method of model training, comprising:
acquiring a real face image, wherein the real face image is a face image of a real shot face with a set occlusion;
generating a target image through a preset sample generation model, wherein the target image is a human face image which is generated by the sample generation model and has a set obstruction;
inputting the target image and the real face image into a preset discrimination model to obtain a discrimination result for representing the similarity degree between the target image and the real face image;
and training the sample generation model by taking the maximum similarity degree between the target image and the real face image in the discrimination result as an optimization target.
2. The method of claim 1, wherein the method further comprises:
generating a sample set through the trained sample generation model, wherein the sample set comprises a sample face image of the set occlusion object on the face generated by the trained sample generation model;
inputting the sample face image into a preset identification model aiming at each sample face image contained in the sample set to obtain an identification result;
and training the recognition model according to the recognition result, wherein the recognition model is used for judging whether the set occlusion exists on the face according to the input face image.
3. The method of claim 2, wherein generating a sample set through the trained sample generation model specifically comprises:
generating a human face image with the set occlusion object on the human face through the trained sample generation model, and taking the human face image as a basic human face image;
determining image processing parameters corresponding to each image processing mode as target processing parameters, wherein the image processing mode comprises at least one of brightness adjustment, fuzzy processing and rotation transformation processing;
performing image processing on the basic face image according to the target processing parameters to obtain a processed face image;
and taking the processed face image and the basic face image as sample face images to generate the sample set.
4. The method of claim 2, wherein generating a sample set through the trained sample generation model specifically comprises:
generating a human face image with the set occlusion object on the human face through the trained sample generation model, and taking the human face image as a basic human face image;
carrying out target detection on the basic face image, and detecting an image area where the set occlusion object is located in the basic face image as a first image area;
performing color transformation on the first image area to obtain a processed face image;
and taking the processed face image and the basic face image as sample face images to generate the sample set.
5. The method of claim 2, wherein generating a sample set through the trained sample generation model specifically comprises:
generating a human face image with the set occlusion object on the human face through the trained sample generation model, and taking the human face image as a basic human face image;
identifying the set occlusion from the basic face image;
adjusting the position of the image of the set shielding object in the basic face image to obtain an adjusted face image;
and taking the adjusted face image and the basic face image as sample face images to generate the sample set.
6. The method according to claim 5, wherein adjusting the position of the image of the set occlusion in the base face image to obtain an adjusted face image specifically comprises:
removing the image of the set shielding object contained in the basic face image, and completing the image of the set target object in the basic face image from which the set shielding object is removed to obtain a completed face image;
determining an image area of the set target object in the completed face image as a second image area, and determining other image areas adjacent to the second image area;
and adding the image of the set occlusion object in the supplemented face image according to the other image areas and the boundary of the set occlusion object in the basic face image to obtain an adjusted face image.
7. The method according to claim 5 or 6, wherein for each sample face image contained in the sample set, inputting the sample face image into a preset recognition model to obtain a recognition result, specifically comprising:
and inputting the sample face image into a preset identification model to obtain an identification result, wherein the identification result is used for indicating whether the set occlusion object in the sample face image covers the set target object of the face in the sample face image.
8. The method according to any one of claims 1 to 7, wherein the face image of the face with the set obstruction is the face image of a wearer wearing a mask.
9. An apparatus for model training, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a real face image, and the real face image is a face image of a real shot face with a set occlusion;
the generating module is used for generating a target image through a preset sample generating model, wherein the target image is a human face image with a set obstruction on a human face generated by the sample generating model;
the judging module is used for inputting the target image and the real face image into a preset judging model to obtain a judging result for expressing the similarity degree between the target image and the real face image;
and the optimization module is used for training the sample generation model by taking the maximum similarity degree between the target image and the real face image in the judgment result as an optimization target.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1 to 8.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 8 when executing the program.
CN202110121077.4A 2021-01-28 2021-01-28 Model training method and device Pending CN112766208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110121077.4A CN112766208A (en) 2021-01-28 2021-01-28 Model training method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110121077.4A CN112766208A (en) 2021-01-28 2021-01-28 Model training method and device

Publications (1)

Publication Number Publication Date
CN112766208A true CN112766208A (en) 2021-05-07

Family

ID=75706507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110121077.4A Pending CN112766208A (en) 2021-01-28 2021-01-28 Model training method and device

Country Status (1)

Country Link
CN (1) CN112766208A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609481A (en) * 2017-08-14 2018-01-19 百度在线网络技术(北京)有限公司 The method, apparatus and computer-readable storage medium of training data are generated for recognition of face
CN108205659A (en) * 2017-11-30 2018-06-26 深圳市深网视界科技有限公司 Face occluder removes and its method, equipment and the medium of model construction
WO2020015477A1 (en) * 2018-07-16 2020-01-23 阿里巴巴集团控股有限公司 Face recognition method and terminal device
CN111353514A (en) * 2018-12-20 2020-06-30 马上消费金融股份有限公司 Model training method, image recognition method, device and terminal equipment
CN111523480A (en) * 2020-04-24 2020-08-11 北京嘀嘀无限科技发展有限公司 Method and device for detecting face obstruction, electronic equipment and storage medium
CN111553333A (en) * 2020-07-10 2020-08-18 支付宝(杭州)信息技术有限公司 Face image recognition model training method, recognition method, device and electronic equipment
CN111738988A (en) * 2020-06-02 2020-10-02 北京三快在线科技有限公司 Face depth image generation method and device, electronic equipment and storage medium
CN111860566A (en) * 2020-04-24 2020-10-30 北京嘀嘀无限科技发展有限公司 Method and device for training occlusion recognition model and storage medium
CN111881770A (en) * 2020-07-06 2020-11-03 上海序言泽网络科技有限公司 Face recognition method and system
CN111914628A (en) * 2020-06-19 2020-11-10 北京百度网讯科技有限公司 Training method and device of face recognition model
CN111985281A (en) * 2019-05-24 2020-11-24 内蒙古工业大学 Image generation model generation method and device and image generation method and device
CN112115818A (en) * 2020-09-01 2020-12-22 燕山大学 Mask wearing identification method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609481A (en) * 2017-08-14 2018-01-19 百度在线网络技术(北京)有限公司 The method, apparatus and computer-readable storage medium of training data are generated for recognition of face
CN108205659A (en) * 2017-11-30 2018-06-26 深圳市深网视界科技有限公司 Face occluder removes and its method, equipment and the medium of model construction
WO2020015477A1 (en) * 2018-07-16 2020-01-23 阿里巴巴集团控股有限公司 Face recognition method and terminal device
CN111353514A (en) * 2018-12-20 2020-06-30 马上消费金融股份有限公司 Model training method, image recognition method, device and terminal equipment
CN111985281A (en) * 2019-05-24 2020-11-24 内蒙古工业大学 Image generation model generation method and device and image generation method and device
CN111523480A (en) * 2020-04-24 2020-08-11 北京嘀嘀无限科技发展有限公司 Method and device for detecting face obstruction, electronic equipment and storage medium
CN111860566A (en) * 2020-04-24 2020-10-30 北京嘀嘀无限科技发展有限公司 Method and device for training occlusion recognition model and storage medium
CN111738988A (en) * 2020-06-02 2020-10-02 北京三快在线科技有限公司 Face depth image generation method and device, electronic equipment and storage medium
CN111914628A (en) * 2020-06-19 2020-11-10 北京百度网讯科技有限公司 Training method and device of face recognition model
CN111881770A (en) * 2020-07-06 2020-11-03 上海序言泽网络科技有限公司 Face recognition method and system
CN111553333A (en) * 2020-07-10 2020-08-18 支付宝(杭州)信息技术有限公司 Face image recognition model training method, recognition method, device and electronic equipment
CN112115818A (en) * 2020-09-01 2020-12-22 燕山大学 Mask wearing identification method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
魏?等: "生成对抗网络进行感知遮挡人脸还原的算法研究", 《小型微型计算机系统》 *

Similar Documents

Publication Publication Date Title
CN107358157B (en) Face living body detection method and device and electronic equipment
CN112800997B (en) Living body detection method, device and equipment
CN111553333B (en) Face image recognition model training method, recognition method, device and electronic equipment
CN110688939B (en) Method, system and equipment for verifying certificate image to be identified
CN112801229A (en) Training method and device for recognition model
CN111340014B (en) Living body detection method, living body detection device, living body detection apparatus, and storage medium
CN109816650B (en) Target area identification method and system based on two-dimensional DSA image
CN111738161B (en) Living body detection method and device and electronic equipment
CN114332873A (en) Training method and device for recognition model
CN112464827A (en) Mask wearing identification method, device, equipment and storage medium
CN112766208A (en) Model training method and device
CN112949642B (en) Character generation method and device, storage medium and electronic equipment
CN112560530B (en) Two-dimensional code processing method, device, medium and electronic device
CN115830690A (en) Traffic image desensitization method and equipment
CN115018866A (en) Boundary determining method and device, storage medium and electronic equipment
CN110866478B (en) Method, device and equipment for identifying object in image
CN114549823A (en) Image acquisition reminding processing method and device
KR20140134844A (en) Method and device for photographing based on objects
CN111539962A (en) Target image classification method, device and medium
CN111539961A (en) Target segmentation method, device and equipment
CN112927219B (en) Image detection method, device and equipment
CN117197781B (en) Traffic sign recognition method and device, storage medium and electronic equipment
CN111426299B (en) Method and device for ranging based on depth of field of target object
CN114973426B (en) Living body detection method, device and equipment
CN114528923B (en) Video target detection method, device, equipment and medium based on time domain context

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210507

WD01 Invention patent application deemed withdrawn after publication