A training method for face quality enhancement model, image search method and device

By constructing training data and initial training models for multiple face image pairs, the face quality enhancement model is trained, which solves the problem of inaccurate search for small face images and significantly improves the accuracy of search results.

CN114020951BActive Publication Date: 2024-08-23BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010692159.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-17
Publication Date
2024-08-23
Estimated Expiration
2040-07-17

AI Technical Summary

Technical Problem

It is difficult to obtain accurate search results when performing image search on small face images with the existing technology, and it is difficult for existing face quality enhancement methods to fit real scenes, resulting in poor search results.

Method used

By constructing training data and an initial training model, it contains multiple face picture pairs. Each picture pair contains a first face picture and a second face picture. The resolution level of the second face picture is higher than that of the first face picture. , a face quality enhancement model is trained to enhance the quality of small face images.

Benefits of technology

The accuracy of search results for small face pictures is significantly improved, the problem of difficulty in obtaining accurate search results in the existing technology is solved, and the quality of small face pictures is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020951B
    Figure CN114020951B
Patent Text Reader

Abstract

The present invention discloses a training method for a face quality enhancement model, comprising: constructing training data, the training data comprising a plurality of face picture pairs, each face picture pair comprising a first face picture and a second face picture, and the resolution level of the second face picture being higher than that of the first face picture; constructing an initial training model, the initial training model having N input terminals and N output terminals; for each face picture pair in the training data, selecting a target input terminal corresponding to the resolution level of the first face picture, and selecting a target output terminal corresponding to the resolution level of the second face picture; using the first face picture as an input of the target input terminal and the second face picture as an output of the target output terminal, so as to train the initial training model and obtain a face quality enhancement model. The present invention can enhance the quality of small face pictures, and when performing picture search on the small face pictures, can significantly improve the accuracy of search results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image search technology, and in particular to a training method for a face quality enhancement model, an image search method and a device. Background Art

[0002] When searching for face images, users generally upload a search image containing a face image and initiate a search request (i.e., Query). The image search engine searches for related images on the Internet based on the search image. At the same time, the image search engine can also identify the identity of the person in the search image (e.g., name).

[0003] If the face image size in the search image is too small (called "small face"), it will be difficult for the image search engine to extract enough features from the search image, and the performance of the image search engine will be affected, and it will not be able to obtain accurate search results. In this case, it is necessary to enhance the face quality of the search image.

[0004] However, the current face quality enhancement methods are difficult to fit the real scene. When searching for small face images, the search effect is still poor and the accuracy of the search results is not high. Summary of the invention

[0005] The embodiments of the present invention solve the technical problem in the prior art that it is difficult to obtain accurate search results when performing image searches on small face images by providing a training method for a face quality enhancement model, an image search method and a device, thereby achieving the technical effect of significantly improving the accuracy of search results when performing image searches on small face images through quality enhancement of small face images.

[0006] In a first aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0007] A training method for a face quality enhancement model, comprising:

[0008] Constructing training data, wherein the training data includes a plurality of face picture pairs, each of the face picture pairs includes a first face picture and a second face picture, the first face picture and the second face picture include face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to a total of N+1 resolution levels, where N is a positive integer;

[0009] Constructing an initial training model, wherein the initial training model includes N modules, the N modules are cascaded in sequence, each module has an input end and an output end, and there are N input ends and N output ends in total, the N input ends respectively correspond to different resolution levels, and the N output ends respectively correspond to different resolution levels;

[0010] For each face picture pair in the training data, selecting a target input end corresponding to the resolution level of the first face picture from the N input ends, and selecting a target output end corresponding to the resolution level of the second face picture from the N output ends;

[0011] The first face picture is used as input of the target input end, and the second face picture is used as output of the target output end, so as to train the initial training model and obtain a face quality enhancement model.

[0012] Preferably, the constructing of training data includes:

[0013] Obtaining M sets of face images, each set of face images includes multiple face images, the multiple face images have different resolution levels, the face images in the same set of face images include face images of the same person, and the multiple face images are all of the preset size;

[0014] Performing multiple face picture extractions for each face picture set, randomly extracting two face pictures each time, and obtaining a plurality of face picture pairs; and constructing the training data based on the plurality of face picture pairs.

[0015] Preferably, obtaining a set of M face images includes:

[0016] Get P original pictures, where P is a positive integer;

[0017] Filtering out M original pictures from the P original pictures, wherein the M original pictures all contain face images smaller than the preset size;

[0018] Perform image searches on the M original images respectively to obtain the M image sets; wherein the M image sets correspond one-to-one to the M original images.

[0019] Preferably, performing image searches on the M original images respectively to obtain the M face image sets includes:

[0020] Performing an image search on the first original image to obtain S search result images; wherein the first original image is any image among the M original images, the S search result images have different sizes, and S is an integer greater than or equal to 2;

[0021] Crop the face regions of the S search result images respectively to obtain W face images, where W is greater than or equal to S;

[0022] Based on the W face pictures, a first face picture set is obtained; wherein the first face picture set belongs to the M face picture set, and the first picture set corresponds to the first original picture.

[0023] Preferably, obtaining a first face picture set based on the W face images includes:

[0024] Calculating the structural similarity between each face picture in the W face pictures and the first original picture to obtain a similarity score for each face picture in the W face pictures;

[0025] The face pictures whose similarity scores are lower than a preset score are filtered out from the W face pictures to obtain the first face picture set.

[0026] Preferably, before calculating the structural similarity between each calibration picture in the W calibration pictures and the first original picture, the method includes:

[0027] Performing face calibration on each of the W face images respectively, specifically comprising: scaling each of the W face images to the preset size; and adjusting the posture of the face image in each of the W face images based on the first original image.

[0028] Based on the same inventive concept, in the second aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0029] A method for searching an image, comprising:

[0030] Get the first search image uploaded by the user;

[0031] Determining a resolution level of the first search image;

[0032] Based on the resolution level, selecting an input terminal corresponding to the resolution level from a face quality enhancement model as a target input terminal; wherein the face quality enhancement model is obtained by training using any one of the methods described in claims 1 to 6;

[0033] Inputting the first search picture from the target input end into the face quality enhancement model, so as to perform face quality enhancement on the first search picture through the face quality enhancement model, and obtain a second search picture;

[0034] Perform an image search on the second search image to obtain search results.

[0035] Based on the same inventive concept, in the third aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0036] A training device for a face quality enhancement model, comprising:

[0037] A first construction unit is used to construct training data, wherein the training data includes a plurality of face picture pairs, each of the face picture pairs includes a first face picture and a second face picture, the first face picture and the second face picture include face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to N+1 resolution levels in total, where N is a positive integer;

[0038] A second construction unit is used to construct an initial training model, wherein the initial training model includes N modules, the N modules are cascaded in sequence, each module has an input end and an output end, and there are N input ends and N output ends in total, the N input ends respectively correspond to different resolution levels, and the N output ends respectively correspond to different resolution levels;

[0039] a first selection unit, configured to select, for each face picture pair in the training data, a target input end corresponding to the resolution level of the first face picture from the N input ends, and a target output end corresponding to the resolution level of the second face picture from the N output ends;

[0040] A training unit is used to use the first face picture as input of the target input end and the second face picture as output of the target output end to train the initial training model to obtain a face quality enhancement model.

[0041] Preferably, the first building unit comprises:

[0042] An obtaining subunit is used to obtain M face picture sets, each face picture set includes multiple face pictures, the multiple face pictures have different resolution levels, the face pictures in the same face picture set all include face images of the same person, and the multiple face pictures are all of the preset size;

[0043] The extraction subunit is used to perform multiple face picture extractions for each face picture set, randomly extracting two face pictures each time to obtain multiple face picture pairs; and construct the training data based on the multiple face picture pairs.

[0044] Preferably, the obtaining subunit is specifically used for:

[0045] Obtain P original pictures, where P is a positive integer; select M original pictures from the P original pictures, wherein the M original pictures all contain face images smaller than the preset size; perform image search on the M original pictures respectively to obtain the M picture sets, wherein the M picture sets correspond one-to-one to the M original pictures.

[0046] Preferably, the obtaining subunit is specifically used for:

[0047] Perform an image search on the first original image to obtain S search result images; wherein the first original image is any one of the M original images, the sizes of the S search result images are different, and S is an integer greater than or equal to 2; perform face area cropping on the S search result images respectively to obtain W face images, where W is greater than or equal to S; based on the W face images, obtain a first face image set; wherein the first face image set belongs to the M face image set, and the first image set corresponds to the first original image.

[0048] Preferably, the obtaining subunit is specifically used for:

[0049] Calculate the structural similarity between each face picture in the W face pictures and the first original picture to obtain a similarity score for each face picture in the W face pictures; filter out face pictures in the W face pictures whose similarity scores are lower than a preset score to obtain the first face picture set.

[0050] Preferably, the obtaining subunit is specifically used for:

[0051] Performing face calibration on each of the W face images respectively, specifically comprising: scaling each of the W face images to the preset size; and adjusting the posture of the face image in each of the W face images based on the first original image.

[0052] Based on the same inventive concept, in a fourth aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0053] A picture search device, comprising:

[0054] An acquisition unit, used to acquire a first search image uploaded by a user;

[0055] A determination unit, configured to determine a resolution level of the first search image;

[0056] A second selection unit is used to select an input end corresponding to the resolution level from a face quality enhancement model as a target input end based on the resolution level; wherein the face quality enhancement model is obtained by training the method according to any one of claims 1 to 6;

[0057] An input unit, used for inputting the first search picture from the target input end into the face quality enhancement model, so as to perform face quality enhancement on the first search picture through the face quality enhancement model to obtain a second search picture;

[0058] The search unit is used to perform an image search on the second search image to obtain search results.

[0059] Based on the same inventive concept, in a fifth aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0060] A training device for a face quality enhancement model comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method steps described in any one of the embodiments of the first aspect above can be implemented.

[0061] Based on the same inventive concept, in a sixth aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0062] A picture search device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method steps described in any one of the embodiments of the second aspect can be implemented.

[0063] Based on the same inventive concept, in the seventh aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0064] A computer-readable storage medium stores a computer program, which, when executed by a processor, can implement the method steps described in any one of the embodiments of the first aspect above.

[0065] Based on the same inventive concept, in an eighth aspect, the present invention provides the following technical solution through an embodiment of the present invention:

[0066] A computer-readable storage medium stores a computer program, which, when executed by a processor, can implement the method steps described in any embodiment of the second aspect above.

[0067] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:

[0068] In an embodiment of the present invention, a training method for a face quality enhancement model is disclosed, including: constructing training data, wherein the training data includes a plurality of face picture pairs, each of the face picture pairs includes a first face picture and a second face picture, the first face picture and the second face picture include face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to a total of N+1 resolution levels, where N is a positive integer; constructing an initial training model, wherein the initial training model includes N modules, and the N modules are cascaded in sequence , each module has an input terminal and an output terminal, and there are N input terminals and N output terminals in total, and the N input terminals correspond to different resolution levels, and the N output terminals correspond to different resolution levels; for each face image pair in the training data, a target input terminal corresponding to the resolution level of the first face image is selected from the N input terminals, and a target output terminal corresponding to the resolution level of the second face image is selected from the N output terminals; the first face image is used as the input of the target input terminal, and the second face image is used as the output of the target output terminal, so as to train the initial training model and obtain a face quality enhancement model. The face quality enhancement model trained by the training method can enhance the quality of small face images, and the effect is obvious. In this way, the technical problem that it is difficult to obtain accurate search results when performing image search on small face images in the prior art is solved, and the technical effect of enhancing the quality of small face images and significantly improving the accuracy of search results when performing image search on them is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0070] Figure 1 is a flow chart of a method for training a face quality enhancement model in an embodiment of the present invention;

[0071] Figure 2 This is a structural diagram of a face quality enhancement model in an embodiment of the present invention;

[0072] Figure 3 This is a flow chart of a picture search method according to an embodiment of the present invention;

[0073] Figure 4is a structural diagram of a training device for a face quality enhancement model in an embodiment of the present invention;

[0074] Figure 5 is a structural diagram of a picture search device in an embodiment of the present invention;

[0075] Figure 6 It is a structural diagram of a training device (and an image search device) for a face quality enhancement model in an embodiment of the present invention;

[0076] Figure 7 This is a structural diagram of a face quality enhancement model training device (and image search device) in an embodiment of the present invention when used as a server. DETAILED DESCRIPTION

[0077] The embodiments of the present invention solve the technical problem in the prior art that it is difficult to obtain accurate search results when performing image searches on small face images by providing a training method for a face quality enhancement model, an image search method and a device, thereby achieving the technical effect of significantly improving the accuracy of search results when performing image searches on small face images through quality enhancement of small face images.

[0078] The technical solution of the embodiment of the present invention is to solve the above technical problems, and the overall idea is as follows:

[0079] A training method for a face quality enhancement model comprises: constructing training data, wherein the training data comprises a plurality of face picture pairs, each of the face picture pairs comprises a first face picture and a second face picture, the first face picture and the second face picture comprise face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to N+1 resolution levels in total, where N is a positive integer; constructing an initial training model, wherein the initial training model comprises N modules, the N modules are cascaded in sequence, and each module has The invention has an input terminal and an output terminal, with a total of N input terminals and N output terminals, wherein the N input terminals correspond to different resolution levels, and the N output terminals correspond to different resolution levels; for each face image pair in the training data, a target input terminal corresponding to the resolution level of the first face image is selected from the N input terminals, and a target output terminal corresponding to the resolution level of the second face image is selected from the N output terminals; the first face image is used as the input of the target input terminal, and the second face image is used as the output of the target output terminal, so as to train the initial training model and obtain a face quality enhancement model. The face quality enhancement model trained by the training method can enhance the quality of small face images, and the effect is obvious. In this way, the technical problem that it is difficult to obtain accurate search results when searching for small face images in the prior art is solved, and the technical effect of enhancing the quality of small face images and significantly improving the accuracy of search results when searching for small face images is achieved.

[0080] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0081] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0082] Embodiment 1

[0083] like Figure 1 As shown, this embodiment provides a training method for a face quality enhancement model, including:

[0084] Step S101: construct training data, the training data includes multiple face picture pairs, each face picture pair includes a first face picture and a second face picture, the first face picture and the second face picture include facial images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to N+1 resolution levels, where N is a positive integer.

[0085] In the specific implementation process, it is first necessary to construct the training data (i.e., training samples) required for model training. All face images in the training data are of a preset size, which is the size of the input data (i.e., images) required by the model. The preset size is also the size of the search image required by the image search engine. The preset size is usually 112*112 (unit: pixel). At the same time, the preset size can also be other sizes, for example, 120*120, or 240*240, etc. Here, there is no specific limitation on the preset size.

[0086] In the specific implementation process, all the images in the training data correspond to N+1 resolution levels, and there are N modules in the face quality enhancement model. That is to say, the number of resolution levels of the face images in the training data is one more than the number of modules in the face quality enhancement model.

[0087] For example, there are 4 modules in the face quality enhancement model, and the face images in the training data have 5 resolution levels.

[0088] Among them, the higher the resolution level of the image, the higher the quality of the image, the more information it contains, and the more conducive it is to face recognition.

[0089] In the specific implementation process, the training data contains a large number of face image pairs, each face image pair contains two face images (namely: a first face image and a second face image), and the two face images have facial images of the same person, and the difference is that the two face images have different resolution levels, wherein the resolution level of the second face image is higher than the resolution level of the first face image, that is, the second face image is a high-quality image, and the first face image is a low-quality image.

[0090] As an optional embodiment, step S101 includes:

[0091] M face picture sets are obtained, each face picture set contains multiple face pictures, the resolution levels of the multiple face pictures are different, the face pictures in the same face picture set all contain face images of the same person, and the multiple face pictures are all of preset sizes; face picture extraction is performed multiple times for each face picture set, two face pictures are randomly selected each time, and multiple face picture pairs are obtained; and training data is constructed based on the multiple face picture pairs.

[0092] During the specific implementation process, a first data set can be obtained, wherein the first data set includes a set of M face images; for a set of face images, two face images can be arbitrarily extracted (for example, randomly extracted) to form a face image pair, and thus, for each set of face images, multiple image extractions can be performed, and a large number of face image pairs can be obtained to form training data.

[0093] For example, if a face picture set contains 5 face pictures, namely L1, L2, L3, L4, and L5, these face pictures all contain the face image of person A, and these face pictures are all preset sizes (for example: 112*112), and the resolution levels of these face pictures are also different (for example: L1 is level 1, L2 is level 2, L3 is level 3, L4 is level 4, and L5 is level 5). In this picture set, the face picture pairs that can be extracted are: (L1, L2), (L1, L3), (L1, L4), (L1, L5), (L2, L3), (L2, L4), (L2, L5), (L3, L4), (L3, L5), (L4, L5), a total of 10 face picture pairs.

[0094] The above is only for a face picture set. In specific implementation, the first data set includes a large number of face picture sets. Similar face picture pairs are extracted for each face data set, and a large number of face picture pairs can be obtained. In this way, training data can be constructed.

[0095] As an optional embodiment, obtaining a set of M face images includes:

[0096] Obtain P original pictures, where P is a positive integer; select M original pictures from the P original pictures, wherein the M original pictures all contain face images smaller than the preset size; perform image search on the M original pictures respectively to obtain the M picture sets, wherein the M picture sets correspond one-to-one to the M original pictures.

[0097] In a specific implementation process, when obtaining the M face data sets, a second data set may be obtained first, which includes a large number of original pictures; then, face detection is performed on these original pictures, and pictures with face sizes smaller than a preset size (for example, 112*112) are selected, and a total of M pictures are obtained. Furthermore, these pictures are searched for respectively using an image search engine to obtain the M picture sets.

[0098] As an optional embodiment, performing image search on the M original images respectively to obtain the M face image sets includes:

[0099] First, perform an image search on the first original image to obtain S search result images; wherein, the first original image is any image in the M original images, and the sizes of the S search result images are different, and S is an integer greater than or equal to 2; in this way, images of the same face in different sizes can be obtained. Secondly, perform face area cropping on each of the S search result images, remove images in non-face areas, and obtain W face images, where W is greater than or equal to S. Thirdly, obtain a first face image set based on the W face images; wherein, the first face image set belongs to the M face image set, and the first image set corresponds to the first original image. In this way, an image set corresponding to the first original image is obtained. Similarly, for each of the M original images, similar operations are performed to obtain the M face image set.

[0100] In more detail, obtaining a first face picture set based on the W face images includes:

[0101] Perform face calibration on each of the W face images respectively; calculate the structural similarity between each of the W face images and the first original image to obtain a similarity score for each of the W face images; filter out face images with similarity scores lower than a preset score from the W face images to obtain a first face image set.

[0102] For example, for any original image p1 in the second data set, the original image p1 is input into an image search engine for image search to obtain multiple search result images of different sizes; then, face detection is performed on each search result image, and the detected face area is cropped to obtain multiple face images; finally, face calibration and filtering are performed on these face images; the filtered face images constitute the face image set of the original image p1.

[0103] Here, an image search engine is used to obtain multiple search result images of different sizes corresponding to the first original image, and based on these search result images of different sizes, face image pairs of different resolution levels are constructed. This is more in line with the real scene, so that the training data can be highly fitted with the real scene, which is conducive to improving the effect of model training.

[0104] In a specific implementation process, the face calibration for each face image of the W faces includes:

[0105] Each of the W face pictures is scaled to a preset size; and based on the first original picture, the posture of the face image in each of the W face pictures is adjusted.

[0106] Here, each face image is scaled to a preset size. If the size of the original face image is larger, then after scaling to the preset size, its resolution level will be higher and the image quality will be higher; if the size of the original face image is smaller, then after scaling to the preset size, its resolution level will be lower and the image quality will be lower.

[0107] Here, the purpose of calibration is to scale the cropped face image to a preset size through an affine transformation, and to move the facial key points as close as possible to a standard face with a preset frontal posture (i.e., straighten the face), and place the face image in the center of the image. This can reduce the calculation pressure of subsequent ratios, and when calculating the structural similarity between the calibration image and the first original image, the calculation speed is faster and the calculation accuracy is higher.

[0108] In the specific implementation process, when calculating the structural similarity between each face image and the first original image, the SSIM (Structural Similarity IndexMeasure, structural similarity) score of each face image and the first original image can be calculated, and the face images with higher scores are retained, and the face images with lower scores are filtered out. Since the search result image may contain face images of multiple people, the face images obtained by cropping later may contain face images of other people (that is, not the same person as in the first original image), so these face images are filtered here, and the face images with lower scores are filtered out, so that it can be guaranteed that the filtered face images are the face images of the same person as the first original image.

[0109] At this point, the steps for building training data are completed.

[0110] Step S102: construct an initial training model, which includes N modules. The N modules are cascaded in sequence, each module has an input terminal and an output terminal, and there are N input terminals and N output terminals in total. The N input terminals each correspond to a different resolution level, and the N output terminals each correspond to a different resolution level.

[0111] In the specific implementation process, there is no particular order in which step S101 and step S102 are executed, and either one can be executed first.

[0112] In a specific implementation process, when the N+1 resolution levels are sorted from low to high, the N input ends correspond one-to-one to the top N resolution levels among the N+1 resolution levels, and the N output ends correspond one-to-one to the bottom N resolution levels among the N+1 resolution levels.

[0113] For example, Figure 2 As shown, the initial training model has a total of 4 modules, each of which has an input and an output. Module 1 has an input terminal Input1 and an output terminal Output1, module 2 has an input terminal Input2 and an output terminal Output2, module 3 has an input terminal Input3 and an output terminal Output3, and module 4 has an input terminal Input4 and an output terminal Output4. Among them, the output terminal Output1 of module 1 is connected to the input terminal Input2 of module 2, the output terminal Output2 of module 2 is connected to the input terminal Input3 of module 3, and the output terminal Output3 of module 3 is connected to the input terminal Input4 of module 4.

[0114] Among them, the face images in the training data are divided into 5 resolution levels, from high to low: level 1, level 2, level 3, level 4, and level 5; Input1 corresponds to the face images at level 1, Input2 corresponds to the face images at level 2, Input3 corresponds to the face images at level 3, and Input4 corresponds to the face images at level 4; Output1 corresponds to the face images at level 2, Output2 corresponds to the face images at level 3, Output3 corresponds to the face images at level 4, and Output4 corresponds to the face images at level 5.

[0115] In a specific implementation process, after executing step S102, step S103 may be executed.

[0116] Step S103: For each face image pair in the training data, select a target input end corresponding to the resolution level of the first face image from the N input ends, and select a target output end corresponding to the resolution level of the second face image from the N output ends.

[0117] For example, for the face image pair (L1, L2), the face image L1 corresponds to the input terminal Input1 of module 1, and the face image L2 corresponds to the output terminal Output1 of module 1.

[0118] For example, for the face image pair (L1, L3), the face image L1 corresponds to the input terminal Input1 of module 1, and the face image L3 corresponds to the output terminal Output2 of module 2.

[0119] For example, for the face image pair (L1, L4), the face image L1 corresponds to the input terminal Input1 of module 1, and the face image L4 corresponds to the output terminal Output3 of module 3.

[0120] For example, for the face image pair (L1, L5), the face image L1 corresponds to the input terminal Input1 of module 1, and the face image L5 corresponds to the output terminal Output4 of module 4.

[0121] For example, for the face image pair (L2, L3), the face image L2 corresponds to the input terminal Input2 of module 2, and the face image L3 corresponds to the output terminal Output2 of module 2.

[0122] For example, for the face image pair (L2, L4), the face image L2 corresponds to the input terminal Input2 of module 2, and the face image L4 corresponds to the output terminal Output3 of module 3.

[0123] For example, for the face image pair (L2, L5), the face image L2 corresponds to the input terminal Input2 of module 2, and the face image L5 corresponds to the output terminal Output4 of module 4.

[0124] For example, for the face image pair (L3, L4), the face image L3 corresponds to the input terminal Input3 of module 3, and the face image L4 corresponds to the output terminal Output3 of module 3.

[0125] For example, for the face image pair (L3, L5), the face image L3 corresponds to the input terminal Input3 of module 3, and the face image L5 corresponds to the output terminal Output4 of module 4.

[0126] For example, for the face image pair (L4, L5), the face image L4 corresponds to the input terminal Input4 of module 4, and the face image L5 corresponds to the output terminal Output4 of module 4.

[0127] In a specific implementation process, after executing step S103, step S104 may be executed.

[0128] Step S104: using the first face image as input of the target input terminal and using the second face image as output of the target output terminal to train the initial training model and obtain a face quality enhancement model.

[0129] For example, for a face image pair (L1, L2), face image L1 is used as input data of Input1 of module 1, and face image L2 is used as output data of Output1 of module 1, so that module 1 is trained to enhance the quality of face images with the first level of resolution and output face images with the second level of resolution.

[0130] For example, for a face image pair (L1, L3), face image L1 is used as input data of Input1 of module 1, and face image L3 is used as output data of Output2 of module 2. Module 1 and module 2 are trained together so that they can enhance the quality of face images of level 1 resolution and output face images of level 3 resolution.

[0131] For example, for the face image pair (L1, L4), the face image L1 is used as the input data of the input end Input1 of module 1, and the face image L4 is used as the output data of the output end Output3 of module 3. Modules 1, 2 and 3 are trained together to enable them to enhance the quality of face images with the first level of resolution to output face images with the fourth level of resolution.

[0132] For example, for the face image pair (L1, L5), the face image L1 is used as the input data of the input end Input1 of module 1, and the face image L5 is used as the output data of the output end Output4 of module 4. Module 1, module 2, module 3 and module 4 are trained together, so that they can enhance the quality of the face image with the first level of resolution to output the face image with the fifth level of resolution.

[0133] For example, for the face image pair (L2, L3), the face image L2 is used as the input data of the input end Input2 of module 2, and the face image L3 is used as the output data of the output end Output2 of module 2. Module 2 is trained in this way so that it can enhance the quality of face images with the second level of resolution to output face images with the third level of resolution.

[0134] For example, for the face image pair (L2, L4), face image L2 is used as the input data of the input end Input2 of module 2, and face image L4 is used as the output data of the output end Output3 of module 3. Module 2 and module 3 are trained together so that they can enhance the quality of face images with the second level of resolution and output face images with the fourth level of resolution.

[0135] For example, for the face image pair (L2, L5), the face image L2 is used as the input data of the input end Input2 of module 2, and the face image L5 is used as the output data of the output end Output4 of module 4. Modules 2, 3 and 4 are trained together to enable them to enhance the quality of face images with the second level of resolution to output face images with the fifth level of resolution.

[0136] For example, for the face image pair (L3, L4), the face image L3 is used as the input data of the input end Input3 of module 3, and the face image L4 is used as the output data of the output end Output3 of module 3. Module 3 is trained in this way so that it can enhance the quality of face images with the third level of resolution and output face images with the fourth level of resolution.

[0137] For example, for the face image pair (L3, L5), face image L3 is used as the input data of the input end Input3 of module 3, and face image L5 is used as the output data of the output end Output4 of module 4. Module 3 and module 4 are trained together so that they can enhance the quality of face images with the third level of resolution and output face images with the fifth level of resolution.

[0138] For example, for the face image pair (L4, L5), face image L4 is used as input data of the input end Input4 of module 4, and face image L5 is used as output data of the output end Output4 of module 4. Module 4 is trained in this way so that it can enhance the quality of face images with a resolution of level 4 to output face images with a resolution of level 5.

[0139] The above example is only for a certain set of the M face picture sets. In the specific implementation process, for the entire face picture set, there will be more face picture pairs as training data to train the initial model, and finally obtain the face quality enhancement model.

[0140] Since a large number of face image pairs with different resolution levels are used as training data, each module in the initial model is trained step by step. The face quality enhancement model trained in this way can not only significantly improve the quality of small face images, but also reduce the loss of other feature information (such as identity information) in face images.

[0141] The technical solutions in the above embodiments of the present invention have at least the following technical effects or advantages:

[0142] In an embodiment of the present invention, a training method for a face quality enhancement model is disclosed, including: constructing training data, wherein the training data includes a plurality of face picture pairs, each of the face picture pairs includes a first face picture and a second face picture, the first face picture and the second face picture include face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to a total of N+1 resolution levels, where N is a positive integer; constructing an initial training model, wherein the initial training model includes N modules, and the N modules are cascaded in sequence , each module has an input terminal and an output terminal, and there are N input terminals and N output terminals in total, and the N input terminals correspond to different resolution levels, and the N output terminals correspond to different resolution levels; for each face image pair in the training data, a target input terminal corresponding to the resolution level of the first face image is selected from the N input terminals, and a target output terminal corresponding to the resolution level of the second face image is selected from the N output terminals; the first face image is used as the input of the target input terminal, and the second face image is used as the output of the target output terminal, so as to train the initial training model and obtain a face quality enhancement model. The face quality enhancement model trained by the training method can enhance the quality of small face images, and the effect is obvious. In this way, the technical problem that it is difficult to obtain accurate search results when performing image search on small face images in the prior art is solved, and the technical effect of enhancing the quality of small face images and significantly improving the accuracy of search results when performing image search on them is achieved.

[0143] Embodiment 2

[0144] Based on the same inventive concept, Figure 3 As shown, this embodiment provides a picture search method, including:

[0145] Step S201: Obtain the first search image uploaded by the user.

[0146] In a specific implementation process, the first search image contains a small face image (ie, the face size is smaller than a preset size). Furthermore, if the first search image uploaded by the user is not of the preset size, the first search image needs to be searched to the preset size.

[0147] Step S202: Determine the resolution level of the first search image.

[0148] Step S203: Based on the resolution level of the first search image, select a target input end corresponding to the resolution level from a face quality enhancement model; wherein the face quality enhancement model is obtained by training using any one of the implementation methods in the first embodiment above.

[0149] For example, the structure of the face quality enhancement model is as follows Figure 2 As shown, during the use of the face quality enhancement model, it includes 4 input terminals (ie, Input1, Input2, Input3 and Input4) and 1 output terminal (ie, Output4).

[0150] For example, if the resolution level of the first search image is level 1, its corresponding target input end is input end Input1 of model 1; if the resolution level of the first search image is level 2, its corresponding target input end is input end Input2 of model 2; if the resolution level of the first search image is level 3, its corresponding target input end is input end Input3 of model 3; if the resolution level of the first search image is level 4, its corresponding target input end is input end Input4 of model 4.

[0151] Step S204: Input the first search image from the target input end into the face quality enhancement model to perform face quality enhancement on the first search image through the face quality enhancement model to obtain a second search image.

[0152] For example, if the resolution level of the first search image is level 1, the first search image is input from the input end Input1 of model 1 to the face quality enhancement model, and the face quality is enhanced by the face quality enhancement model, so as to obtain the second search image with a resolution level of level 5 from the output end Output4.

[0153] For example, if the first search image has a resolution level of level 2, the first search image is input from the input end Input2 of model 2 to the face quality enhancement model, and after the face quality is enhanced by the face quality enhancement model, a second search image with a resolution level of level 5 is obtained from the output end Output4.

[0154] For example, if the first search image has a resolution level of level 3, the first search image is input from the input end Input3 of model 3 to the face quality enhancement model, and the face quality is enhanced by the face quality enhancement model, so as to obtain the second search image with a resolution level of level 5 from the output end Output4.

[0155] For example, if the first search image has a resolution level of the 4th level, the first search image is input from the input end Input4 of model 4 to the face quality enhancement model, and the face quality is enhanced by the face quality enhancement model, so as to obtain the second search image with a resolution level of the 5th level from the output end Output4.

[0156] Step S205: Perform an image search on the second search image to obtain search results.

[0157] For example, the second search image with enhanced quality can be input into the image search engine for image search. Since its image quality has been significantly improved, its search results are more accurate. In addition, since the face quality enhancement model improves the quality of the first search image step by step, it reduces the loss of person identity information and helps to obtain more accurate person identity information.

[0158] The technical solutions in the above embodiments of the present invention have at least the following technical effects or advantages:

[0159] In an embodiment of the present invention, since a face quality enhancement model is used to enhance the quality of the first search image when performing an image search, the resolution level of the image can be increased, the image quality can be improved, and the loss of the person's identity information can be reduced. In this way, the image search engine can extract more feature information, which helps to improve the accuracy of the search results.

[0160] Embodiment 3

[0161] Based on the same inventive concept, Figure 4 As shown, this embodiment provides a training device 300 for a face quality enhancement model, including:

[0162] A first constructing unit 301 is used to construct training data, wherein the training data includes a plurality of face picture pairs, each of which includes a first face picture and a second face picture, the first face picture and the second face picture include face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to N+1 resolution levels in total, where N is a positive integer;

[0163] A second construction unit 302 is used to construct an initial training model, wherein the initial training model includes N modules, the N modules are cascaded in sequence, each module has an input end and an output end, and there are N input ends and N output ends in total, the N input ends respectively correspond to different resolution levels, and the N output ends respectively correspond to different resolution levels;

[0164] A first selection unit 303 is used to select, for each face picture pair in the training data, a target input end corresponding to the resolution level of the first face picture from the N input ends, and to select a target output end corresponding to the resolution level of the second face picture from the N output ends;

[0165] The training unit 304 is used to use the first face picture as the input of the target input end and the second face picture as the output of the target output end to train the initial training model to obtain a face quality enhancement model.

[0166] As an optional embodiment, the first construction unit 301 includes:

[0167] An obtaining subunit is used to obtain M face picture sets, each face picture set includes multiple face pictures, the multiple face pictures have different resolution levels, the face pictures in the same face picture set all include face images of the same person, and the multiple face pictures are all of the preset size;

[0168] The extraction subunit is used to perform multiple face picture extractions for each face picture set, randomly extracting two face pictures each time to obtain multiple face picture pairs; and construct the training data based on the multiple face picture pairs.

[0169] As an optional embodiment, the obtaining subunit is specifically used for:

[0170] Obtain P original pictures, where P is a positive integer; select M original pictures from the P original pictures, wherein the M original pictures all contain face images smaller than the preset size; perform image search on the M original pictures respectively to obtain the M picture sets; wherein the M picture sets correspond one-to-one to the M original pictures.

[0171] As an optional embodiment, the obtaining subunit is specifically used for:

[0172] Perform an image search on the first original image to obtain S search result images; wherein the first original image is any one of the M original images, the sizes of the S search result images are different, and S is an integer greater than or equal to 2; perform face area cropping on the S search result images respectively to obtain W face images, where W is greater than or equal to S; based on the W face images, obtain a first face image set; wherein the first face image set belongs to the M face image set, and the first image set corresponds to the first original image.

[0173] As an optional embodiment, the obtaining subunit is specifically used for:

[0174] Calculate the structural similarity between each face picture in the W face pictures and the first original picture to obtain a similarity score for each face picture in the W face pictures; filter out face pictures in the W face pictures whose similarity scores are lower than a preset score to obtain the first face picture set.

[0175] As an optional embodiment, the obtaining subunit is specifically used for:

[0176] Before calculating the structural similarity between each calibration picture in the W calibration pictures and the first original picture, performing face calibration on each face picture in the W face pictures respectively;

[0177] The specific calibration process includes: scaling each of the W face images to the preset size; and adjusting the posture of the face image in each of the W face images based on the first original image.

[0178] Since the training device of the face quality enhancement model introduced in this embodiment is a device used to implement the training method of the face quality enhancement model in the embodiment of the present invention, based on the training method of the face quality enhancement model introduced in the embodiment of the present invention, the technicians in this field can understand the specific implementation of the training device of the face quality enhancement model in this embodiment and its various variations, so how the device implements the method in the embodiment of the present invention is not described in detail here. As long as the technicians in this field implement the device used by the training method of the face quality enhancement model in the embodiment of the present invention, it belongs to the scope of protection of the present invention.

[0179] Embodiment 4

[0180] Based on the same inventive concept, Figure 5 As shown, this embodiment provides a picture search device 400, including:

[0181] An acquisition unit 401 is used to acquire a first search image uploaded by a user;

[0182] A determination unit 402, configured to determine a resolution level of the first search image;

[0183] A second selection unit 403 is configured to select a module corresponding to the resolution level of the first search image from a face quality enhancement model as an input module based on the resolution level of the first search image; wherein the face quality enhancement model is obtained by training using any implementation method in the first embodiment;

[0184] An input unit 404, used to input the first search image from the input module into the face quality enhancement model, so as to perform face quality enhancement on the first search image through the face quality enhancement model to obtain a second search image 405;

[0185] The search unit 406 is used to perform an image search on the second search image to obtain search results.

[0186] Since the image search device introduced in this embodiment is a device used to implement the image search method in the embodiment of the present invention, based on the image search method introduced in the embodiment of the present invention, a person skilled in the art can understand the specific implementation of the image search device in this embodiment and its various variations, so how the image search device implements the method in the embodiment of the present invention is not described in detail here. As long as a person skilled in the art implements the device used in the image search method in the embodiment of the present invention, it belongs to the scope of protection of the present invention.

[0187] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0188] Figure 6 800 is a structural diagram of a training device for a face quality enhancement model (and an image search device) according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0189] Reference Figure 6 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0190] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0191] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0192] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0193] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0194] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0195] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0196] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0197] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0198] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0199] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0200] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the device 800, enables the device 800 to execute a training method for a face quality enhancement model, including: constructing training data, the training data including multiple face picture pairs, each of the face picture pairs including a first face picture and a second face picture, the first face picture and the second face picture including face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, all pictures in the training data correspond to N+1 resolution levels, N is a positive integer; constructing an initial training model, the initial training model The model includes N modules, which are cascaded in sequence, each module has an input end and an output end, and there are N input ends and N output ends in total. The N input ends correspond to different resolution levels, and the N output ends correspond to different resolution levels. For each face image pair in the training data, a target input end corresponding to the resolution level of the first face image is selected from the N input ends, and a target output end corresponding to the resolution level of the second face image is selected from the N output ends. The first face image is used as the input of the target input end, and the second face image is used as the output of the target output end, so as to train the initial training model and obtain a face quality enhancement model.

[0201] And, a non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the device 800, the device 800 can perform an image search method, including: obtaining a first search image uploaded by a user; determining a resolution level of the first search image; based on the resolution level, selecting an input end corresponding to the resolution level from a face quality enhancement model as a target input end; inputting the first search image from the target input end into the face quality enhancement model to perform face quality enhancement on the first search image through the face quality enhancement model to obtain a second search image; performing an image search on the second search image to obtain search results.

[0202] Figure 7It is a structural diagram of a training device for a face quality enhancement model (and an image search device) in an embodiment of the present invention when used as a server. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and a memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.

[0203] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0204] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.

[0205] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims. The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A training method for a face quality enhancement model, It is characterized in that include: Constructing training data, wherein the training data includes a plurality of face picture pairs, each of the face picture pairs includes a first face picture and a second face picture, the first face picture and the second face picture include face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to a total of N+1 resolution levels, where N is a positive integer; Constructing an initial training model, wherein the initial training model includes N modules, the N modules are cascaded in sequence, each module has an input end and an output end, and there are N input ends and N output ends in total, the N input ends respectively correspond to different resolution levels, and the N output ends respectively correspond to different resolution levels; When the N+1 resolution levels are sorted from low to high, the N input ends correspond one-to-one to the N resolution levels that are ranked first among the N+1 resolution levels, and the N output ends correspond one-to-one to the N resolution levels that are ranked last among the N+1 resolution levels; For each face picture pair in the training data, selecting a target input end corresponding to the resolution level of the first face picture from the N input ends, and selecting a target output end corresponding to the resolution level of the second face picture from the N output ends; The first face picture is used as input of the target input end, and the second face picture is used as output of the target output end, so as to train the initial training model and obtain a face quality enhancement model.

2. The method according to claim 1, It is characterized in that The constructing of training data comprises: Obtaining M sets of face images, each set of face images includes multiple face images, the multiple face images have different resolution levels, the face images in the same set of face images include face images of the same person, and the multiple face images are all of the preset size; Performing multiple face picture extractions for each face picture set, randomly extracting two face pictures each time, and obtaining a plurality of face picture pairs; and constructing the training data based on the plurality of face picture pairs.

3. The method according to claim 2, It is characterized in that The step of obtaining a set of M face images includes: Get P original pictures, where P is a positive integer; Filtering out M original pictures from the P original pictures, wherein the M original pictures all contain face images smaller than the preset size; Perform image searches on the M original images respectively to obtain the M image sets; wherein the M image sets correspond one-to-one to the M original images.

4. A method for searching images, It is characterized in that include: Get the first search image uploaded by the user; Determining a resolution level of the first search image; Based on the resolution level, selecting an input terminal corresponding to the resolution level from a face quality enhancement model as a target input terminal; wherein the face quality enhancement model is obtained by training the method according to any one of claims 1 to 3; Inputting the first search picture from the target input end into the face quality enhancement model, so as to perform face quality enhancement on the first search picture through the face quality enhancement model, and obtain a second search picture; Perform an image search on the second search image to obtain search results.

5. A training device for a face quality enhancement model, It is characterized in that include: A first construction unit is used to construct training data, wherein the training data includes a plurality of face picture pairs, each of the face picture pairs includes a first face picture and a second face picture, the first face picture and the second face picture include face images of the same person, the first face picture and the second face picture are both of preset sizes, the resolution level of the second face picture is higher than the resolution level of the first face picture, and all pictures in the training data correspond to N+1 resolution levels in total, where N is a positive integer; A second construction unit is used to construct an initial training model, wherein the initial training model includes N modules, the N modules are cascaded in sequence, each module has an input end and an output end, and there are N input ends and N output ends in total, the N input ends respectively correspond to different resolution levels, and the N output ends respectively correspond to different resolution levels; When the N+1 resolution levels are sorted from low to high, the N input ends correspond one-to-one to the N resolution levels that are ranked first among the N+1 resolution levels, and the N output ends correspond one-to-one to the N resolution levels that are ranked last among the N+1 resolution levels; a first selection unit, configured to select, for each face picture pair in the training data, a target input end corresponding to the resolution level of the first face picture from the N input ends, and a target output end corresponding to the resolution level of the second face picture from the N output ends; A training unit is used to use the first face picture as input of the target input end and the second face picture as output of the target output end to train the initial training model to obtain a face quality enhancement model.

6. A picture search device, It is characterized in that include: An acquisition unit, used to acquire a first search image uploaded by a user; A determination unit, configured to determine a resolution level of the first search image; A second selection unit is used to select an input end corresponding to the resolution level from a face quality enhancement model as a target input end based on the resolution level; wherein the face quality enhancement model is obtained by training the method according to any one of claims 1 to 3; An input unit, used for inputting the first search picture from the target input end into the face quality enhancement model, so as to perform face quality enhancement on the first search picture through the face quality enhancement model to obtain a second search picture; The search unit is used to perform an image search on the second search image to obtain search results.

7. A training device for a face quality enhancement model, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method steps described in any one of claims 1 to 3 can be implemented.

8. An image search device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method steps as claimed in claim 4 can be implemented.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method steps described in any one of claims 1 to 3 can be implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method steps as claimed in claim 4 can be implemented.