The problem of inpainting entails recovering the content of missing regions in an image and producing a visually realistic and semantically meaningful image.It has a wide range of applications,such as object removal in image editing technology,old photo restoration,watermark removal,etc.Although image inpainting models based on deep learning methods have made innovative progress in recent years,there are still many problems worthy of research.Firstly,most existing deep learning-based image inpainting models use vanilla convolutions layers as building blocks.However,since vanilla convolutions have regular receptive fields and limited receptive fields,they are not very effective for propagating information from the known region to the missing region,which often leads to artifacts in the inpainting results.In addition,existing deep learning-based image inpainting methods generate training data by corrupting images in random regions without considering the predictability of missing regions,which will damage the training process.For the first question,this paper proposes an image inpainting algorithm based on the dynamic deformable sampling mechanism,which realizes the efficient propagation of information from the effective area to the missing area.The algorithm firstly use the sampling position loss to force the sampling positions of the deformable convolution to fall into the effective area as much as possible,so as to avoid the reconstruction process of the missing area involving a large number of invalid elements.After that,the algorithm configures several different kernel size choices for deformable convolution,so that the kernel size of deformable convolution can adaptively select the appropriate kernel size according to the size of the hole.Finally,the algorithm uses a pyramid structure to progressively restore the image,so that the deformable convolution can more easily utilize the uncontaminated information in the outer region of the hole.For the second question,this paper proposes an image inpainting algorithm based on dynamic mask generators.First,the original image is fed into a dynamic mask generator to generate a mask image.After that,the output mask is fed into the image inpainting model together with the input image for training.Then,by minimizing inpainting loss while maximizing mask norm,the mask generator can learn to find large yet predictable missing regions as a better alternative to random masks.And,with the development of the above image inpainting algorithm,it may also be used for malicious operations,such as destroying evidence.Therefore,detection and localization of image inpainting operations are essential.In this paper,a dual discriminator-based detection algorithm for patched blurred regions is proposed.First,a region mask generator is trained using dual discriminators in an adversarial fashion.After that,this paper proposes a bilateral triplet mining constraint to avoid the degenerate problem,solving the problem of one discriminator defeating another discriminator so that the generator produces a region mask of much "1" or much "0".The models proposed by the methods have been tested on multiple public test sets,and compared with the existing algorithms quantitatively and qualitatively.The experimental results show that the algorithms in this paper have achieved good results. |