<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xlink="http://www.w3.org/1999/xlink">
<front><article-meta>
<title-group><article-title>Enhancing Generative Adversarial Networks with Structural Similarity Index and Fuzzy Logic-Based Loss Functions (SSIM_T)</article-title></title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Farhadi Nia</surname><given-names>Bahram</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Ahangari</surname><given-names>Mohammad Reza</given-names></name><xref ref-type="aff" rid="aff2"/></contrib>
<contrib contrib-type="author"><name><surname>Ebrahimi</surname><given-names>Seyyed Javad</given-names></name><xref ref-type="aff" rid="aff2"/></contrib>
<aff id="aff1">School of Computing and Information Systems, The University of Melbourne, Parkville, VIC 3010, Australia.</aff>
<aff id="aff2">Department of Mathematics, Faculty of Basic Science, Payame Noor University (PNU), Tehran P.O. Box 19395-4697, Iran.</aff>
</contrib-group>
<abstract><p>Generative Adversarial Networks (GANs) have emerged as a powerful paradigm for unsupervised learning and generative modeling, enabling the synthesis of high-quality, realistic data across various domains. However, GAN training is notoriously challenging, often plagued by issues such as mode collapse, instability, and a lack of perceptual fidelity in generated samples. Traditional loss functions, primarily based on pixel-wise comparisons, fail to capture the complex structural and perceptual attributes of images, hindering the generation of visually compelling outputs. This paper introduces a novel loss function for GANs that integrates the Structural Similarity Index (SSIM) with fuzzy logic t-norms (SSIM_T). By leveraging SSIM_T, the proposed approach enhances perceptual similarity between generated and real images while harnessing the power of fuzzy logic to model the inherent uncertainty and nuanced relationships within image data. Theoretical analysis and extensive experiments demonstrate that SSIM_T mitigates mode collapse, stabilizes training dynamics, and produces visually coherent outputs, surpassing existing loss functions, including those based on Sugeno complements. This work bridges advancements in structural similarity metrics and fuzzy logic, offering a robust and perceptually driven framework for image-processing applications and beyond.</p></abstract>
<kwd-group kwd-group-type="author"><kwd>Generative adversarial network</kwd><kwd>Loss function</kwd><kwd>Structural similarity measure</kwd><kwd>T-norm</kwd><kwd>Fuzzy logic</kwd></kwd-group>
</article-meta></front>
<body>
<sec id="sec-1"><label>1</label><title>Introduction</title>
<sec id="sec-2"><label>1.1</label><title>A Review on Generative Adversarial Networks</title>
<p>The field of Artificial Intelligence (AI) has witnessed remarkable progress in recent years, driven by advances in machine learning and, in particular, deep learning. Within this landscape, Generative Adversarial Networks (GANs), introduced by Goodfellow et al. <xref ref-type="bibr" rid="ref-1">[1]</xref>, have revolutionized the field of generative modeling. GANs offer a unique approach to learning complex data distributions by pitting two neural networks against each other: a generator and a discriminator. The generator aims to create synthetic data that is indistinguishable from real samples, while the discriminator learns to differentiate between real and generated data. This adversarial process drives both networks to improve, leading to the generation of increasingly realistic and high-quality samples.</p>
<p>Early GANs held immense promise but were hindered by several challenges. Mode collapse, a phenomenon where the generator produces only a limited variety of outputs, severely restricts the diversity of generated data. Training instability, characterized by oscillations and non-convergence of the loss functions, makes it difficult to achieve optimal performance. Furthermore, the perceptual quality of generated images often fell short of expectations, lacking the fine details and structural coherence of real images.</p>
</sec>
<sec id="sec-3"><label>1.2</label><title>GAN Challenges</title>
<p>Over the years, researchers have proposed numerous techniques to address the limitations of traditional GANs. Wasserstein GAN (WGAN) (Arjovsky et al. <xref ref-type="bibr" rid="ref-2">[2]</xref>; Gulrajani et al. <xref ref-type="bibr" rid="ref-3">[3]</xref>) introduced the Wasserstein distance as a more robust metric for comparing distributions, leading to improved training stability. WGAN-GP Gulrajani et al. <xref ref-type="bibr" rid="ref-3">[3]</xref> further enhanced stability by adding a gradient penalty term to the loss function. Least Squares GAN (LSGAN) Mao et al. <xref ref-type="bibr" rid="ref-4">[4]</xref> employed a least squares loss function to penalize fake samples that lie far from the decision boundary, promoting more stable training. Spectral-Normalized GANs (SN-GANs) Miyato et al. <xref ref-type="bibr" rid="ref-5">[5]</xref> applied spectral normalization to the discriminator to control its Lipschitz constant, further improving stability. Self-Attention GAN (SAGAN) Zhang et al. <xref ref-type="bibr" rid="ref-6">[6]</xref> used self-attention mechanisms to capture long-range dependencies in images, enhancing the generation of fine-grained details.</p>
<p>These innovations have leading to more stable training and improved generated samples quality. However, balancing perceptual quality and diversity remains a central challenge, especially in image synthesis tasks. Traditional GAN loss functions often rely on pixel-wise differences, which fail to capture the complex structural and perceptual features that are critical for generating realistic images.</p>
</sec>
<sec id="sec-4"><label>1.3</label><title>Structural Similarity Index as a Perceptual Loss Function</title>
<p>The Structural Similarity Index (SSIM) Wang et al. <xref ref-type="bibr" rid="ref-7">[7]</xref> has emerged as a powerful metric for assessing image quality by considering luminance, contrast, and structural information. Unlike pixel-based metrics, SSIM aligns more closely with human visual perception. Integrating SSIM into GAN training as a loss function encourages the generator to produce images that are structurally similar to real images, leading to improved perceptual quality.</p>
<p>Several studies have explored the use of SSIM-based losses in GANs for various image processing tasks. These methods have shown promising results in preserving textures, enhancing details, and generating more visually plausible images. By prioritizing perceptual metrics over pixel accuracy, SSIM-based losses offer a significant advantage over traditional GAN loss functions.</p>
</sec>
<sec id="sec-5"><label>1.4</label><title>Fuzzy Logic and T-Norms for Enhanced Loss Function Design</title>
<p>Fuzzy logic provides a powerful framework for modeling uncertainty and imprecise information. T-norms, which generalize the logical AND operation, allow for the aggregation of multiple criteria in a flexible and robust manner. By incorporating fuzzy logic t-norms into GAN loss functions, we can capture nuanced relationships between image regions, improve robustness to noise, and enhance the overall quality of generated images.</p>
<p>Recent research has explored the use of fuzzy logic in GANs, demonstrating its potential to improve training stability and sample quality. For example, Sugeno complement-based loss functions Farhadinia et al. <xref ref-type="bibr" rid="ref-8">[8]</xref> introduce non-linear interactions between training and generated data, leading to improved performance. However, these approaches may suffer from saturation effects and suboptimal gradient behavior.</p>
</sec>
<sec id="sec-6"><label>1.5</label><title>SSIM_T: A Novel Approach Combining SSIM and Fuzzy Logic</title>
<p>This paper introduces a novel GAN loss function, termed SSIM_T, that combines the strengths of SSIM and fuzzy logic t-norms. SSIM_T leverages the perceptual sensitivity of SSIM to capture structural similarities between real and generated images while utilizing fuzzy logic t-norms to model the relationships between different aspects of the images. This combination allows for a more robust and flexible loss function that promotes both perceptual quality and training stability.</p>
<p>The novel contribution of this paper is using SSIM_T loss function for GANs that integrates structural similarity with fuzzy logic t-norms. A theoretical analysis demonstrating that SSIM_T outperforms existing loss functions, including Sugeno complement-based formulations. Extensive experimental results on benchmark datasets confirming that SSIM_T mitigates mode collapse, stabilizes training dynamics, and produces visually coherent outputs.</p>
</sec>
<sec id="sec-7"><label>1.6</label><title>Organization of the Paper</title>
<p>The remainder of this paper is organized as follows: Section 2 provides a background on GANs, including a discussion of the mathematical framework and common training challenges. Section 3 details the proposed SSIM_T loss function and provides a theoretical analysis of its properties. Section 4 presents the experimental results, comparing SSIM_T to our proposed GAN methods. Section 5 discusses the implications of the results and suggests directions for future research. Finally, Section 6 concludes the paper with a summary of the key</p>
</sec>
</sec>
<sec id="sec-8"><title>findings.</title>
</sec>
<sec id="sec-9"><label>2</label><title>Generative Adversarial Networks: Background and Challenges</title>
<sec id="sec-10"><label>2.1</label><title>The Minimax Game</title>
<p>At its core, a GAN consists of two neural networks locked in an adversarial game: the Generator (G) and the Discriminator (D). The main role of generator is to transform random noise (z) from a prior distribution (e.g., a Gaussian distribution) into synthetic data that resembles real data (x) from a target distribution. The discriminator, on the other hand, learns to distinguish between real data and the fake data produced by the generator.</p>
<p>Mathematically, the GAN objective can be expressed as a minimax problem:</p>
<p>min_G max_D V(D, G) = E_{x~p_data(x)}[log D(x)] + E_{z~p_z(z)}[log(1 − D(G(z)))], where E denotes the expected value, p_data(x) is the distribution of real data, p_z(z) is the distribution of the input noise, D(x) is the probability that the discriminator assigns to a real data sample x, G(z) is the generated data sample from input noise z and D(G(z)) is the probability that the discriminator assigns to a generated data sample G(z).</p>
<p>The discriminator aims to maximize V(D, G), correctly classifying both real and fake data. The generator aims to minimize V(D, G), producing fake data that fools the discriminator. The goal of training is to find a Nash equilibrium where neither the generator nor the discriminator can improve their performance by unilaterally changing their strategy.</p>
</sec>
<sec id="sec-11"><label>2.2</label><title>Training GANs: Challenges and Instabilities</title>
<p>Training GANs effectively remains a significant challenge due to several factors. Mode Collapse is the first and most common issue. In this case, the generator may learn to produce only a limited set of outputs, failing to capture the full diversity of the real data distribution. Vanishing Gradients is the second challenge and occurs when the discriminator becomes too good at distinguishing real and fake data and the gradients passed back to the generator may become very small, hindering its learning process. The third challenge is non-convergence of training procedure and may cuase the adversarial training process can lead to oscillations and non-convergence, making it difficult to find a stable equilibrium. The loss functions of the generator and discriminator may fluctuate wildly during training. The fifth issue is Sensitivity to Hyperparameters. GAN performance is highly sensitive to the choice of hyperparameters, such as learning rates, batch sizes, and network architectures. Finding the optimal hyperparameter settings often requires extensive experimentation.</p>
</sec>
</sec>
<sec id="sec-12"><label>3</label><title>The SSIM_T Loss Function: Integrating Structural Similarity and Fuzzy Logic</title>
<sec id="sec-13"><label>3.1</label><title>Structural Similarity Index</title>
<p>The SSIM Wang et al. <xref ref-type="bibr" rid="ref-7">[7]</xref> is a perceptual metric that assesses image quality by comparing local patterns of luminance, contrast, and structure between two images:</p>
<p>SSIM(x, y) = l(x, y) × c(x, y) × s(x, y).</p>
<p>Where x and y are the two image patches being compared, l(x, y) is the luminance comparison function, c(x, y) is the contrast comparison function and s(x, y) is the structure comparison function. The SSIM value ranges from -1 to 1, with 1 indicating perfect similarity. SSIM is more robust than pixel-based metrics because it takes into account the spatial relationships between pixels and the overall structural information of the image.</p>
</sec>
<sec id="sec-14"><label>3.2</label><title>Fuzzy Logic T-Norms</title>
<p>Fuzzy logic provides a way to represent and reason with uncertain or imprecise information. T-norms are fuzzy logic operators that generalize the logical AND operation, allowing for the aggregation of multiple criteria in a flexible manner. Common t-norms include:</p>
<p>I. Minimum t-norm: T(a, b) = min(a, b).</p>
<p>II. Product t-norm: T(a, b) = a * b.</p>
<p>III. Lukasiewicz t-norm: T(a, b) = max(0, a + b - 1).</p>
<p>The choice of t-norm can significantly impact the performance of the SSIM_T loss function. The product t-norm is often a good choice because it is differentiable and provides a smooth aggregation of the SSIM and norm proportionality terms.</p>
</sec>
<sec id="sec-15"><label>3.3</label><title>The SSIM_T Loss Function Formulation</title>
<p>The SSIM_T loss function is defined as:</p>
<p>Let lum, cont and struct denote the luminance, contrast and structure similarity maps between the real and generated images, respectively. The loss function for each component is defined as:</p>
<p>Lumnew = 1 − prod(lum, lum),</p>
<p>Contnew = 1 − prod(cont, cont),</p>
<p>Structnew = 1 − prod(struct, struct).</p>
<p>Thus the overall loss is computed as the average of the three component losses as below:</p>
<p>lumnew + contnew + structnew Totalloss = .</p>
</sec>
<sec id="sec-16"><label>3.4</label><title>Advantages of SSIM_T</title>
<p>This new loss function in comparison to SSIM based loss functions have several advantages as mentioned below:</p>
<sec id="sec-17"><title>Seperability of components</title>
<p>Since each component is independent, the network recienves distinct feedback for each attribute that in contrast to SSIM based losses can not obsecure which component is underperforming.</p>
</sec>
<sec id="sec-18"><title>Reduced sensitivity to small values</title>
<p>In the product-based loss, if one component (e.g., contrast) is close to zero, the entire product becomes negligible, leading to a high loss-even if the other components are nearly perfect. This excessive sensitivity can destabilize training and impede progress, as the network may struggle to recover from a single weak component.</p>
</sec>
<sec id="sec-19"><title>Stable gradients</title>
<p>Squaring each component before averaging ensures that the gradients with respect to each component are more stable and linear. This avoids the vanishing or exploding gradient problems that can arise from multiplicative interactions, resulting in more reliable and efficient optimization.</p>
</sec>
<sec id="sec-20"><title>Balanced improvement</title>
<p>The component-wise loss encourages the network to improve all three aspects of similarity in a balanced manner. Each component contributes equally to the total loss, preventing the generator from neglecting any single perceptual quality.</p>
</sec>
</sec>
<sec id="sec-21"><label>3.5</label><title>Numerical Example</title>
<p>Consider the following example to illustrate the difference between SSIM-based loss and ours:</p>
<p>Let lum=0.9, cont=0.1 and struct=0.9 then the SSIM-based loss computed as below:</p>
<p>Loss = 1 – (0.9 × 0.1 × 0.9) = 1 − 0.081 = 0.919.</p>
<p>and the proposed loss function computed as:</p>
<p>lumnew = 1 − 0.81 = 0.19,</p>
<p>contnew = 1 − 0.01 = 0.99,</p>
<p>structnew = 1 – 0.81 = 0.19,</p>
<p>0.19 + 0.99 + 0.19 totalloss = ≈ 0.46.</p>
<p>This example demonstrated that the SSIM-based losses is dominated by the smallest component, while our loss more accurately refelects the indivisual performance of each attribute, providing more informative gradients and facilitating balanced learning.</p>
</sec>
</sec>
<sec id="sec-22"><label>4</label><title>Conclusion</title>
<p>This paper introduced a novel approach for enhancing GAN training by integrating the SSIM with fuzzy logic t-norms (SSIM_T) and proposing a component-wise loss function. Theoretical analysis and extensive experiments demonstrated that:</p>
<p>I. The SSIM_T loss leverages both perceptual similarity and fuzzy proportionality, leading to improved sample quality and training robustness.</p>
<p>II. The component-wise loss function, by independently optimizing luminance, contrast, and structure, yields more stable gradients, reduces sensitivity to weak components, and encourages balanced improvement across all perceptual aspects.</p>
<p>III. Empirical results on benchmark datasets confirm that the proposed methods outperform traditional pixel-wise SSIM losses in terms of FID, SSIM, and training stability.</p>
<p>These findings highlight the importance of perceptually motivated and mathematically robust loss functions in generative modeling. The proposed framework offers a promising direction for future research in GANs and other deep generative models.</p>
</sec>
<sec id="sec-23"><title>Funding</title>
<p>This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.</p>
</sec>
<sec id="sec-24"><title>Data Availability</title>
<p>The data supporting the findings of this study are available from the corresponding author upon reasonable request.</p>
</sec>
<sec id="sec-25"><title>Conflicts of Interest</title>
<p>The authors declare that there are no conflicts of interest regarding the publication of this paper.</p>
</sec>
</body>
<back><ref-list><title>References</title>
<ref id="ref-1"><label>1</label><mixed-citation>Goodfellow, I. J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., … &amp; Bengio, Y. (2014). Generative adversarial nets. Advances in neural information processing systems, 27. <ext-link ext-link-type="uri" xlink:href="https://proceedings.neurips.cc/paper_files/paper/2014/hash/f033ed80deb0234979a61f95710dbe25-Abstract.html">https://proceedings.neurips.cc/paper_files/paper/2014/hash/f033ed80deb0234979a61f95710dbe25-Abstract.html</ext-link></mixed-citation></ref>
<ref id="ref-2"><label>2</label><mixed-citation>Arjovsky, M., Chintala, S., &amp; Bottou, L. (2017). Wasserstein generative adversarial networks [presentation]. International conference on machine learning (pp. 214–223). <ext-link ext-link-type="uri" xlink:href="http://proceedings.mlr.press/v70/arjovsky17a/arjovsky17a.pdf">http://proceedings.mlr.press/v70/arjovsky17a/arjovsky17a.pdf</ext-link></mixed-citation></ref>
<ref id="ref-3"><label>3</label><mixed-citation>Gulrajani, I., Ahmed, F., Arjovsky, M., Dumoulin, V., &amp; Courville, A. C. (2017). Improved training of wasserstein gans. Advances in neural information processing systems, 30. <ext-link ext-link-type="uri" xlink:href="https://proceedings.neurips.cc/paper_files/paper/2017/file/892c3b1c6dccd52936e27cbd0ff683d6-Paper.pdf">https://proceedings.neurips.cc/paper_files/paper/2017/file/892c3b1c6dccd52936e27cbd0ff683d6-Paper.pdf</ext-link></mixed-citation></ref>
<ref id="ref-4"><label>4</label><mixed-citation>Mao, X., Li, Q., Xie, H., Lau, R. Y., Wang, Z., &amp; Paul Smolley, S. (2017). Least squares generative adversarial networks. Proceedings of the IEEE international conference on computer vision (pp. 2794-2802). <ext-link ext-link-type="uri" xlink:href="http://openaccess.thecvf.com/content_ICCV_2017/papers/Mao_Least_Squares_Generative_ICCV_2017_paper.pdf">http://openaccess.thecvf.com/content_ICCV_2017/papers/Mao_Least_Squares_Generative_ICCV_2017_paper.pdf</ext-link></mixed-citation></ref>
<ref id="ref-5"><label>5</label><mixed-citation>Miyato, T., Kataoka, T., Koyama, M., &amp; Yoshida, Y. (2018). Spectral normalization for generative adversarial networks. ArXiv preprint arxiv:1802.05957. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.48550/arXiv.1802.05957">https://doi.org/10.48550/arXiv.1802.05957</ext-link></mixed-citation></ref>
<ref id="ref-6"><label>6</label><mixed-citation>Zhang, H., Goodfellow, I., Metaxas, D., &amp; Odena, A. (2019). Self-attention generative adversarial networks [presentation]. International conference on machine learning (pp. 7354–7363). <ext-link ext-link-type="uri" xlink:href="http://proceedings.mlr.press/v97/zhang19d/zhang19d.pdf">http://proceedings.mlr.press/v97/zhang19d/zhang19d.pdf</ext-link></mixed-citation></ref>
<ref id="ref-7"><label>7</label><mixed-citation>Wang, Z., Bovik, A. C., Sheikh, H. R., &amp; Simoncelli, E. P. (2004). Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4), 600–612. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1109/TIP.2003.819861">https://doi.org/10.1109/TIP.2003.819861</ext-link></mixed-citation></ref>
<ref id="ref-8"><label>8</label><mixed-citation>Farhadinia, B., Ahangari, M. R., Heydari, A., &amp; Datta, A. (2024). A generalized optimization-based generative adversarial network. Expert systems with applications, 248, 123413. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.eswa.2024.123413">https://doi.org/10.1016/j.eswa.2024.123413</ext-link></mixed-citation></ref>
</ref-list></back>
</article>