| People have become increasingly conscious of their image in recent years with the popularity of social media platforms.At the same time,mobile phones and other intelligent terminals continue to improve their photographic and video hardware capabilities,taking pictures at increasingly higher resolutions and improving their ability to show details.While people share selfies on social media platforms to showcase their image,the flaws on their skin are also clearly visible.This thesis focuses on the detection and repair of face flaws,aiming to preserve skin texture details while removing flaws such as blemishes,acne and pores from the face.The specific research content and results of the thesis are as follows:(1)This thesis proposes a face flaw detection algorithm based on highresolution representation and Vision Transformer to address the challenges of irregular face flaw shapes and inconspicuous edges.To maintain a high-resolution representation during the feature extraction phase,the model uses high-resolution encoders in parallel to connect high-and low-resolution subnetworks and obtains more accurate spatial information on flaws by repeated multi-scale fusion.To address the problem of poor detection of dense defect areas overlapping each other,the model uses the Vision Transformer detection head to collect the dependencies between blocks of image features,improving the ability to detect dense defects that overlap each other.Experimental results on the face flaw dataset show that the model proposed in the paper improves by 3.23%in mAP and 5.33%in accuracy compared to the baseline model.(2)In order to obtain a pixel-level accuracy of the flaws region for more accurate restoration of face flaws,this thesis proposes a face flaw instance segmentation model based on multi-level feature fusion.The model introduces weighted bidirectional pyramidal aggregation of features extracted from the backbone at different resolutions in a one-stage segmentation network,enhancing the model’s ability to dynamically adjust to targets at different scales and obtain a feature map with richer semantic information.To improve the model’s ability to segment irregular flaws,the convolutional structure is optimized using deformable convolutions in the backbone network and mask branches.To solve the problem of gradient instability of the loss function during small defect segmentation,the thesis adds smoothing coefficients to the Dice coefficients.It also introduces the binary cross-entropy loss for focusing on the local information of pixel points to guide the mask branch to generate higher quality mask.The experimental results show that the model proposed in the paper improves 5.86%in mAP on the face flaws segmentation task compared to the baseline model.(3)This thesis designs and implements two-stage flaw detection and repair model,and a high-resolution flaw online detection and repair system.The first stage of the flaw detection and restoration model uses the flaw instance segmentation model and the flaw target detection model presented in thesis to obtain the exact location of the flaw and generate the mask of the flawed area.The second stage,after generating the mask of flawed area,feeds the original image and the mask into the flaw restoration network to restore the flawed area.Finally,the online defect detection and repair system for high-resolution images was implemented based on the B/S architecture to remove flaws from high-resolution portraits,resulting in high-resolution,natural and realistic images that retain the details of the human face. |