| As one of the research focuses in the field of computer graphics and image processing,portrait segmentation technology is an important part of image segmentation technology,and its application areas involve automatic driving,intelligent search and rescue,TV and film media fields,etc.It has great economic and practical value.However,the current portrait dataset suffers from rough character marking and poor accuracy and efficiency of portrait segmentation techniques.To address the above problems,this paper collects and produces a batch of portrait datasets,proposes an improved UNet for portrait segmentation with attention mechanism and a lightweight U-shaped portrait segmentation network based on deep learning techniques,and designs a portrait segmentation mobile application using the more migratory lightweight U-shaped portrait segmentation network,which makes it easy for users to perform image segmentation and dynamic segmentation even without network.The main research contents of the paper are as follows:(1)Construction of the human datesetIn this study,we collected and produced a batch of personality self-portrait dataset for model training dataset,and expanded the portrait dataset by separating the portraits in equal proportion based on mask and replacing the background image.In order to extend the way of observing the details of the portrait segmentation,the original image and the segmentation result mask are fused according to the ratio of 6:4.In this way,portrait segmentation composite mask can observe the effect of the character segmentation more carefully.(2)Improved UNet for portrait segmentation with attention mechanismThis study follows the basic architecture of UNet and performs model extension work on UNet.By deepening and widening the model based on the original UNet model,reducing number of channel fusions,adding attention mechanism in the process of downsampling and intermediate layers,adding convolutional kernels in the process of upsampling,the number of model parameters is effectively reduced and the accuracy of the model is improved.The mixed loss function is used to jointly guide the learning and training of the model improves the stability of the model training.The accuracy of the model algorithm based on Human_Matting and EG1800 public datasets is proved to be 97.2%(Matting)and96.8%(EG1800),the IOU is 97.9%(Matting)and 97.5%(EG1800),and the Dice coefficient is 96.5%(Matting)and 96.3%(EG1800),respectively.(3)Lightweight U-shaped portrait segmentation networkIn this study,based on the improved UNet portrait segmentation algorithm with attention mechanism,to address the problem of poor model lightness and mobility,the model structure is further lightened and is pruned operation.Using the lightweight network Mobile Net V2 as the backbone network,pruning the middle layer,streamlining the convolutional kernels in the encoder,using the attention mechanism and so on to improve the lightweight degree of the model.And using the mixed loss function to jointly guide the learning and training of the model,which makes the model have stronger mobility,better detail retention,and stronger performance and it lays the foundation for the design and implementation of mobile applications for portrait segmentation.The accuracy of the model algorithm based on Human_Matting and EG1800 public datasets is proved to be98.4%(Matting)and 98.0%(EG1800),the IOU is 98.6%(Matting)and 98.3%(EG1800),and the Dice coefficient is 97.3%(Matting)and 97.0%(EG1800),respectively.(4)Design and implementation of an application for portrait segmentationBased on the user demand for a tool-based portrait segmentation application,this study designs and implements an Android-based portrait segmentation mobile application that enables image segmentation and dynamic segmentation.The mobile application is based on Android Studio for application development,using Tensor Flow Lite framework to transform and port the lightweight U-shaped portrait segmentation network.Using the UI interface design and the main functional technical architecture performs the design and construction of APP.Test and evaluation of Human_Matting and EG1800 public datasets using two mainstream phones on the market.According to the experimental results,the mobile application runs smoothly.It only takes 0.3s to process 600*800 RGB pictures on Huawei phone,which can better meet the user’s expectation of use. |