CN114550264A - Model training method, face recognition device, face recognition equipment and face recognition medium - Google Patents

Model training method, face recognition device, face recognition equipment and face recognition medium Download PDF

Info

Publication number
CN114550264A
CN114550264A CN202210179702.5A CN202210179702A CN114550264A CN 114550264 A CN114550264 A CN 114550264A CN 202210179702 A CN202210179702 A CN 202210179702A CN 114550264 A CN114550264 A CN 114550264A
Authority
CN
China
Prior art keywords
image
feature extraction
extraction model
original image
information
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
CN202210179702.5A
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210179702.5A priority Critical patent/CN114550264A/en
Publication of CN114550264A publication Critical patent/CN114550264A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/217Validation; Performance evaluation; Active pattern learning techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure provides a model training method, a face recognition device, a face recognition apparatus and a medium, which relate to the technical field of artificial intelligence such as deep learning and computer vision, and can be applied to scenes such as face image processing and face recognition. The implementation scheme is as follows: acquiring a first sample image corresponding to the original image, wherein the first sample image lacks part of information in the original image; inputting the first sample image into a first feature extraction model to obtain first feature information of the original image; inputting the first characteristic information into an image reconstruction model to obtain a reconstructed image corresponding to the original image; and adjusting parameters of the first feature extraction model based on the original image and the reconstructed image.

Description

Model training method, face recognition device, face recognition equipment and medium
Technical Field
The present disclosure relates to the technical field of artificial intelligence, such as deep learning and computer vision, and may be applied to scenes, such as face image processing and face recognition, and in particular, to a method for model training, a method for image feature extraction, a method for face recognition, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. The artificial intelligence hardware technology generally comprises technologies such as a sensor, a special artificial intelligence chip, cloud computing, distributed storage, big data processing and the like, and the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge graph technology and the like.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, unless otherwise indicated, the problems mentioned in this section should not be considered as having been acknowledged in any prior art.
Disclosure of Invention
The present disclosure provides a method of model training, a method of image feature extraction, a method of face recognition, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to an aspect of the present disclosure, there is provided a model training method, including: acquiring a first sample image corresponding to the original image, wherein the first sample image lacks part of information in the original image; inputting the first sample image into a first feature extraction model to obtain first feature information of the original image; inputting the first characteristic information into an image reconstruction model to obtain a reconstructed image corresponding to the original image; and adjusting parameters of the first feature extraction model based on the original image and the reconstructed image.
According to an aspect of the present disclosure, there is provided an image feature extraction method including: and inputting the image to be processed into a feature extraction model to obtain the feature information of the image to be processed, wherein the feature extraction model is obtained by training according to the training method.
According to an aspect of the present disclosure, there is provided a face recognition method, including: inputting an image to be recognized containing a human face into a feature extraction model to obtain feature information of the image to be recognized, wherein the feature extraction model is obtained by training according to the method; and inputting the characteristic information into the recognition model to obtain a recognition result of the human face.
According to an aspect of the present disclosure, there is provided a model training apparatus including: a first acquisition unit configured to acquire a first sample image corresponding to an original image, wherein the first sample image lacks partial information in the original image; a second obtaining unit, configured to input the first sample image into the first feature extraction model to obtain first feature information of the original image; a third obtaining unit, configured to input the first feature information into an image reconstruction model to obtain a reconstructed image corresponding to the original image; and a first adjusting unit configured to adjust parameters of the first feature extraction model based on the original image and the reconstructed image.
According to an aspect of the present disclosure, a feature extraction model is provided, wherein the feature extraction model is capable of obtaining feature information of an image to be processed according to an input image to be processed, and the feature extraction model is obtained by training according to the training method.
According to an aspect of the present disclosure, there is provided a face recognition apparatus including: the characteristic extraction model is configured for responding to the received image to be recognized containing the human face and obtaining the characteristic information of the image to be recognized, wherein the characteristic extraction model is obtained by training according to the training method; and the recognition model is configured to respond to the received characteristic information to obtain a recognition result of the human face.
According to an aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform any one of the methods described above.
According to an aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform any one of the methods described above.
According to an aspect of the disclosure, a computer program product is provided, comprising a computer program, wherein the computer program realizes any of the above methods when executed by a processor.
According to one or more embodiments of the present disclosure, the robustness of the feature extraction model can be improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, according to an embodiment of the present disclosure;
FIG. 2 shows a flow diagram of a model training method according to an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of a model training method according to an embodiment of the present disclosure;
FIG. 4 illustrates a flow chart of a method of face recognition according to an exemplary embodiment of the present disclosure;
FIG. 5 shows a block diagram of a model training apparatus according to an exemplary embodiment of the present disclosure;
fig. 6 is a block diagram illustrating a structure of a face recognition apparatus according to an exemplary embodiment of the present disclosure; and
FIG. 7 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, unless otherwise specified, the use of the terms "first", "second", and the like to describe various elements is not intended to limit the positional relationship, the temporal relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
In the field of artificial intelligence, processing of images often begins with the extraction of feature information. The effective characteristic information can represent key contents in the image, the reconstruction of the image can be realized by depending on the characteristic information extracted from the image, and the development of a downstream image processing task is supported.
In the related art, in order to train an image feature extraction model, model training is performed using conventional sample images, which are obtained from various channels, and most of which have good image quality and complete image information. However, in practical applications, image quality is often difficult to guarantee due to a series of interference factors such as environment, shooting angle, and occlusion. In the face of these low-quality images, it is difficult for the feature extraction model to capture effective feature information from the low-quality images, and the output result cannot meet the downstream application requirements, even results in erroneous processing results.
Based on the above, the present disclosure provides a model training method, which performs training on a first sample image lacking partial information in an original image, extracts first feature information from the incomplete first sample image through a first feature extraction model, performs image reconstruction on the extracted first feature information by using an image reconstruction model, and finally adjusts parameters of the first feature extraction model based on the original image and the reconstructed image.
Based on the model training method, the first feature extraction model can extract feature information which can be used for representing the original image from the incomplete first sample image by taking the reconstructed original image as a target, in other words, the first feature extraction model can learn which feature information is critical for representing the original image and take the feature information as an output result. The first feature extraction model obtained by training in the way can have good robustness, and even if the input image with poor quality is faced in practical application, effective feature information used for representing the original image can be distinguished and extracted, and execution of downstream application based on the image feature information is supported.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented in accordance with embodiments of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In embodiments of the present disclosure, the server 120 may run one or more services or software applications that enable a method of any one of a model training method, an image feature extraction method, and a face recognition method to be performed. In some embodiments, the server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In certain embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof, which may be executed by one or more processors. A user operating a client device 101, 102, 103, 104, 105, and/or 106 may, in turn, utilize one or more client applications to interact with the server 120 to take advantage of the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from system 100. Accordingly, fig. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may use the client devices 101, 102, 103, 104, 105, and/or 106 to acquire and/or transmit the image to be processed and the image to be recognized. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that any number of client devices may be supported by the present disclosure.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and so forth. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various Mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular telephones, smart phones, tablets, Personal Digital Assistants (PDAs), and the like. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. The gaming system may include a variety of handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), Short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture involving virtualization (e.g., one or more flexible pools of logical storage that may be virtualized to maintain virtual storage for the server). In various embodiments, the server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
In some implementations, the server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of the client devices 101, 102, 103, 104, 105, and/or 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and/or 106.
In some embodiments, the server 120 may be a server of a distributed system, or a server incorporating a blockchain. The server 120 may also be a cloud server, or a smart cloud computing server or a smart cloud host with artificial intelligence technology. The cloud Server is a host product in a cloud computing service system, and is used for solving the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The database 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The database 130 may be of different types. In certain embodiments, the database used by the server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to the command.
In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key-value stores, object stores, or regular stores supported by a file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
Fig. 2 shows a flowchart of a model training method, according to an exemplary embodiment of the present disclosure, the method 200 comprising: step S201, acquiring a first sample image corresponding to an original image, wherein the first sample image lacks part of information in the original image; step S202, inputting a first sample image into a first feature extraction model to obtain first feature information of the original image; step S203, inputting the first characteristic information into an image reconstruction model to obtain a reconstructed image corresponding to the original image; and step S204, adjusting parameters of the first feature extraction model based on the original image and the reconstructed image.
Therefore, the first feature extraction model can learn to extract feature information capable of representing the original image from the incomplete first sample image by taking the reconstructed original image as a target, in other words, the first feature extraction model can learn which feature information is critical to representing the original image and takes the feature information as an extraction result. The first feature extraction model obtained by training in this way can have good robustness, and even if the input image with poor quality is faced in practical application, effective feature information which can be used for representing the original image can be distinguished and extracted, and the execution of downstream application can be supported.
According to some embodiments, the original image includes a human face. Thus, the first feature extraction model can learn the ability to reconstruct a face from an incomplete first sample image based on any of the training methods in this disclosure. Even if in practical application, the human face in the input image to be recognized has the conditions of shielding, incomplete shooting, light interference and the like, the feature information for reconstructing the human face can be extracted from the human face, and further the applications of downstream human face reconstruction, human face recognition and the like are supported.
It should be noted that the image to be recognized including the face in this embodiment is from a public data set, where the face is not a face of a specific user, and cannot reflect personal information of a specific user.
With respect to step S201, according to some embodiments, acquiring a first sample image corresponding to the original image may include: dividing an original image into a plurality of parts; and acquiring a first sample image by removing at least one of the plurality of portions.
In actual shooting, there is a case where an object in a shot image is incomplete due to a problem of a shooting angle or the like. For example, only a part of a face of a person is included in the person image due to a problem of the shooting angle. In the training process, at least one part of a plurality of parts of an original image is removed to obtain a first sample image, and training is performed according to the first sample image, so that the condition that the object is incomplete in actual shooting can be simulated, the first feature extraction model can learn to extract effective information capable of reconstructing the object from the image in the training process, and the robustness of the first feature extraction model is improved.
In one embodiment, the rasterization operation may be performed on the original image, that is, the original image is uniformly divided into N × N grids, and the first sample image is acquired by randomly discarding a first preset proportion of the N × N grids. It will be appreciated that the first preset proportion of the grid discarded is located differently for different original images.
According to some embodiments, acquiring the first sample image corresponding to the original image may further comprise: a first sample image is acquired by superimposing an occlusion on the original image.
In actual shooting, a partial region of a shot image may be blocked by an obstruction. For example, when an image of a person is captured, the person wears a mask, which blocks the face of the person. In the training process, the first sample image is obtained by overlapping the shielding object on the original image, and training is performed according to the first sample image, so that the condition that the image in actual shooting is shielded can be simulated, the capability of the first feature extraction model for extracting effective feature information from the image can be learned in the training process, and the robustness of the first feature extraction model is improved.
After the first sample image for training is obtained through step S201, step S202 is executed, that is, the first sample image is input into the first feature extraction model to obtain first feature information of the original image extracted by the first feature extraction model.
After the first feature information of the original image is obtained through step S202, step S203 is performed to cause the image reconstruction model to reconstruct the original image based on the first feature information.
With respect to step S204, after obtaining the reconstructed image, a reconstruction loss function may be constructed from the original image and the reconstructed image, and a reverse derivation may be performed based on the reconstruction loss function to adjust parameters of the first feature extraction model. Therefore, the first feature extraction model can gradually learn the capability of extracting feature information used for reconstructing an original image from a first sample image with poor quality in the training process.
It can be understood that, in the process of adjusting the parameters of the first feature extraction model, the parameters of the image reconstruction model are also adjusted synchronously, that is, in the training process, the feature extraction capability of the first feature extraction model and the image reconstruction capability of the image reconstruction model can be synchronously improved.
According to some embodiments, the method may further comprise: acquiring a second sample image corresponding to the original image, wherein the second sample image lacks part of information in the original image and is different from the first sample image; inputting the second sample image into a second feature extraction model to obtain second feature information of the original image; and adjusting parameters of the first feature extraction model based on a similarity between the first feature information and the second feature information and a similarity between the first feature information and each of a plurality of third feature information, wherein each of the plurality of third feature information is feature information of other images different from the original image. In this way, the feature information extracted by the trained first feature extraction model not only can realize reconstruction of the original image, but also can distinguish the original image from other images.
The second feature information and the first feature information are feature information from the same image, namely an original image, and the third feature information and the first feature information are feature information from different images. Therefore, the higher the similarity between the first feature information and the second feature information extracted by the first feature extraction model is, and the lower the similarity between the first feature information and the third feature information is, the stronger the ability of the first feature extraction model to distinguish different images is.
In one embodiment, the original image may be rasterized, i.e., the original image is uniformly divided into N × N grids, and the second sample image is obtained by randomly discarding a second predetermined proportion of the N × N grids. It will be appreciated that the position of the discarded second predetermined proportion of the grid is different for different original images.
In particular, in a case where the first sample image is obtained by randomly discarding a grid of a first preset proportion among the N × N grids, the first preset proportion and the second preset proportion are different, that is, the second sample image and the first sample image are images from the same original image and having different degrees of information loss. Therefore, the learning difficulty of the first feature extraction model can be improved, so that when the trained first feature extraction model faces original images with different degrees of information loss, feature information capable of representing the original images in a differentiated mode can be extracted from the trained first feature extraction model, and the feature information of the original images can be distinguished from feature information of other images.
According to some embodiments, adjusting the parameter of the first feature extraction model based on the similarity between the first feature information and the second feature information and the similarity between the first feature information and each of the plurality of third feature information may include: constructing a contrast loss function based on a similarity between the first feature information and the second feature information and a similarity between the first feature information and each of the plurality of third feature information; and adjusting parameters of the first feature extraction model based on the contrast loss function.
In one embodiment, the contrast loss function may be expressed as follows:
Figure BDA0003521962720000101
where loss represents the contrast loss function, exp (F1F 3)+) F1 represents first feature information, F3, as a similarity value between the first feature information and the second feature information+Represents the second feature information, Σ exp (F1 × F3)-) Indicates the sum of the degrees of similarity between the first feature information and each of the plurality of third feature information, exp (F1F 3)-) As a similarity value between the first feature information and the third feature information, F3-Indicating the third characteristic information.
Based on the contrast loss function, the parameters of the first feature extraction model are reversely derived, so that the first feature extraction model can gradually learn the capability of distinguishing different images under the condition of facing the images with information loss.
According to some embodiments, the model training method has been performed a plurality of times based on a plurality of historical images before being performed based on the above-described raw images. Each of the plurality of third feature information is feature information corresponding to each of the plurality of history images.
In one embodiment, for each of a plurality of history images, a third sample image corresponding to the history image is obtained, wherein the third sample image lacks part of information in the history image; and inputting the third sample image into a second feature extraction model to obtain third feature information of the historical image.
In one embodiment, the third feature information corresponding to each of the plurality of history images is stored in advance in a cache (cache) that retains the third feature information of the latest predetermined number of history images based on a first-in-first-out technique. In the case where the parameters of the first feature extraction model need to be adjusted by using a plurality of pieces of third feature information, a required number of pieces of third feature information may be fetched from the cache to perform training of the first feature extraction model.
According to some embodiments, after adjusting the parameters of the first feature extraction model, the parameters of the second feature extraction model may be adjusted based on the parameters of the first feature extraction model.
The parameters of the second feature extraction model are adjusted through the parameters of the first feature extraction model, so that the second feature extraction model inherits the training result of the first feature extraction model, the second feature information obtained in the subsequent training process is more accurate, and the training effect of the first feature extraction model is further improved.
According to some embodiments, in the case where the second feature extraction model has the same structure as the first feature extraction model, the adjusted parameters of the first feature extraction model may be directly superimposed on the parameters of the second feature extraction model with a predetermined weight to adjust the parameters of the second feature extraction model.
In one embodiment, adjusting the parameters of the second feature extraction model based on the parameters of the first feature extraction model may include: the parameters of the second feature extraction model are adjusted using a weighted sum of the parameters of the first feature extraction model and the parameters of the second feature extraction model.
In particular, the parameter adjustment for the second feature extraction model can be expressed by the following formula:
R2=m*r2+(1-m)*R1
where R1 is a parameter of the first feature extraction model, R2 is a parameter of the second feature extraction model before adjustment, R2 is a parameter of the second feature extraction model after adjustment, and m is a predetermined weight for superimposing the parameter R1 of the first feature extraction model. Preferably, m has a value between 0.8 and 0.99.
FIG. 3 shows a schematic diagram of a model training method according to an exemplary embodiment of the present disclosure. As shown in fig. 3, the training of the first feature extraction model may include the following steps:
step S301, obtaining a first sample image corresponding to the original image, wherein the original image may be rasterized, and then a part of grids in the original image are randomly discarded according to a first preset proportion to obtain the first sample image;
step S302, inputting a first sample image into a first feature extraction model to obtain first feature information of an original image output by the first feature extraction model;
step S303, inputting the first characteristic information into an image reconstruction model to obtain a reconstructed image which is output by the image reconstruction model and corresponds to an original image;
step S304, a reconstruction loss function is constructed through the original image and the reconstructed image, and a first feature extraction model is trained through the reconstruction loss function, so that the generated reconstructed image is close to the original image;
step S305, obtaining a second sample image corresponding to the original image, wherein the original image may be rasterized, and then a part of grids in the original image are randomly discarded according to a second preset proportion, so as to obtain the second sample image, where the second preset proportion is different from the first preset proportion;
step S306, inputting the second sample image into a second feature extraction model to obtain second feature information of the original image output by the second feature extraction model; and
step S307, constructing a contrast loss function based on the similarity between the first feature information and the second feature information and the similarity between the first feature information and each of a plurality of third feature information, wherein each of the plurality of third feature information is feature information of other images different from the original image; and training the first feature extraction model through a contrast loss function, so that the first feature information and the second feature information have high similarity, and the first feature information and the third feature information have low similarity.
It is understood that the above steps S301 to S304 and steps S305 to S307 may be performed simultaneously, that is, the first feature extraction model may be trained by the reconstruction loss function and the contrast loss function simultaneously, so that the trained first feature extraction model can extract feature information capable of differentially characterizing an original image from incomplete image information in the original image, the image feature cannot be used for reconstructing the original image, and the original image can be distinguished from other images.
According to an embodiment of the present disclosure, there is also provided an image feature extraction method, including: and inputting the image to be processed into a feature extraction model to obtain the feature information of the image to be processed, wherein the feature extraction model is obtained by training according to any one of the training methods.
The feature extraction model trained by any one of the above training methods can have good robustness, and even if the model is applied to an image to be processed with poor quality in practical application, feature information capable of representing the image to be processed can be extracted, and the feature information can be used for reconstructing the image to be processed, so that execution of downstream application is supported.
Fig. 4 shows a flowchart of a face recognition method according to an exemplary embodiment of the present disclosure, where the method 400 includes: step S401, inputting an image to be recognized including a human face into a feature extraction model to obtain feature information of the image to be recognized, wherein the feature extraction model is obtained by training according to any one of the above training methods; and step S402, inputting the characteristic information into the recognition model to obtain a recognition result of the human face.
The feature extraction model trained by any one of the above training methods has good robustness, and even if the model is applied to an image to be recognized with poor quality in practical application, feature information capable of representing a face in the image to be recognized can be extracted from the image to be recognized, so that the recognition model can accurately recognize the face based on the feature information.
It should be noted that the image to be recognized including the face in this embodiment is from a public data set, where the face is not a face of a specific user, and cannot reflect personal information of a specific user.
Fig. 5 shows a block diagram of a model training apparatus according to an exemplary embodiment of the present disclosure, the apparatus 500 includes: a first acquiring unit 501 configured to acquire a first sample image corresponding to an original image, wherein the first sample image lacks partial information in the original image; a second obtaining unit 502 configured to input the first sample image into the first feature extraction model to obtain first feature information of the original image; a third obtaining unit 503, configured to input the first feature information into an image reconstruction model to obtain a reconstructed image corresponding to the original image; and a first adjusting unit 504 configured to adjust parameters of the first feature extraction model based on the original image and the reconstructed image.
According to some embodiments, the first obtaining unit comprises: a dividing subunit configured to divide an original image into a plurality of parts; and a first acquiring subunit configured to acquire a first sample image by removing at least one of the plurality of portions.
According to some embodiments, the first obtaining unit comprises: a second acquisition subunit configured to acquire the first sample image by superimposing an obstruction on the original image.
According to some embodiments, the apparatus further comprises: a fourth acquiring unit configured to acquire a second sample image corresponding to the original image, wherein the second sample image lacks part of information in the original image and is different from the first sample image; a fifth obtaining unit, configured to input the second sample image into the second feature extraction model to obtain second feature information of the original image; and a second adjusting unit configured to adjust a parameter of the first feature extraction model based on a similarity between the first feature information and the second feature information and a similarity between the first feature information and each of a plurality of third feature information, wherein each of the plurality of third feature information is feature information of other images different from the original image.
According to some embodiments, the apparatus further comprises: a third adjusting unit configured to adjust the parameter of the second feature extraction model based on the parameter of the first feature extraction model after adjusting the parameter of the first feature extraction model.
According to some embodiments, the third adjusting unit comprises: an adjusting subunit configured to adjust the parameter of the second feature extraction model using a weighted sum of the parameter of the first feature extraction model and the parameter of the second feature extraction model.
According to some embodiments, the original image includes a human face. It should be noted that the image to be recognized including the face in this embodiment is from a public data set, where the face is not a face of a specific user, and cannot reflect personal information of a specific user.
According to an embodiment of the present disclosure, a feature extraction model is further provided, where the feature extraction model is capable of obtaining feature information of an image to be processed according to an input image to be processed, and the feature extraction model is obtained by training according to any one of the above training methods.
Fig. 6 shows a block diagram of a face recognition apparatus according to an exemplary embodiment of the present disclosure, where the apparatus 600 includes: the feature extraction model 601 is configured to obtain feature information of an image to be recognized in response to receiving the image to be recognized including a human face, wherein the feature extraction model is obtained by training according to any one of the above training methods; and a recognition model 602 configured to obtain a recognition result of the human face in response to receiving the feature information.
It should be noted that the image to be recognized including the face in this embodiment is from a public data set, where the face is not a face of a specific user, and cannot reflect personal information of a specific user.
According to an embodiment of the present disclosure, there is also provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform any one of the methods described above.
There is also provided, in accordance with an embodiment of the present disclosure, a non-transitory computer-readable storage medium having stored thereon computer instructions for causing a computer to perform any one of the methods described above.
There is also provided, in accordance with an embodiment of the present disclosure, a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements any of the methods described above.
Referring to fig. 7, a block diagram of a structure of an electronic device 700, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the electronic device 700 includes a computing unit 701, which may perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
A number of components in the electronic device 700 are connected to the I/O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the electronic device 700, and the input unit 706 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote controller. Output unit 707 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 708 may include, but is not limited to, magnetic or optical disks. The communication unit 709 allows the electronic device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 performs the respective methods and processes described above, for example, a model training method, an image feature extraction method, or a face recognition method. For example, in some embodiments, the model training method, the image feature extraction method, or the face recognition method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 700 via the ROM 702 and/or the communication unit 709. When loaded into the RAM 703 and executed by the computing unit 701, a computer program may perform one or more steps of the model training method, the image feature extraction method or the face recognition method described above. Alternatively, in other embodiments, the computing unit 701 may be configured to perform a model training method, an image feature extraction method, or a face recognition method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described methods, systems and apparatus are merely exemplary embodiments or examples and that the scope of the present invention is not limited by these embodiments or examples, but only by the claims as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced with equivalent elements that appear after the present disclosure.

Claims (21)

1. A model training method, comprising:
acquiring a first sample image corresponding to an original image, wherein the first sample image lacks part of information in the original image;
inputting the first sample image into a first feature extraction model to obtain first feature information of the original image;
inputting the first characteristic information into an image reconstruction model to obtain a reconstructed image corresponding to the original image; and
adjusting parameters of the first feature extraction model based on the original image and the reconstructed image.
2. The method of claim 1, wherein said acquiring a first sample image corresponding to an original image comprises:
dividing the original image into a plurality of portions; and
acquiring the first sample image by removing at least one of the plurality of portions.
3. The method of claim 1, wherein said acquiring a first sample image corresponding to an original image comprises:
the first sample image is acquired by superimposing an obstruction on the original image.
4. The method of any of claims 1 to 3, further comprising:
acquiring a second sample image corresponding to the original image, wherein the second sample image lacks part of information in the original image and is different from the first sample image;
inputting the second sample image into a second feature extraction model to obtain second feature information of the original image; and
adjusting parameters of the first feature extraction model based on a similarity between the first feature information and the second feature information and a similarity between the first feature information and each of a plurality of third feature information, wherein each of the plurality of third feature information is feature information of other images different from the original image.
5. The method of claim 4, further comprising:
after the adjusting the parameters of the first feature extraction model, the parameters of the second feature extraction model are adjusted based on the parameters of the first feature extraction model.
6. The method of claim 5, wherein said adjusting parameters of the second feature extraction model based on parameters of the first feature extraction model comprises:
adjusting parameters of the second feature extraction model using a weighted sum of the parameters of the first feature extraction model and the parameters of the second feature extraction model.
7. The method of any one of claims 1 to 6, wherein the original image contains a human face.
8. An image feature extraction method, comprising:
inputting an image to be processed into a feature extraction model to obtain feature information of the image to be processed, wherein the feature extraction model is obtained by training according to the method of any one of claims 1 to 7.
9. A face recognition method, comprising:
inputting an image to be recognized containing a human face into a feature extraction model to obtain feature information of the image to be recognized, wherein the feature extraction model is obtained by training according to the method of any one of claims 1 to 7; and
and inputting the characteristic information into a recognition model to obtain a recognition result of the human face.
10. A model training apparatus comprising:
a first acquisition unit configured to acquire a first sample image corresponding to an original image, wherein the first sample image lacks partial information in the original image;
a second obtaining unit, configured to input the first sample image into a first feature extraction model to obtain first feature information of the original image;
a third obtaining unit, configured to input the first feature information into an image reconstruction model to obtain a reconstructed image corresponding to the original image; and
a first adjusting unit configured to adjust parameters of the first feature extraction model based on the original image and the reconstructed image.
11. The apparatus of claim 10, wherein the first obtaining unit comprises:
a dividing subunit configured to divide the original image into a plurality of parts; and
a first acquisition subunit configured to acquire the first sample image by removing at least one of the plurality of portions.
12. The apparatus of claim 10, wherein the first obtaining unit comprises:
a second acquisition subunit configured to acquire the first sample image by superimposing an obstruction on the original image.
13. The apparatus of any of claims 10 to 12, further comprising:
a fourth acquisition unit configured to acquire a second sample image corresponding to the original image, wherein the second sample image lacks part of information in the original image and is different from the first sample image;
a fifth obtaining unit, configured to input the second sample image into a second feature extraction model to obtain second feature information of the original image; and
a second adjusting unit configured to adjust a parameter of the first feature extraction model based on a similarity between the first feature information and the second feature information and a similarity between the first feature information and each of a plurality of third feature information, wherein each of the plurality of third feature information is feature information of other images different from the original image.
14. The apparatus of claim 13, further comprising:
a third adjusting unit configured to adjust parameters of the second feature extraction model based on the parameters of the first feature extraction model after the adjusting of the parameters of the first feature extraction model.
15. The apparatus of claim 14, wherein the third adjusting unit comprises:
an adjusting subunit configured to adjust a parameter of the second feature extraction model using a weighted sum of a parameter of the first feature extraction model and a parameter of the second feature extraction model.
16. The apparatus according to any one of claims 10 to 15, wherein the original image contains a human face.
17. A feature extraction model, wherein the feature extraction model is capable of obtaining feature information of an input image to be processed according to the input image to be processed, and wherein the feature extraction model is trained according to the method of any one of claims 1 to 7.
18. A face recognition apparatus comprising:
the method comprises the steps of obtaining feature information of an image to be recognized in response to the fact that the image to be recognized containing a human face is received, wherein the feature extraction model is obtained by training according to the method of any one of claims 1 to 7; and
and the recognition model is configured to respond to the received characteristic information to obtain a recognition result of the human face.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-9.
21. A computer program product comprising a computer program, wherein the computer program realizes the method of any one of claims 1-9 when executed by a processor.
CN202210179702.5A 2022-02-25 2022-02-25 Model training method, face recognition device, face recognition equipment and face recognition medium Pending CN114550264A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210179702.5A CN114550264A (en) 2022-02-25 2022-02-25 Model training method, face recognition device, face recognition equipment and face recognition medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210179702.5A CN114550264A (en) 2022-02-25 2022-02-25 Model training method, face recognition device, face recognition equipment and face recognition medium

Publications (1)

Publication Number Publication Date
CN114550264A true CN114550264A (en) 2022-05-27

Family

ID=81679794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210179702.5A Pending CN114550264A (en) 2022-02-25 2022-02-25 Model training method, face recognition device, face recognition equipment and face recognition medium

Country Status (1)

Country Link
CN (1) CN114550264A (en)

Similar Documents

Publication Publication Date Title
CN112749685B (en) Video classification method, apparatus and medium
CN114612749A (en) Neural network model training method and device, electronic device and medium
CN114445667A (en) Image detection method and method for training image detection model
CN113256583A (en) Image quality detection method and apparatus, computer device, and medium
CN115393514A (en) Training method of three-dimensional reconstruction model, three-dimensional reconstruction method, device and equipment
CN114140547B (en) Image generation method and device
CN115578501A (en) Image processing method, image processing device, electronic equipment and storage medium
CN114494797A (en) Method and apparatus for training image detection model
CN114547252A (en) Text recognition method and device, electronic equipment and medium
CN115601555A (en) Image processing method and apparatus, device and medium
CN114998963A (en) Image detection method and method for training image detection model
CN114550264A (en) Model training method, face recognition device, face recognition equipment and face recognition medium
CN114429678A (en) Model training method and device, electronic device and medium
CN115512131B (en) Image detection method and training method of image detection model
CN113793290B (en) Parallax determining method, device, equipment and medium
CN114120420B (en) Image detection method and device
CN115423827B (en) Image processing method, image processing device, electronic equipment and storage medium
CN113627330B (en) Method and device for identifying target type dynamic image and electronic equipment
CN114882571A (en) Method for acquiring image information and method for training image detection model
CN114758114A (en) Model updating method, image processing method, device, electronic device and medium
CN114511757A (en) Method and apparatus for training image detection model
CN114550269A (en) Mask wearing detection method, device and medium
CN113920304A (en) Sample image processing method, sample image processing device, electronic device, and medium
CN114842297A (en) Image processing method, model training method, device, equipment and medium
CN116563078A (en) Image processing method, device, equipment and medium

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