# Multi-Focus Microscopy Image Fusion Based on Swin Transformer Architecture
## 4 Experiments
### Experiment Details  
To evaluate the effectiveness of the transformer architecture in multi-focus image fusion, we compared the fusion performance of our Swin-Transformer fusion model with representative end-to-end methods.  
We conducted comparisons with the SOTA unsupervised deep learning fusion model, called FusionDN [70], which employs a unified densely connected network to fuse images. Additionally, our models applied the same fusion rules as the IFCNN [62], which is a representative fusion framework based on the convolutional neural network. Therefore, we compared our fusion models with the IFCNN framework with the elementwise-maximum, elementwise-mean and elementwise-sum fusion rules, referred to as IFCNN-MAX, IFCNN-MEAN and IFCNN-SUM, respectively. Furthermore, we used the fusion result from four existing fusion models for validation: an unsupervised adversarial network with adaptive and gradient joint constrains (MMF-GAN) [71], a fast unified network based on proportional maintenance of gradient and intensity (PMGI) [72], a novel unified and unsupervised end-to-end image fusion network (U2 Fusion) [63] and a novel general image fusion framework based on cross-domain long-range learning and the Swin Transformer (Swin fusion) [73]. Moreover, we conducted a comparison with recent SOTA fusion models, a novel memory unit architecture for image fusion (MUFusion) [74] and one of the first zero-shot models for image fusion (ZMFF) [75].  
In this study, the complex wavelet extended-depth-of-field method, which remains the traditional gold standard method for image fusion [76], was utilized to generate the ground truth for multi-focus microscope image fusion. To perform image fusion with this method, we used ImagJ (v1.54b) software [77] with the extended-depth-of-field plugin ([[http://bigwww.epfl.ch/demo/edf/](http://bigwww.epfl.ch/demo/edf/)]([http://bigwww.epfl.ch/demo/edf/](http://bigwww.epfl.ch/demo/edf/)) (accessed on 25 May 2023)).  
To evaluate the performance of the different models, we employed three widely used metrics: mean square error (_MSE_), peak signal-to-noise ratio (_PSNR_) and structure similarity index (_SSIM_). _MSE_ and _PSNR_ are commonly used metrics for objective image quality assessment, which can be expressed as follows:  
\[MSE=\frac{1}{mn}\sum_{i=0}^{m-1}\sum_{j=0}^{n-1}[GT(i,j)-F(i,j)]^{2} \tag{15}\]  
\[PSNR=10\cdot log_{10}(\frac{255^{2}}{MSE}) \tag{16}\]  
_MSE_ can quantify the discrepancy between the ground truth and fused image at the pixel level, while _PSNR_ represents the ratio between effective information and noise in the fused image. However, _MSE_ and _PSNR_ do not account for the spatial arrangement of the pixels, which is essential for image quality assessment [78]. Moreover, _MSE_ and _PSNR_ are easily dominated by local outliers. To overcome the weakness of _MSE/PSNR_, a new metric, named the structural similarity (_SSIM_) index, has been developed to consider location knowledge during a quality assessment experiment [79], which can be expressed as:  
\[SSIM=L(GT,F)\cdot C(GT,F)\cdot S(GT,F) \tag{17}\]  
Here, \(L\), \(C\) and \(S\) correspond to luminance, contrast and structural similarity, respectively.