Manuscript Offprint

arXiv:2611.07474

Adversarial Robustness of Kernel Machines: A Comprehensive Analysis

Rahul Kumar Yadav, Tunir Ghosh, Sudhendu Ahir, Parthe Pandit, Arjun Bhagoji

Abstract

Kernel machines are an important class of models in machine learning. However, the question of how robust modern kernel machines are to adversarial examples has not been studied comprehensively. In this paper, we provide a thorough empirical investigation of the adversarial robustness of kernel-based models for both binary and multiclass classification tasks, via white-box and black-box evasion attacks. We evaluate the native robustness of kernel machines, random feature classifiers, and the relatively newer Recursive Feature Machines. In addition, we provide an algorithm for approximate adversarial training of kernel machines. Our experiments on classification tasks on image and tabular datasets strongly indicate that kernel machines are natively more robust than neural networks, i.e., their performance degrades more gracefully against adversarial perturbations.

Contents

1 Introduction2
1.1 Main findings4
1.2 Prior work on robustness of KMs4
2 Preliminaries5
2.1 Adversarial examples6
2.2 Kernel-based models6
3 Main Experimental Results7
3.1 Setup Summary7
3.2 KMs are more robust than neural nets8
3.3 RFMs are nearly as robust as base KMs9
3.4 Robustness of RFCs increases with number of random features9
3.5 Robustness of KMs is comparable with adversarially trained neural networks9
4 Adversarial training of kernel classifiers10
4.1 Convex approximation for binary classification10
4.2 Nonconvex approximation for multiclass11
4.3 Evaluation of adversarially trained KMs12
5 Discussion12
5.1 Summary of Ablations12
5.2 Are KMs more robust point-wise?13
5.3 Limitations13
5.4 Future Work13
A Further Technical Details and Setup17
A.1 Gradient-free (black-box) attacks using SPSA17

*Correspondence to pandit@iitb.ac.in and arjunp@iitb.ac.in

A.2 Attacks on Tabular datasets using CaFA ..... 18 A.3 Kernels preliminaries ..... 18 A.4 Adversarial training of NNs ..... 19 A.5 Adversarial training of Kernel Machines ..... 19

B Detailed Experimental Setup 19 B.1 Kernel Machines training details ..... 19 B.2 Neural Networks training details ..... 20 B.3 Attacks ..... 20 B.4 Adversarial training of neural networks ..... 20 B.5 Adversarial training of KLR ..... 21 B.6 ν\nu vs. robustness of Matérn Kernels ..... 22 B.7 Computational efficiency details ..... 22

C Detailed Experimental Results 23 C.1 Adversarial Robustness under ℓ2\ell_2 and ℓ∞\ell_\infty Perturbations ..... 23 C.2 Linf summary for KMNIST/QMNIST vs FCNN and LeNet ..... 23 C.3 Comparison of KMs with FCNN and LeNet ..... 29 C.4 Laplacian Results for FMNIST, KMNIST, QMNIST ..... 30 C.5 Gaussian Results for FMNIST, KMNIST, QMNIST ..... 56 C.6 Kernels on SVHN and CIFAR-10 ..... 83 C.7 WideResNet vs LeNet ..... 88 C.8 KMs and adversarially trained KMs vs adversarially trained nets ..... 89

D Further Ablations 93 D.1 Results for gradient-free (black-box) attacks ..... 93 D.2 Robustness on Tabular datasets ..... 102 D.3 Results for Matérn Kernel ν\nu versus robust accuracy ..... 103 D.4 Robust Accuracy variation with iteration in RFMs ..... 104 D.5 Robust Accuracy variation with length scale (σ\sigma) ..... 105 D.6 Robust Accuracy variation with ridge (λ\lambda) ..... 107 D.7 Number of features in RFC versus robust accuracy ..... 108 D.7.1 FMNIST Results for Gaussian RFC ..... 108 D.7.2 KMNIST Results for Gaussian RFC ..... 110 D.7.3 QMNIST Results for Gaussian RFC ..... 112 D.7.4 FMNIST Results for Laplace RFC ..... 114 D.7.5 KMNIST Results for Laplace RFC ..... 116 D.7.6 QMNIST Results for Laplace RFC ..... 118

References (49)