# Dense-FG: A Fusion GAN Model by Using Densely Connected Blocks to Fuse Infrared and Visible Images
## 4 Experiments and Results  
### Experimental Design and Evaluation Metrics  
The experiment in this article used some of the data from the TNO dataset [31], selecting 40 pairs of infrared and visible images as the training set, and 20 pairs of infrared and visible images as the test set. In the generator loss function, the weight coefficient of the content loss term is set to \(\lambda=100\); \(\lambda\) is an experience value. The weight coefficient of the infrared and visible intensity gradient loss term is set to \(\beta_{1}=1.2\), \(\beta_{2}=5\), \(\beta_{3}=1\), \(\beta_{4}=3\). The experimental environment is based on the TensorFlow framework, CUDA version 11.6, and the graphics card used is the GeForce RTX 3090 Ti. Objective evaluation can provide quantitative evaluation metrics, while subjective evaluation can better reflect human visual perception and preferences. Therefore, when evaluating the image fusion effect, objective evaluation and subjective evaluation can be combined to comprehensively consider the evaluation results and obtain more accurate and comprehensive evaluations. To objectively evaluate the quality of fused images, for this article we selected spatial frequency (SF), entropy (EN), sum of the correlation of differences (SCD), average gradient (AG) [32], standard deviation (SD), structural similarity index measurement (SSIM) [33], peak signal-to-noise ratio (PSNR) [34], edge preservation degree (\(Q_{F}^{A/B}\)) [35], visual information fidelity (VIF) [36; 37], and mutual information (MI) [38] as evaluation indicators. Let \(A(x,y)\) and \(B(x,y)\) represent two source images, and \(F(x,y)\) represent the blended image. \((x,y)\) represents the pixel coordinates, and \(M\times N\) represents the size of the source images and the blended image. (1) Spatial frequency (SF), which reflects the change rate of image grayscale, is defined as  
\[SF=\sqrt{RF^{2}+CF^{2}}. \tag{9}\]Among them, RF and CF represent the row frequency and column frequency of the fused image, respectively, as shown in formulas (10) and (11). \[RF=\sqrt{\sum_{i=1}^{M}\sum_{j=1}^{N}\left(F(i,j)-F(i,j-1)\right)^{2}}, \tag{10}\]  
\[CF=\sqrt{\sum_{i=1}^{M}\sum_{j=1}^{N}\left(F(i,j)-F(i-1,j)\right)^{2}}. \tag{11}\]  
Generally speaking, the larger the spatial frequency value of the image, the richer the texture detail information it contains. (2) Entropy (EN), which is used to measure the amount of information contained in an image, is defined as follows:  
\[EN=-\sum_{i=0}^{255}p_{i}\text{log}_{2}p_{i}, \tag{12}\]  
where \(p_{i}\) represents the normalized histogram of the gray level i in the fused image. The larger the EN value, the richer the information of the fused image and the better the quality. (3) The sum of the correlation of differences (SCD), which uses the correlation between the difference images calculated from the source image and the fused image, is defined as follows:  
\[SCD=r_{D_{A}A}+r_{D_{B}B}, \tag{13}\]  
where \(D_{A}\) and \(D_{B}\) represent the difference between the fused image and the source images \(B\) and \(A\), respectively. \(r\) is used to calculate the correlation coefficient of \(D_{A}\) and \(D_{B}\) with the two source images. The larger the sum of differences, the more complementary information in the fused image, and the better the image fusion effect. (4) Average gradient (AG); this indicator reflects the clarity of the image to a certain extent, and is defined as:  
\[AG=\frac{1}{MN}\sum_{i=1}^{M}\sum_{j=1}^{N}\sqrt{\frac{1}{2}\left(G_{x}^{2}(i, j)+G_{y}^{2}(i,j)\right)}, \tag{14}\]  
\[\left\{ \begin{array}{l}G_{x}(i,j)=G(i,j)-G(i+1,j)\\ G_{y}(i,j)=G(i,j)-G(i,j+1)\end{array} \right.. \tag{15}\]  
The larger the average gradient value of the image, the higher the image definition, and \(G(i,j)\) represents the gradient value at the pixel point \((i,j)\). (5) The standard deviation (SD) is an indicator that reflects the degree of dispersion of image gray values relative to the mean gray value.