# Improved U-Net: Fully Convolutional Network Model for Skin-Lesion Segmentation
## 2 Materials and Methods
### Upsampling Method  
U-Net normally includes two sections: downsampling and upsampling. The authors of [29] attained accurate pixel-level localization by concatenating the downsampling and upsampling layers together. Upsampling is the most important part of the U-Net architecture, because the spatial information of the feature map is generated here. Transpose convolution (or deconvolution), having learnable parameters, is used in the upsampling section. Apart from its learnable parameters, this execution method is very time-consuming, because the kernels require additional weights for training. Moreover, it can lead to uneven overlap [35], as depicted by the checkerboard pattern of Figure 5, which causes artifacts at a variety of scales.  
We use bilinear interpolation, an alternative to standard deconvolution, in the decoder part of our model to avoid artifacts. In contrast to deconvolution, this method does not have artifacts because of its default behavior. The image coordinates, \(f(n_{10},n_{20})\), \(f(n_{11},n_{21})\), \(f(n_{12},n_{22})\) and \(f(n_{13},n_{23})\), are the nearest neighbors of \(g(n_{1},n_{2})\). The intensity values of the interpolated image \(g(n_{1},n_{2})\) are computed as follows:  
\[g(n_{1},n_{2})=A_{0}+A_{1}n_{1}+A_{2}n_{2}+A_{3}n_{1}n_{2} \tag{1}\]  
Equation (1) represents a bilinear function having coordinates \((n_{1},n_{2})\). Here, we refer to \(f\) as an intensity value at given \((n_{10},n_{20})\), \((n_{11},n_{21})\), \((n_{12},n_{22})\) and \((n_{13},n_{23})\) pixel locations before applying interpolation and \(g\) as an intensity value of interpolated image matrix in \((n_{1},n_{2})\) coordinates, and \(A\)s are the bilinear weights. The bilinear weights, \(A_{0}\), \(A_{1}\), \(A_{2}\) and \(A_{3}\), are computed by solving the matrix in Equation (2):  
\[\left[\begin{array}{c}A_{0}\\ A_{1}\\ A_{2}\\ A_{3}\end{array}\right]=\left[\begin{array}{cccc}1&n_{10}&n_{20}&n_{10}n_{20} \\ 1&n_{11}&n_{21}&n_{11}n_{21}\\ 1&n_{12}&n_{22}&n_{12}n_{22}\\ 1&n_{13}&n_{23}&n_{13}n_{23}\end{array}\right]^{-1}\left[\begin{array}{c}f(n _{10},n_{20})\\ f(n_{11},n_{21})\\ f(n_{12},n_{22})\\ f(n_{13},n_{23})\end{array}\right] \tag{2}\]  
As a result, \(g(n_{1},n_{2})\) is defined as a linear combination of the gray levels of its four nearest neighbors. The linear combination defined by Equation (1) is, in fact, the value assigned to \(g(n_{1},n_{2})\) when the perfect least-squares planar fit is made to these four neighbors. This process of optimal averaging produces smoother results. In Figure 6, we visually describe bilinear interpolation.  
In this example, we increase the size of the \(2\times 2\) matrix into a \(4\times 4\) one. According to Equation (2), the weight values of specific elements in the up-sampled matrix depend on how near this element is to known elements.  
Figure 5: Schematic illustrating an artifact caused by the transposed convolution: (**a**) checkerboard problem caused by applying a transpose convolution; (**b**) uneven overlap (with the parameters of stride 2 and size 3).  
Transpose convolution has learnable parameters for training. The number of parameters is more than 10 million in deep-neural networks, such as U-Net, because of their trainable weight and bias values in transpose convolution. Consequently, this causes adverse impacts triggered by voiding the middle layers' gradients of the U-Net models. We achieve a reduction of this detrimental impact by applying bilinear interpolation to the decoder part.