A Comparative Study of Adversarial Robustness in CNN and CNN-ANFIS Architectures Kaaustaaub Shankar, Bharadwaj Dogga, Kelly Cohen Abstract Convolutional Neural Networks (CNNs) achieve strong image classification performance but lack interpretability and are vulnerable to adversarial attacks. Neuro-fuzzy hybrids such as DCNFIS replace fully connected CNN classifiers with Adaptive Neuro-Fuzzy Inference Systems (ANFIS) to improve interpretability, yet their robustness remains underexplored. This work compares standard CNNs (ConvNet, VGG, ResNet18) with their ANFIS-augmented counterparts on MNIST, Fashion-MNIST, CIFAR-10, and CIFAR-100 under gradient-based (PGD) and gradient-free (Square) attacks. Results show that ANFIS integration does not consistently improve clean accuracy and has architecture-dependent effects on robustness: ResNet18-ANFIS exhibits improved adversarial robustness, while VGG-ANFIS often underperforms its baseline. These findings suggest that neuro-fuzzy augmentation can enhance robustness in specific architectures but is not universally beneficial. 1 Introduction CNNs have become the dominant paradigm for image classification, yet their internal representations and decision processes remain largely opaque, raising concerns for safety-critical domains that require accountability and trust. This black-box behavior has motivated growing interest in explainable and trustworthy AI, particularly in settings such as medical imaging, cybersecurity, and malware detection [ 24 ] , where understanding why a model makes a prediction is as important as the prediction itself. Hybrid approaches that combine deep learning with fuzzy logic have emerged as a promising direction, using fuzzy rules and membership functions to provide human-interpretable decision boundaries while preserving powerful feature extraction [ 2 ] . Within this context, neuro-fuzzy architectures such as the Deep Convolutional Neuro-Fuzzy Inference System (DCNFIS) replace conventional fully connected layers in CNNs with an Adaptive Neuro-Fuzzy Inference System (ANFIS), yielding linguistic rule-based classifiers on top of deep feature maps. Recent work shows that fuzzy logic and neuro-fuzzy models can improve interpretability without severely degrading predictive performance, and can be successfully deployed in real-world regression and classification tasks [ 17 ] [ 22 ] . These results position CNN-ANFIS hybrids as attractive candidates for applications that demand both accuracy and transparent decision-making. At the same time, adversarial attacks such as Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD) have revealed that standard CNNs are highly vulnerable to imperceptible perturbations [ 19 ] , prompting extensive research on defensive strategies and adversarial training schemes [ 18 ] [ 4 ] . Studies on robust training, including hybrid FGSM-PGD procedures and architectural innovations such as sparse mixture-of-experts layers [ 14 ] , highlight that robustness depends strongly on both training regime and model design. Yet the adversarial robustness of interpretable hybrids like DCNFIS remains poorly understood; this work therefore presents a comparative study of CNN and CNN-ANFIS architectures under gradient-based and gradient-free attacks in white-box and black-box settings, aiming to clarify how interpretability-oriented fuzzy components interact with adversarial robustness. 2 Related Work 2.1 Fuzzy Logic and its Derived Systems Fuzzy set theory was introduced by Lotfi Zadeh [ 25 ] as a mathematical concept that allows elements to have partial membership in multiple sets, more closely resembling human reasoning under uncertainty. This can be expressed as: \mu_{\tilde{A}}(x)\in[0,1],\quad\forall x\in X (1) where \mu_{\tilde{A}}(x) is the membership function of element x in fuzzy set \tilde{A} . Using this new way of thinking, systems capable of universally approximating nonlinear functions [ 3 ] have been created. Two widely used fuzzy inference systems (FIS) are Mamdani [ 13 ] and Takagi-Sugeno-Kang (TSK) [ 16 ] and these systems use linguistic terms (low, medium, high) to define both rules and membership functions. However, FISs suffer from the curse of dimensionality where an increase in inputs results in an exponential increase in the size of the model. This limits the use of pure fuzzy systems to low-dimensional problems, making them unsuitable for tasks such as image classification. To handle this, an Adaptive Neuro Fuzzy Inference System (ANFIS) [ 7 ] was created which integrates neural network learning algorithms with the structure of a fuzzy inference system allowing for the system to handle larger dimension problems 2.2 Convolutional Neural Networks and Neuro-Fuzzy Hybrids Convolutional Neural Networks (CNNs) are a class of deep learning models specifically designed for processing grid-like data, such as images, through the principle of locality. The key idea behind CNNs is the use of convolutional layers, where small learnable filters, called kernels, slide over the input to extract local patterns such as edges, textures, or shapes. These features are then progressively combined through multiple convolutional and pooling layers to form hierarchical representations, capturing increasingly complex patterns. After feature extraction, fully connected layers perform classification based on the learned representations. Over the years, CNN architectures have evolved from simple models like LeNet [ 11 ] for digit recognition, to deeper and more sophisticated networks such as AlexNet [ 10 ] , VGG [ 15 ] , ResNet [ 5 ] , and DenseNet [ 6 ] , which incorporate innovations like deeper layers, skip connections, and dense connectivity to improve performance and training stability. CNNs have become the dominant approach in computer vision due to their ability to automatically learn relevant features and generalize across complex image datasets. However, these models are inherently uninterpretable, as the learned kernel features are abstract and the classification aspect is not human-understandable. To address this limitation, neuro-fuzzy hybrid approaches have been proposed. One such approach replaces the dense layers used for classification in CNNs with an ANFIS, resulting in models like DCNFIS that provide greater interpretability in both feature extraction and classification [ 23 ] . Despite their promise, the robustness and safety of these hybrid models under adversarial attacks remain largely unexplored, providing a strong incentive to investigate their vulnerabilities. 2.3 Adversarial Attacks Since models, whether neural networks or fuzzy-based systems, learn to recognize patterns from the training data, these patterns can be exploited by carefully crafted perturbations to cause incorrect predictions. Such manipulations, known as adversarial attacks, subtly modify inputs in a way that is often imperceptible to humans but can dramatically affect model outputs. These attacks can be categorized into black-box attacks, white-box attacks, and gray-box attacks. For this paper, we focus on both black-box and white-box attacks. Black-box attacks assume that the attacker has no knowledge of the model’s structure or parameters, whereas white-box attacks assume full access to both [ 20 ] . These attacks can also be categorized based on whether they rely on gradient information. Gradient-based attacks use the model’s gradients to craft perturbations that maximize the loss and are typically performed in a white-box setting. In contrast, gradient-free attacks do not require access to gradients and instead rely on model outputs, queries, or random search strategies to generate adversarial examples, making them suitable for black-box scenarios. Gradient-based attacks, also called white-box attacks, leverage knowledge of the model’s internal parameters and gradients to identify input perturbations that maximize prediction errors. These attacks can be highly effective because they directly exploit the model’s learned representations. On the other hand, non-gradient-based attacks, often referred to as black-box or score-based attacks, do not require access to gradients. Instead, they rely on model outputs, query strategies, or random search to identify adversarial inputs, making them particularly relevant for models with partially non-differentiable components, such as neuro-fuzzy hybrids. Among gradient-based attacks, Projected Gradient Descent (PGD) [ 12 ] has become a widely used benchmark for evaluating model robustness, due to its iterative, first-order optimization of the input to maximize loss. In the category of black-box, score-based attacks [ 1 ] , the Square Attack has emerged as an efficient and effective method that relies solely on model outputs without access to gradients. PGD PGD [ 12 ] is an iterative, gradient-based adversarial attack that aims to find perturbations \delta which maximize the model’s loss while staying within a specified bound \epsilon . The general procedure can be summarized as the follows: Algorithm 1 Projected Gradient Descent (PGD) 1: Input x , true label y , model f , loss function \mathcal{L} 2: Step size \alpha (the amount of perturbation added at each iteration) 3: Perturbation bound \epsilon (maximum allowed perturbation magnitude) 4: Number of iterations T 5: Initialize perturbation: \delta_{0}\leftarrow 0 (or random within \epsilon -ball) 6: for t=0 to T-1 do 7: Compute gradient: g_{t}\leftarrow\nabla_{x}\mathcal{L}(f(x+\delta_{t}),y) 8: Update perturbation: \delta_{t+1}\leftarrow\delta_{t}+\alpha\cdot\text{sign}(g_{t}) 9: Project perturbation to \epsilon -ball: \delta_{t+1}\leftarrow\text{clip}(\delta_{t+1},-\epsilon,\epsilon) 10: Generate adversarial example: x_{\text{adv}}=x+\delta_{T} Square Attack Square Attack [ 1 ] as a black-box gradient free adversarial attack generates perturbations by modifying randomly selected square regions of the input to increase the model’s loss. Algorithm 2 Square Attack 1: Input x , label y , model f , perturbation bound \epsilon , max queries Q 2: Initialize x_{\text{adv}}\leftarrow x 3: for q=1 to Q do 4: Randomly choose a square region in x_{\text{adv}} 5: Apply a random perturbation within [-\epsilon,\epsilon] 6: Clip result to the \epsilon -ball around x 7: if loss increases then 8: Accept the perturbation 9: return x_{\text{adv}} 3 Methodology To make our experiment procedure more robust, we will be training a standard ConvNet, a VGG-like model, and Resnet18 along with their ANFIS variants on 4 different datasets: MNIST, FashionMNIST [ 21 ] , CIFAR-10 [ 9 ] , and CIFAR-100 [ 9 ] . Backbone Feature Dim Classifier ConvNet n_{\text{feat}}(H,W) FC / ANFIS VGG 256 FC / ANFIS ResNet18 512 FC / ANFIS Table 1 : ANFIS replaces FC in CNN The ANFIS architecture used in this paper is identical to the one described in Yeganejou et al [ 23 ] and n_{\text{rules}}=20 was used for all variants and all datasets. We then apply PGD and Square Attack on varying epsilon levels and then calculate the accuracy on the attacked data. This is done through the TorchAttacks library [ 8 ] . For the PGD and Square attacks, we used the epsilon values shown in Table 2 . The alpha value ( \alpha ) for PGD was then derived using the epsilon value as \frac{1}{35}\cdot\epsilon to scale the attacks better while the number of queries for square attack was kept at n=1000 . Dataset Epsilon Values MNIST [0.1,\ 0.2,\ 0.3] Fashion-MNIST [0.1,\ 0.2,\ 0.3] CIFAR-10 [\frac{2}{255},\ \frac{8}{255},\ \frac{16}{255}] CIFAR-100 [\frac{2}{255},\ \frac{8}{255},\ \frac{16}{255}] Table 2 : Epsilon values used for each dataset. To evaluate each of the models fairly given that the complexities of their datasets differ, we will be using a robustness ratio defined as such: \text{Robustness Ratio}=\frac{\text{Adversarial Accuracy}}{\text{Clean Accuracy}} 4 Results Model MNIST Fashion-MNIST CIFAR10 CIFAR100 ConvNet 99.42% 92.49% 79.37% 45.78% VGG 99.39% 92.95% 85.63% 49.09% ResNet18 99.41% 91.39% 82.52% 52.98% ConvNet-ANFIS 99.36% 92.22% 77.41% 47.06% VGG-ANFIS 99.51% 93.23% 85.73% 54.74% ResNet18-ANFIS 99.49% 91.62% 80.69% 49.95% Table 3 : Basic Test Accuracy Comparison across Datasets Figure 1 : Normalized Robustness for PGD Attacks MNIST Model \mathbf{0.1000} \mathbf{0.2000} \mathbf{0.3000} ConvNet 98.85% 98.42% 97.67% VGG 98.99% 98.68% 98.20% ResNet18 91.36% 87.97% 84.14% ConvNet-ANFIS 98.59% 97.95% 96.94% VGG-ANFIS 99.07% 98.56% 97.93% ResNet18-ANFIS 93.33% 90.84% 87.10% Fashion-MNIST Model \mathbf{0.1000} \mathbf{0.2000} \mathbf{0.3000} ConvNet 34.38% 21.36% 14.22% VGG 25.87% 17.58% 12.04% ResNet18 25.43% 15.73% 10.68% ConvNet-ANFIS 40.56% 25.85% 16.68% VGG-ANFIS 25.40% 16.04% 10.79% ResNet18-ANFIS 30.16% 19.40% 12.43% Table 4 : PGD Attack Accuracy Comparison for MNIST and Fashion-MNIST CIFAR-10 Model \mathbf{0.0078} \mathbf{0.0314} \mathbf{0.0627} ConvNet 32.94% 20.60% 10.94% VGG 37.56% 19.95% 8.26% ResNet18 39.68% 26.60% 13.65% ConvNet-ANFIS 29.55% 19.35% 10.73% VGG-ANFIS 36.14% 19.85% 8.48% ResNet18-ANFIS 39.65% 26.66% 14.64% CIFAR-100 Model \mathbf{0.0078} \mathbf{0.0314} \mathbf{0.0627} ConvNet 12.60% 6.90% 3.61% VGG 12.53% 5.25% 2.32% ResNet18 14.60% 7.89% 3.68% ConvNet-ANFIS 11.45% 6.11% 2.81% VGG-ANFIS 14.08% 6.07% 2.32% ResNet18-ANFIS 13.54% 6.99% 3.33% Table 5 : PGD Attack Accuracy Comparison for CIFAR-10 and CIFAR-100 Figure 2 : Normalized Robustness for Square Attacks MNIST Model \mathbf{0.1000} \mathbf{0.2000} \mathbf{0.3000} ConvNet 98.81% 98.17% 97.38% VGG 98.91% 98.57% 97.95% ResNet18 90.78% 87.10% 82.90% ConvNet-ANFIS 98.39% 97.65% 96.53% VGG-ANFIS 98.92% 98.40% 97.73% ResNet18-ANFIS 92.84% 90.13% 85.99% Fashion-MNIST Model \mathbf{0.1000} \mathbf{0.2000} \mathbf{0.3000} ConvNet 34.40% 22.13% 15.50% VGG 25.47% 17.67% 12.52% ResNet18 25.61% 16.29% 11.75% ConvNet-ANFIS 40.18% 26.16% 17.55% VGG-ANFIS 24.97% 16.08% 10.85% ResNet18-ANFIS 30.22% 20.09% 13.43% Table 6 : Square Accuracy Comparison for MNIST and Fashion-MNIST CIFAR-10 Model \mathbf{0.0078} \mathbf{0.0314} \mathbf{0.0627} ConvNet 31.16% 23.51% 15.28% VGG 36.92% 24.79% 13.63% ResNet18 37.68% 28.79% 18.65% ConvNet-ANFIS 27.24% 21.30% 13.93% VGG-ANFIS 35.43% 24.11% 13.23% ResNet18-ANFIS 37.34% 28.93% 19.10% CIFAR-100 Model \mathbf{0.0078} \mathbf{0.0314} \mathbf{0.0627} ConvNet 10.66% 7.08% 4.10% VGG 11.43% 6.35% 3.26% ResNet18 13.35% 8.59% 4.81% ConvNet-ANFIS 9.70% 6.47% 3.71% VGG-ANFIS 13.37% 7.28% 3.30% ResNet18-ANFIS 12.11% 7.75% 4.39% Table 7 : Square Accuracy Comparison for CIFAR-10 and CIFAR-100. Figure 3 : Normalized Robustness (excluding CIFAR-100) for PGD Attacks Figure 4 : Normalized Robustness (excluding CIFAR-100) for Square Attacks 5 Discussion The results in Table 3 indicate strong performance across all models on MNIST and Fashion-MNIST, where accuracies are uniformly high and differences between architectures—both with and without ANFIS augmentation—are relatively small. As dataset complexity increases in CIFAR10 and CIFAR100, the performance gaps between models become more pronounced; deeper architectures such as VGG and ResNet18 generally outperform the simpler ConvNet. However, the addition of ANFIS does not yield a consistent improvement across datasets or architectures. While ANFIS-enhanced variants occasionally produce modest gains (for example VGG-ANFIS on CIFAR100), in other cases the hybrid models underperform their baseline counterparts (ConvNet-ANFIS on CIFAR10 and CIFAR100). This mixed pattern suggests that the integration of ANFIS does not systematically enhance visual recognition performance. Figure 1 illustrates that the impact of ANFIS integration on PGD robustness is highly dependent on the underlying convolutional architecture. In the case of ConvNet, the ANFIS-enhanced model achieves adversarial accuracy comparable to its baseline counterpart, indicating little measurable benefit. For ResNet18, however, the ANFIS variant demonstrates a noticeable improvement of approximately five percentage points, suggesting that more residual-based architectures may better leverage the additional fuzzy-inference layer. Conversely, VGG displays the opposite trend: the baseline model consistently outperforms VGG-ANFIS under PGD perturbations, suggesting that ANFIS integration may be less effective for architectures lacking strong feature-preservation mechanisms such as those provided by residual connections in ResNet. This same pattern is reinforced in Figure 2 , where we see that ANFIS variants follow architecture-dependent trends: models like ResNet18-ANFIS exhibit clear robustness gains, while VGG-ANFIS continues to underperform its baseline counterpart. Without CIFAR-100, the robustness trends become much clearer. As shown in Figures 3 and 4 , the gap between the generic models and their ANFIS variants increases slightly, but the overall pattern remains consistent. 6 Future Work Future work will explore stronger and adaptive adversarial attacks that explicitly target the neuro-fuzzy components of DCNFIS, including transfer-based and expectation-over-transformation attacks. We also plan to investigate robustness-improving strategies such as adversarial training and regularization of fuzzy rules and membership functions. Additionally, studying how design choices in the ANFIS layer, including the number of rules and membership parameterization, affect adversarial robustness remains an important direction. Finally, extending this evaluation to larger datasets and safety-critical applications will help assess the practical robustness of neuro-fuzzy vision models. Disclosure of Interests. The authors have no competing interests to disclose.