Font Size: a A A

Research On Image Inpainting Algorithm Based On GAN

Posted on:2024-08-25Degree:MasterType:Thesis
Country:ChinaCandidate:J C WeiFull Text:PDF
GTID:2568307106470424Subject:Mathematics
Abstract/Summary:PDF Full Text Request
Image inpainting is a significant subject of study in both computer graphics and information security research.However,traditional image inpainting methods will have problems such as blurred boundary and unnatural texture due to their reliance on manually designed algorithms and features.The rapid development of deep learning technology has enabled the extraction of advanced features from massive data.In particular,the Generative Adversarial Networks have played a significant role in image inpainting within the field of neural networks.The use of neural network models for image inpainting results in images that are more aligned with human vision in terms of both content and texture when compared to traditional methods.However,the current image inpainting models still suffer from issues such as image blurring,noise and semantic discontinuity in the inpainting area.To address the aforementioned problems,this paper presents an image inpainting model that utilizes GAN.The primary contributions of this paper are as follows:1.A two-stage image inpainting network is proposed.The model in this paper includes a generator network responsible for image inpainting and a discriminator network used to evaluate the quality of image inpainting.The generator network and discriminator network are both full convolution neural networks.The generator model proposed in this paper is mainly composed of gated convolution,dilated convolution,jump connection and two kinds of attention mechanism modules.The generator network is composed of two stages: the coarse stage image inpainting network and the refine stage image inpainting network.During the coarse stage of the generator,the network is fed with the damaged image and its corresponding mask as inputs,and the refine stage is to input the coarse stage inpainting results and the coarse stage mask.The final image result after inpainting is obtained through two-stage repair.The discriminator network takes the real image without mask processing and the repaired image as the input of the network.It evaluates the quality of image inpainting by calculating the difference between the repaired image and the real image,and feeds back to the generator network to further enhance the inpainting ability.2.Introduce two attention mechanisms modules.The first attention mechanism extracts the damaged and undamaged regions of the input image,and calculates the attention scores of the two regions.Then the input image and the attention score are input to the SE module,and different weights are assigned to the importance of different channels of the input image for the restoration task.The second attention mechanism passes the input feature map through a dilated convolution,and then performs two convolution operations on the feature map.The two convolution results are added by elements,and then multiplies them with the input feature map to obtain the final output feature map.Integrating an attention mechanism allows the model to selectively focus on specific regions of the input image during the inpainting process.Through continuous learning during the training process,the attention mechanism can update the weights and improve the model’s ability to selectively focus on image information,ultimately enhancing the quality of image inpainting.3.Optimize the loss function.By combining three distinct loss functions as the total loss function of this model,the generator model can be trained more effectively.Each loss function plays a unique role in guiding the model to generate high-quality inpainting images.Under the guidance of the loss function in this paper,the image repaired by the model can not only achieve superior image quality indicators,but also have clearer images,less obvious repair traces,more coherent details,and more cohesive overall visuals that align with the human visual experience.In the test phase,the generator can repair the damaged images of both regular masks and irregular masks,and the output results of the generator do not need any subsequent processing.This paper has carried out experimental verification on three data sets,Celeb A,Place2 and The Paris Dataset,including regular mask experiment and irregular mask experiment,and compared with several classical image inpainting models quantitatively and qualitatively.In the regular mask experiment,for the Celeb A dataset,the model in this paper improves by 6.9% and 7.5% under the SSIM and PSNR indicators,respectively,and decreases by 22% under the MAE indicator.In the irregular mask experiment,the MAE indicators of the model for the Celeb A and Places2 datasets were reduced by 16% and 23%,respectively.For the Paris Dataset datasets,the FID indicator was reduced by 5.9%.The experimental results demonstrate that the model proposed in this study can significantly enhance the quality of image inpainting,which has important scientific significance and practical value.
Keywords/Search Tags:image inpainting, convolution neural network, Generative Adversarial Network, attention mechanism, two-stage network
PDF Full Text Request
Related items