A facial image beauty detection method and system based on optical flow estimation

Through the facial image beautification detection method based on optical flow estimation, using optical flow extraction and multi-layer cascade feature fusion, the problem of uniformity and insufficient detection performance of facial skin color beautification detection in the existing technology is solved, and the detection method is realized. Efficient detection of multiple face beautification and deformation categories.

CN114283472BActive Publication Date: 2024-10-15XIAMEN MEIYABAIKE INFORMATION SECURITY RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111554032.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2024-10-15
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

The existing technology cannot adopt a unified method for facial skin beautification detection, and the method based on illumination estimation is only suitable for face deformation when the face is liquefied, and is not applicable to other deformation methods, and the open source segmentation network DRN is ineffective in segmentation performance. Poor, resulting in poor detection performance.

Method used

A face image beauty detection method based on optical flow estimation is used to process the face image by cropping and deforming it, inputting the optical flow extraction network for feature fusion and optical flow extraction, and using multi-layer cascaded feature fusion and deconvolution network to calculate the feature map The difference with the optical flow field image, predicts the face deformation probability and area, performs image restoration and difference calculation, and is used to detect face tampering.

Benefits of technology

It realizes the detection of a variety of facial skin beautification and deformation categories, improves detection performance, can better express the performance of facial deformation, covers a variety of facial beautification methods and deformation methods, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114283472B_ABST
    Figure CN114283472B_ABST
Patent Text Reader

Abstract

The present application provides a facial image beauty detection method and system based on optical flow estimation, the method comprising: cropping the facial image to be processed to obtain a facial region image, deforming the facial region image to obtain a deformed facial image, inputting the facial region image and the deformed facial image into an optical flow extraction network; extracting features of the facial region image and the deformed facial image respectively and fusing them, using a deconvolution network to perform optical flow extraction on the image after feature fusion to obtain an optical flow field image; downsampling the facial image to be processed, inputting the downsampled image and the image to be processed into an optical flow field detection network, performing two-layer cascade feature fusion, obtaining a first feature map, a second feature map, and a third feature map, respectively calculating the common differences between the three feature maps and the optical flow field image, and back-propagating them to the optical flow field detection network until the optical flow field detection network converges. Image restoration based on the optical flow field can show good performance in facial deformation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a method and system for facial image beauty detection based on optical flow estimation. Background Art

[0002] For facial images after face beautification, some existing technologies can achieve relatively satisfactory results, such as: using image stitching and pattern noise-based detection methods to detect facial images after skin smoothing, or using color space distribution to detect images processed with different filters. When detecting facial deformation, directly using classification and target detection convolutional neural networks does not work well, but according to the paper "Detecting Photoshopped Faces by Scripting Photoshop", using illumination estimation to model the face liquefaction pattern can greatly improve the detection accuracy of liquefied face images.

[0003] However, it is currently impossible to use a unified method to detect facial skin color beautification. If each beautification method is detected using a method, the system will be bloated. At the same time, the detection method described in the above paper is only applicable to face deformation with face liquefaction, and is not applicable to other deformation methods, especially deformed face images based on the moving least squares method. The face liquefaction detection method described in the above paper uses the open source segmentation network dilated residual network DRN to estimate the optical flow of face deformation in a single image. Since DRN is not the best in segmentation performance, the subsequent detection method cannot achieve the best performance.

[0004] In view of this, it is of great significance to design a detection method and system that can cover a variety of facial skin color beautification and facial deformation categories and has better optical flow field prediction performance based on a single image. Summary of the invention

[0005] The embodiments of the present application propose a facial image beauty detection method and system based on optical flow estimation to solve the technical problems mentioned in the above background technology section.

[0006] In a first aspect, an embodiment of the present application provides a facial image beauty detection method based on optical flow estimation, characterized in that it includes the following steps:

[0007] S110, cropping the face image to be processed to obtain a face region image, deforming the face region image to obtain a deformed face image, and inputting the face region image and the deformed face image into an optical flow extraction network in pairs;

[0008] S120, extracting features of the face region image and the face deformation image respectively, fusing the features, and performing optical flow extraction on the image after feature fusion using a deconvolution network to obtain an optical flow field image;

[0009] S130, downsampling the face image to be processed to obtain a downsampled image, inputting the downsampled image and the image to be processed into an optical flow field detection network, and performing two-layer cascade feature fusion to obtain a first feature map, performing a deconvolution operation on the first feature map to obtain a second feature map, and continuing to perform multiple deconvolution operations on the second feature map to obtain a third feature map; and

[0010] S140, respectively calculating the common differences between the first feature map, the second feature map, the third feature map and the optical flow field image, and back-propagating them to the optical flow field detection network until the optical flow field detection network converges.

[0011] This method can predict the deformation probability and deformation area of ​​the face image, and restore the image based on the optical flow field. The difference map is then calculated from the deformed image and the restored image. Finally, the face deformation probability, deformation area heat map and difference map are used as the basis for face tampering, which can show good performance in face deformation.

[0012] In some embodiments, in step S140, the formula used to calculate the common differences between the first feature map, the second feature map, and the third feature map and the optical flow field images of corresponding sizes is:

[0013]

[0014] Among them, W and H are the width and height of the optical flow field image, respectively, and ij represents the pixel coordinates.

[0015] The total difference can be obtained through this formula and back-propagated to the optical flow field detection network for correction.

[0016] In some embodiments, in step S110, the face image to be processed is cropped to obtain a face region image, and the face region image is deformed to obtain a deformed face image, which specifically includes:

[0017] Acquire a face image to be processed, use a face detection algorithm to locate a face position frame in the face image to be processed, crop the image to be processed according to the face position frame, and obtain a face area image;

[0018] The face area image is deformed by using software such as Photoshop or Meitu XiuXiu to beautify or deform the face area image, or by using a method including a moving least squares method to deform the face area image.

[0019] In some embodiments, using a face detection algorithm to locate a face position frame in a face image to be processed specifically includes the following steps:

[0020] S111. Use a face detection algorithm to locate a face position frame [x0, y0, w, h], where x0, y0, w, h represent the horizontal axis starting point, vertical axis starting point, width, and height of the face position frame, respectively;

[0021] S112, enlarging the face position frame by two times to obtain an enlarged face position frame [x0-w / 2, y0-h / 2, 2*w, 2*h]; and

[0022] S113, cropping the image to be processed according to the face position frame to obtain a face area image.

[0023] Through this operation, the area containing the face in the image to be processed can be quickly cropped.

[0024] In some embodiments, the method also includes using an attention mechanism classification network GCnet to identify and classify the facial images to be processed, and the classification results include whitening, skin smoothing, bronzer, one-click skin beautification and face deformation. The optical flow extraction in step S120 is performed on the output image whose classification results are one-click skin beautification and face deformation to generate an optical flow field image.

[0025] The multi-classification deep convolutional neural network is used. Through the powerful feature extraction ability of the network, it can cover the transformation capabilities of various face skin color beautification methods. The use of the attention mechanism classification network GCnet can effectively improve the classification accuracy.

[0026] In some embodiments, the output classification result uses the following function:

[0027]

[0028] Among them, p i is the score of the image in the i-th category after passing through the classification network; T is the artificially set threshold; the 0th category is the normal category, and the category of the image is max(p i ), i=1~5.

[0029] For some images that are difficult to distinguish, such as samples that have been beautified with one click, there is a certain probability that they will be classified into the category of face deformation. In order to avoid missing images with low scores as much as possible, the above function can be used to select the results obtained by the classification network during the model inference stage.

[0030] In a second aspect, the present application provides a facial image beauty detection system based on optical flow estimation, the system comprising the following modules:

[0031] a preprocessing module configured to crop the face image to be processed to obtain a face region image, deform the face region image to obtain a deformed face image, and input the face region image and the deformed face image into an optical flow extraction network in pairs; and

[0032] An optical flow extraction module is configured to extract features of the face region image and the face deformation image respectively, fuse the features, and use a deconvolution network to perform optical flow extraction on the image after feature fusion to obtain an optical flow field image; and

[0033] A feature fusion module is configured to downsample the face image to be processed to obtain a downsampled image, input the downsampled image and the image to be processed into an optical flow field detection network for two-layer cascade feature fusion to obtain a first feature map, perform a deconvolution operation on the first feature map once to obtain a second feature map, and continue to perform multiple deconvolution operations on the second feature map to obtain a third feature map; and

[0034] The difference calculation module is configured to respectively calculate the common differences between the first feature map, the second feature map, the third feature map and the optical flow field image, and back-propagate to the optical flow field detection network until the optical flow field detection network converges.

[0035] In some embodiments, the formula used in the difference calculation module to respectively calculate the common differences between the first feature map, the second feature map, and the third feature map and the optical flow field images of corresponding sizes is:

[0036]

[0037] Among them, W and H are the width and height of the optical flow field image, respectively, and ij represents the pixel coordinates.

[0038] In some embodiments, the system also includes a classification module, which is configured to use an attention mechanism classification network GCnet to identify and classify the facial images to be processed. The classification results include whitening, skin smoothing, bronzer, one-click skin beautification and face deformation. The optical flow extraction in the optical flow extraction module is performed on the images whose output classification results are one-click skin beautification and face deformation to generate an optical flow field image.

[0039] In some embodiments, in the classification module, the following function is used to output the classification result:

[0040]

[0041] Among them, p i is the score of the image in the i-th category after passing through the classification network; T is the artificially set threshold; the 0th category is the normal category, and the category of the image is max(p i ), i=1~5.

[0042] In some embodiments, the pre-processing module includes:

[0043] A positioning module configured to use a face detection algorithm to locate a face position frame [x0, y0, w, h], where x0, y0, w, h represent a horizontal axis starting point, a vertical axis starting point, a width, and a height of the face position frame, respectively; and

[0044] an enlargement module, configured to enlarge the face position frame by two times to obtain an enlarged face position frame [x0-w / 2, y0-h / 2, 2*w, 2*h]; and

[0045] The cropping module is configured to crop the image to be processed according to the face position frame to obtain a face area image.

[0046] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above methods is implemented.

[0047] The embodiment of the present application provides a facial image beautification detection method and system based on optical flow estimation, which adopts a deep convolutional neural network based on multi-classification. The powerful feature extraction capability of the network can cover the transformation capabilities of various facial skin color beautification methods; samples are produced using a variety of software and face deformation methods to meet diverse detection needs; and image segmentation is performed using a two-layer cascade feature fusion method, so that the optical flow field prediction based on a single image can achieve better performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0049] Figure 1 is a flowchart of a facial image beauty detection method based on optical flow estimation according to an embodiment of the present application;

[0050] Figure 2 is an overall framework flow chart according to an embodiment of the present application;

[0051] Figure 3 is a simplified schematic diagram of an optical flow field extraction network according to an embodiment of the present application;

[0052] Figure 4 is a simplified schematic diagram of an optical flow field detection network according to an embodiment of the present application;

[0053] Figure 5 is a schematic diagram of feature fusion according to an embodiment of the present application;

[0054] Figure 6 is a flow chart of a facial image beauty detection system based on optical flow estimation according to an embodiment of the present application;

[0055] Figure 7 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

[0056] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0057] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0058] Figure 1 A flowchart of a facial image beauty detection method based on optical flow estimation according to an embodiment of the present application is shown. Figure 2 The overall framework flow chart of an embodiment of the present application is shown in FIG. Figure 1 and Figure 2 , the method 100 comprises the following steps:

[0059] S110, cropping the face image to be processed to obtain a face region image (I_Crop), deforming the face region image to obtain a face deformation image (I_Transform), and inputting the face region image (I_Crop) and the face deformation image (I_Transform) into an optical flow extraction network in pairs;

[0060] In this embodiment, in step S110, a face image to be processed is obtained, and a face position frame in the face image to be processed can be located using a face detection algorithm, and the image to be processed is cropped according to the face position frame to obtain a face region image (I_Crop);

[0061] Specifically, it includes the following sub-steps:

[0062] S111. Use a face detection algorithm to locate a face position frame [x0, y0, w, h], where x0, y0, w, h represent the horizontal axis starting point, vertical axis starting point, width, and height of the face position frame, respectively;

[0063] S112, enlarging the face position frame by two times to obtain an enlarged face position frame [x0-w / 2, y0-h / 2, 2*w, 2*h]; and

[0064] S113, cropping the image to be processed according to the face position frame to obtain a face area image.

[0065] Through this operation, the area containing the face in the image to be processed can be quickly cropped.

[0066] In step S110, the face region image is deformed, and software including Photoshop or Meitu Xiuxiu can be used to beautify (e.g., whiten, smoothen, bronze, one-click skin beautify) or deform the face region image, or a method including moving least squares method can be used to deform the face region image. The specific degree of operation can be randomly adjusted and set according to the APP.

[0067] Among them, whitening mainly improves the brightness of the image; skin smoothing uses filters to smooth the image, reducing the inconspicuous edges; bronzer changes the color distribution of the image; one-click skin beautification is a combination of slight whitening and slight skin smoothing, and may even cause a low degree of face deformation. The above categories are subjectively simpler. However, in the face deformation category, some deformation operations are not obvious, such as shrinking the nose, which is not easy to detect and occupies a small proportion of the image.

[0068] In order to distinguish images with slight differences, in this embodiment, the attention mechanism classification network GCnet is used to identify and classify the face images to be processed. The face beauty classification network using the attention mechanism can achieve an accuracy of 80%, which can improve the classification accuracy by more than 5% compared with the network that does not use this module. As the number of samples gradually increases, the network performance will also gradually improve. In order to enable the network to more accurately identify different categories, this application used tens of thousands of convolutional feature maps (I_Scale) for training during the experiment. The classification results include whitening, skin grinding, bronze, one-click skin beautification and face deformation. When the classification model is in a convergence state, the training is stopped.

[0069] Although the use of the attention mechanism classification network can improve the classification accuracy, there are still some images that are difficult to distinguish. For example, samples that have been beautified with one click have a certain probability of being classified into the face deformation category. In order to avoid missing images with low scores, the following function can be used to select the results obtained by the classification network during the model inference stage.

[0070]

[0071] Among them, p i is the score of the image in the i-th category after passing through the classification network; T is the artificially set threshold; the 0th category is the normal category, and the category of the image is max(p i ), i=1~5.

[0072] For the images whose classification results are one-key skin beautification and face deformation, the optical flow extraction in step S120 is performed to generate an optical flow field image.

[0073] S120, extracting features of the face region image and the face deformation image respectively, fusing the features, and using a deconvolution network to extract optical flow from the image after feature fusion to obtain an optical flow field image;

[0074] In this embodiment, the face region image (I_Crop) and the face deformation image (I_Transform) are input into the optical flow extraction network in pairs. Figure 3 FIG. 1 shows a simplified schematic diagram of an optical flow field extraction network of an embodiment of the present application, wherein C is convolution + Relu activation, DC is deconvolution + Relu activation, and FMM is a feature fusion module. Figure 3 As shown, the upper branch of the optical flow extraction network extracts the features of the face region image (I_Crop), and the lower branch extracts the features of the face deformation image (I_Transform), and uses the feature matching module for feature fusion, and then uses multiple deconvolution networks to extract optical flow, and obtains the optical flow field image (GroundTruth, replaced by GT) as the sample for training the optical flow field detection network in step S140. It should be understood that step S120 is unnecessary during reasoning, that is, it is unnecessary when detecting a new image to be processed.

[0075] S130, downsampling the face image to be processed to obtain a downsampled image, inputting the downsampled image and the image to be processed into an optical flow field detection network, and performing two-layer cascade feature fusion to obtain a first feature map, performing a deconvolution operation on the first feature map to obtain a second feature map, and continuing to perform multiple deconvolution operations on the second feature map to obtain a third feature map; and

[0076] S140, respectively calculating the common differences between the first feature map, the second feature map, the third feature map and the optical flow field image, and back-propagating them to the optical flow field detection network until the optical flow field detection network converges.

[0077] In this embodiment, the detection of the face deformation area is achieved by detecting the deformation optical flow field. Figure 4 A simplified schematic diagram of an optical flow field detection network of an embodiment of the present application is shown, where C is convolution + Relu activation, DC is deconvolution + Relu activation, GT is the Ground Truth segmentation map of the original image, and 1 / 2, 1 / 4, 1 / 8, and 1 / 16 respectively represent the ratio of the size of the image to be processed. Figure 4As shown in FIG, the optical flow field detection network adopts a two-layer cascade feature fusion method. The input image with full resolution is downsampled by a factor of 2 to form a cascade input for the medium resolution and high resolution branches.

[0078] Specifically, the input of the upper path is the image after downsampling the image to be processed (Image) by a factor of 2, and the input of the lower path is the original image of the image to be processed (Image). After multiple convolution layers, the upper path is subjected to feature fusion with the lower path, followed by multi-layer deconvolution operations, and the optical flow field image (Ground Truth, replaced by GT) is output. Since the feature map size of the upper path is 1 / 16 of the original image after multi-layer convolution, and the feature map size of the lower path is 1 / 8 of the original image after multi-layer convolution, before feature fusion, the feature map of the upper path is first deconvoluted to increase its resolution by two times, and then summed with the feature map of the lower path. This method is called a multi-level label-guided strategy, which can enhance the learning process of each branch. Use real labels of different sizes (1 / 8, 1 / 4) to guide the learning stage of the middle layers of the upper and lower pathways. Suppose the feature map after feature fusion is the first feature map (P1), the feature map when deconvolved to 1 / 4 size is the second feature map (P2), and the final output feature map is the third feature map (P3). Calculate the common differences of 1 / 8, 1 / 4 and original sizes of the network feature map Pi and the optical flow field image (Ground Truth, replaced by GT) respectively. The difference is calculated according to the following formula and back-propagated to the optical flow field detection network until convergence.

[0079]

[0080] Among them, W and H are the width and height of the optical flow field image, respectively, and ij represents the pixel coordinates.

[0081] Based on the optical flow field obtained by the optical flow field detection network, face restoration is performed by inverse distortion, and the difference map between the restored image and the original image is calculated. The size and area of ​​the face deformation can be perceived from the human eye's visual perspective.

[0082] Figure 5 FIG. 1 shows a schematic diagram of feature fusion of an embodiment of the present application, wherein DefConv is a deformable convolution and Sim is a similarity calculation. Figure 5 As shown, the feature fusion method mentioned above in this application is specifically: the features after the deconvolution operation of the upper channel and the features of the lower channel are respectively subjected to deformation convolution operation (because face deformation generally causes pixel deformation), and the deformation convolution operation is kept the same size before and after, and then the features after the deformation convolution are subjected to similarity calculation operation. The similarity calculation operation is as follows:

[0083] 1) Let the point at (x, y) of the upper path feature graph be x1, and the point at (x, y) of the lower path feature graph be x2.

[0084] 2) With x1 and x2 as the center, k is the offset, and this application sets the offset to 5.

[0085] 3) Calculate the similarity of a matrix centered on x1 and x2 with a length and width of 5 respectively. The value of the similarity is the value of the feature map at (x, y) after the fusion operation.

[0086] A multi-category convolutional neural classification network is used to distinguish various facial skin color beautification and face deformation; then the face deformation is regarded as an optical flow field, through which the probability of face deformation and the heat map of the deformation area can be obtained, and finally the face deformation inverse operation is performed according to the optical flow field to restore the face image before deformation; the face deformation probability, the heat map of the deformation area, and the comparison difference map between the restored face and the deformed face are used as the basis for face beauty tampering.

[0087] This application proposes a facial image beautification detection method based on optical flow estimation, which uses a classification convolutional neural network to distinguish beautification categories, covers the detection capabilities of various facial skin color beautification and facial deformation categories, and improves the performance of facial tampering detection based on skin color beautification. Use a more excellent image segmentation network based on two-layer cascade feature fusion to predict the optical flow field of a single image, predict the deformation probability and deformation area of ​​the facial image, restore the image based on the optical flow field, calculate the difference map from the deformed image and the restored image, and finally use the facial deformation probability, deformation area heat map and difference map as the basis for facial tampering. It shows good performance in facial deformation.

[0088] Further references Figure 6 As an implementation of the above method, the present application provides an embodiment of a facial image beauty detection system based on optical flow estimation. Figure 1 Corresponding to the method embodiment shown, the system can be specifically applied to various electronic devices. The system 200 includes:

[0089] A preprocessing module 210 is configured to crop the face image to be processed to obtain a face region image, deform the face region image to obtain a deformed face image, and input the face region image and the deformed face image into an optical flow extraction network in pairs; and

[0090] The optical flow extraction module 220 is configured to extract features of the face region image and the face deformation image respectively, fuse the features, and use a deconvolution network to perform optical flow extraction on the image after feature fusion to obtain an optical flow field image; and

[0091] The feature fusion module 230 is configured to downsample the face image to be processed to obtain a downsampled image, input the downsampled image and the image to be processed into an optical flow field detection network to perform two-layer cascade feature fusion to obtain a first feature map, perform a deconvolution operation on the first feature map once to obtain a second feature map, and continue to perform multiple deconvolution operations on the second feature map to obtain a third feature map; and

[0092] The difference calculation module 240 is configured to respectively calculate the common differences between the first feature map, the second feature map, the third feature map and the optical flow field image, and back-propagate to the optical flow field detection network until the optical flow field detection network converges.

[0093] In some embodiments, the formula used by the difference calculation module 240 to respectively calculate the common differences between the first feature map, the second feature map, and the third feature map and the optical flow field images of corresponding sizes is:

[0094]

[0095] Among them, W and H are the width and height of the optical flow field image, respectively, and ij represents the pixel coordinates.

[0096] In some embodiments, the system 200 also includes a classification module 250, which is configured to use an attention mechanism classification network GCnet to identify and classify the facial images to be processed, and the classification results include whitening, skin smoothing, bronzer, one-click skin beautification and face deformation. The optical flow extraction in the optical flow extraction module is performed on the output image whose classification results are one-click skin beautification and face deformation to generate an optical flow field image.

[0097] In some embodiments, in the classification module 250, the following function is used to output the classification result:

[0098]

[0099] Among them, p i is the score of the image in the i-th category after passing through the classification network; T is the artificially set threshold; the 0th category is the normal category, and the category of the image is max(p i ), i=1~5.

[0100] In some embodiments, the pre-processing module 210 includes:

[0101] A positioning module 211 is configured to use a face detection algorithm to locate a face position frame [x0, y0, w, h], where x0, y0, w, h represent the horizontal axis starting point, vertical axis starting point, width and height of the face position frame respectively; and

[0102] The enlargement module 212 is configured to enlarge the face position frame by two times to obtain an enlarged face position frame [x0-w / 2, y0-h / 2, 2*w, 2*h]; and

[0103] The cropping module 213 is configured to crop the image to be processed according to the face position frame to obtain a face area image.

[0104] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the above methods is implemented.

[0105] like Figure 7 As shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage part 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the system 300 are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0106] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.

[0107] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0108] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] The modules involved in the embodiments described in the present application may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an acquisition module, an analysis module, and an output module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0111] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A facial image beauty detection method based on optical flow estimation, characterized in that: The following steps are involved: S110, cropping the face image to be processed to obtain a face region image, deforming the face region image to obtain a deformed face image, and inputting the face region image and the deformed face image into an optical flow extraction network in pairs; The optical flow extraction network includes convolution + Relu activation, deconvolution + Relu activation and feature fusion modules, the upper branch of the optical flow extraction network is used to extract the features of the face area image, and the lower branch of the optical flow extraction network is used to extract the features of the face deformation image; S120, extracting features of the face region image and the face deformation image respectively, fusing the features, and performing optical flow extraction on the image after feature fusion using a deconvolution network to obtain an optical flow field image; S130, downsampling the face image to be processed to obtain a downsampled image, inputting the downsampled image and the face image to be processed into an optical flow field detection network, and performing two-layer cascade feature fusion to obtain a first feature map, performing a deconvolution operation on the first feature map to obtain a second feature map, and continuing to perform multiple deconvolution operations on the second feature map to obtain a third feature map; as well as The optical flow detection network includes convolution + Relu activation, deconvolution + Relu activation and the segmentation map of the extracted optical flow field GroundTruth original image. The input image with full resolution is downsampled by two layers of cascade feature fusion to form a cascade input for medium resolution and high resolution branches; S140, respectively calculating common differences between the first feature map, the second feature map, and the third feature map and the optical flow field image, and back-propagating them to the optical flow field detection network until the optical flow field detection network converges.

2. The method for facial image beauty detection based on optical flow estimation according to claim 1, characterized in that: In step S140, the formula used to calculate the common differences between the first feature map, the second feature map, and the third feature map and the optical flow field image of corresponding size is: Among them, W and H are the width and height of the optical flow field image, respectively, and ij represents the pixel coordinates.

3. The method for facial image beauty detection based on optical flow estimation according to claim 1, characterized in that: In step S110, the face image to be processed is cropped to obtain a face region image, and the face region image is deformed to obtain a deformed face image, which specifically includes: Acquire a face image to be processed, use a face detection algorithm to locate a face position frame in the face image to be processed, and crop the face image to be processed according to the face position frame to obtain the face area image; The face area image is deformed by using software including Photoshop or Meitu XiuXiu to beautify or deform the face area image, or by using a method including moving least squares method to deform the face area image.

4. The method for facial image beauty detection based on optical flow estimation according to claim 3, characterized in that: Using a face detection algorithm to locate a face position frame in the face image to be processed specifically includes the following steps: S111. Use a face detection algorithm to locate a face position frame [x0, y0, w, h], where x0, y0, w, h represent the horizontal axis starting point, vertical axis starting point, width, and height of the face position frame, respectively; S112: Enlarge the face position frame by two times to obtain an enlarged face position frame [x0-w / 2,y0-h / 2,2*w,2*h]; and S113: Crop the face image to be processed according to the face position frame to obtain the face area image.

5. The method for facial image beauty detection based on optical flow estimation according to claim 1, characterized in that: It also includes using the attention mechanism classification network GCnet to identify and classify the face image to be processed, the classification results include whitening, skin smoothing, bronze, one-click skin beautification and face deformation, and performing optical flow extraction in step S120 on the output image whose classification results are one-click skin beautification and face deformation to generate the optical flow field image.

6. The method for facial image beauty detection based on optical flow estimation according to claim 5, characterized in that: The following functions are used to output the classification results: Among them, p i is the score of the image in the i-th category after passing through the classification network; T is the artificially set threshold; the 0th category is the normal category, and the category of the image is max(p i ), i=1~5.

7. A facial image beauty detection system based on optical flow estimation, characterized in that: Includes the following modules: A preprocessing module is configured to crop the face image to be processed to obtain a face region image, and deform the face region image to obtain a deformed face image, and input the face region image and the deformed face image into an optical flow extraction network in pairs; The optical flow extraction network includes convolution + Relu activation, deconvolution + Relu activation and feature fusion modules, the upper branch of the optical flow extraction network is used to extract the features of the face area image, and the lower branch of the optical flow extraction network is used to extract the features of the face deformation image; as well as An optical flow extraction module is configured to extract features of the face region image and the face deformation image respectively, fuse the features, and use a deconvolution network to perform optical flow extraction on the image after feature fusion to obtain an optical flow field image; as well as a feature fusion module configured to downsample the face image to be processed to obtain a downsampled image, input the downsampled image and the face image to be processed into an optical flow field detection network for two-layer cascade feature fusion to obtain a first feature map, perform a deconvolution operation on the first feature map once to obtain a second feature map, and continue to perform multiple deconvolution operations on the second feature map to obtain a third feature map; The optical flow detection network includes convolution + Relu activation, deconvolution + Relu activation and the segmentation map of the extracted optical flow field GroundTruth original image. The input image with full resolution is downsampled by two layers of cascade feature fusion to form a cascade input for medium resolution and high resolution branches; as well as The difference calculation module is configured to respectively calculate the common differences between the first feature map, the second feature map, the third feature map and the optical flow field image, and back-propagate to the optical flow field detection network until the optical flow field detection network converges.

8. The system according to claim 7, characterized in that The formula used in the difference calculation module to respectively calculate the common differences between the first feature map, the second feature map, and the third feature map and the optical flow field image of corresponding size is: Among them, W and H are the width and height of the optical flow field image, respectively, and ij represents the pixel coordinates.

9. The system according to claim 7, characterized in that It also includes a classification module, which is configured to use the attention mechanism classification network GCnet to identify and classify the face image to be processed. The classification results include whitening, skin smoothing, bronze, one-click skin beautification and face deformation. The optical flow extraction in the optical flow extraction module is performed on the image whose output classification results are one-click skin beautification and face deformation to generate the optical flow field image.

10. The system according to claim 9, characterized in that In the classification module, the following functions are used to output the classification results: Among them, p i is the score of the image in the i-th category after passing through the classification network; T is the artificially set threshold; the 0th category is the normal category, and the category of the image is max(p i ), i=1~5.

11. The system according to claim 7, characterized in that The preprocessing module comprises: A positioning module configured to use a face detection algorithm to locate a face position frame [x0, y0, w, h], where x0, y0, w, h represent a horizontal axis starting point, a vertical axis starting point, a width, and a height of the face position frame, respectively; and an enlargement module, configured to enlarge the face position frame by two times to obtain an enlarged face position frame [x0-w / 2, y0-h / 2, 2*w, 2*h]; and The cropping module is configured to crop the face image to be processed according to the face position frame to obtain the face area image.

12. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 6 when executed by a processor.