# Image Completion with Large or Edge-Missing Areas
## 3 Method
The input of the local network discriminator is a local region centered on the completed region in the generated image, which is used to maintain local consistency of the generated area with other areas. The input of the local network discriminator 2 added herein is to generate a central region of the completed region in the image for determining the accuracy of the generated content of the central region of the large-area missing regions and the local consistency with other regions. Among them, the completion network adopts an encoder-decoder structure, which includes ten convolution layers, four dilated convolution layers, two deconvolutional layers, and one output layer. Except that the first convolutional layer uses a \(5\times 5\) convolution kernel, all other convolutional layers and dilated convolutional layers use a \(3\times 3\) convolution kernel, and the deconvolutional layer uses a \(4\times 4\) convolution kernel. In [PERSON]'s method, except for the last layer in the completion network, there is a ReLU layer behind each of the convolutional layers. Since the ReLU activation function ignores the effect of a negative value, the gradient of the neuron is set to 0 when its input is a negative value, causing a \"neuron death\" phenomenon. For this defect of ReLU, this paper replaces ReLU layers with the combination of the BN layers and the Leaky_ReLU layers. The network backpropagation process is carried out by biasing the error between the actual output and the expected output obtained during the forward propagation of the network, and then adjusting the parameters of each layer of the network. When the network layers are deep, the partial derivative approaches zero when the backpropagation is close to the input layer, which is easy to fall into local optimum. The BN operation keeps the input of each layer the same distribution in the network training process, avoiding above problems. Leaky_ReLU solves the problem that when the input is negative, the output is 0 in the ReLU activation function, avoiding the problem of the gradient disappearing. In the original network structure, the discriminators train much faster than the generator, which causes the discriminator to easily distinguish which one is a natural image and which one is the generated image, but the gradient that is passed to the completion network in the backpropagation can only make it generates strange textures, which easily cause color distortion problems. In this paper, by \"widening\" the network structure, i.e., adding a local discriminator, the training speed of the two can be balanced, and the generated texture is more realistic, and pseudo-color is not generated. In addition, the last layer of the discriminators in the [PERSON]'s method uses the sigmoid activation function to obtain a continuous value in the interval \([0,1]\) to represent the probability that the image is from the real sample. Since the sigmoid function approximates the image generation problem to a two-class problem, which is easy to cause the gradient disappearance, the mode collapses, and the difficulty to reach equilibrium between generator and discriminators. This paper draws on the idea of wGAN method and removes the last sigmoid activation function, making network training more stable and easier to converge, which resulting in more realistic and clear results. The experiment is based on TensorFlow framework and implemented in python. The training process is similar to [PERSON]'s method, i.e., the completion network is iteratively trained \(T_{c}\) times; then, the three discriminator networks are trained \(T_{d}\) times; finally, the entire network is iteratively trained \(T_{train}\) times until the network is stable. The data set used in the experiment contains pictures of grass  
Figure 3: Overview of the network architecture we used. downloaded from Baidu and Google Chrome image search engine, where the training set contains 1000 images, and the test set contains 120 images.