# Multi-Task Learning for Medical Image Inpainting Based on Organ Boundary Awareness
## 4 Experiments and Results
### Evaluation Criterion  
Following research [3] in the medical inpainting field, we use common evaluation metrics such as structural similarity index for measuring image quality (SSIM) [39], peak signal-to-noise ratio (PSNR), mean squared error (MSE), and universal image quality index (UQI) [40] to quantify the performance of the models. Our research conducted experiments on both settings of square-shaped holes and arbitrary-shaped holes. The metric PSNR and MSE are defined as:  
\[PSNR=10 log_{10}\left(\frac{k_{max}^{2}}{MSE}\right) \tag{7}\]  
\[MSE=\frac{1}{m\times n}\sum_{i=1}^{m}\sum_{j=1}^{n}\left(k_{ij}-\left(k_{0} \right)_{ij}\right)^{2} \tag{8}\]  
where MSE represents mean squared error, and the maximum value is denoted by \(k_{max}\), particularly for 8-bit images \(k_{max}=255\). The better the image quality, the higher the PSNR. Structural similarity (SSIM) is seen to be a stronger parameter for evaluating picture consistency which is within the range [0,1], with a score close to 1 indicating better conservation of the structure. This metric is based on the visual perception characteristic of humans. The SSIM is calculated between two commonly sized windows \(A\times B\).  
\[SSIM=\frac{(2\mu_{\omega_{1}}\mu_{\omega_{2}}+c_{1})(2\sigma_{\omega_{1}\omega _{2}}+c_{2})}{({\mu_{\omega_{1}}}^{2}+{\mu_{\omega_{2}}}^{2}+c_{1})({\sigma_ {\omega_{1}}}^{2}+{\sigma_{\omega_{2}}}^{2}+c_{2})} \tag{9}\]  
where \(\mu_{\omega_{i}},{\sigma_{\omega_{i}}}^{2}\) are the average and the variance of window \(\omega_{i}\), respectively. The covariance is denoted by \(\sigma_{\omega_{1}\omega_{2}}\) and \(c_{1},\ c_{2}\) are numerical stabilizing parameters. We also used the metric UQI, which is the predecessor of SSIM, to evaluate our proposed methods with other methods. Let \(I_{gt}=\left\{I_{gti}\left|\ i=1,2,\ldots,Z\right.\right\}\) and \(I_{pred}=\left\{I_{predi}\left|\ i=1,2,\ldots,Z\right.\right\}\) be the ground truth and the predicted image, respectively. The metric UQI is defined as:  
\[UQI=\frac{\sigma_{I_{gt}}I_{pred}}{\sigma_{I_{pred}}\sigma_{I_{pred}}}.\frac{2 \overline{I_{gt}}\overline{I_{pred}}}{\left(\overline{I_{gt}}\right)^{2}+ \left(\overline{I_{pred}}\right)^{2}}.\frac{2\sigma_{I_{gt}}\sigma_{I_{pred}}} {\sigma^{2}I_{gt}+\sigma^{2}I_{pred}}, \tag{10}\]  
where the dynamic range of \(UQI\) is [\(-\)1,1]. One can achieve the highest value 1 if and only if \(I_{predi}=I_{gt_{i}}\) for all \(i=1,2,\ldots,Z\). The lowest value of \(-1\) occurs when \(I_{predi}=2\overline{I_{gt}}-I_{gt_{i}}\) for all \(i=1,2,\ldots,Z\). The element \(\frac{\sigma_{I_{gt}}I_{pred}}{\sigma_{I_{gt}}\sigma_{pred}}\) is defined as the correlation coefficient between ground truth image \(I_{gt}\) and predicted image \(I_{pred}\), and the value of this element is in the range [\(-\)1,1]. The element \(\frac{2\overline{I_{gt}}\overline{I_{pred}}}{\left(\overline{I_{gt}}\right)^{2 }+\left(\overline{I_{pred}}\right)^{2}}\), with a value range of [0,1], computes how close the mean luminance is between ground truth image \(I_{gt}\) and predicted image \(I_{pred}\). It equals 1 if and only if \(\overline{I_{gt}}=\overline{I_{pred}}\). The last element \(\frac{2\overline{I_{gt}}\sigma_{pred}}{\sigma^{2}I_{gt}+\sigma^{2}I_{pred}}\) presents how similar the contrasts of the images are. The value of this element is in the range [\(-\)1,1], where the best value 1 is obtained if and only if \(\sigma_{I_{gt}}=\sigma_{I_{pred}}\).