Skip to main content
QUICK REVIEW

[论文解读] Softmax-based Classification is k-means Clustering: Formal Proof, Consequences for Adversarial Attacks, and Improvement through Centroid Based Tailoring

Sibylle Hess, Wouter Duivesteijn|arXiv (Cornell University)|Jan 7, 2020
Adversarial Robustness in Machine Learning参考文献 30被引用 7
一句话总结

本文形式化证明了基于 softmax 的神经网络分类在深层网络倒数第二层的变换特征空间中,数学上等价于 k-means 聚类。通过使用基于质心的激活函数(高斯网络)重新定义最终层,模型在对抗性单像素攻击下表现出更强的鲁棒性——脆弱性降低 2.7 至 6.8 倍,同时保持了具有竞争力的准确率,并能对异常输入表达合理的怀疑。

ABSTRACT

We formally prove the connection between k-means clustering and the predictions of neural networks based on the softmax activation layer. In existing work, this connection has been analyzed empirically, but it has never before been mathematically derived. The softmax function partitions the transformed input space into cones, each of which encompasses a class. This is equivalent to putting a number of centroids in this transformed space at equal distance from the origin, and k-means clustering the data points by proximity to these centroids. Softmax only cares in which cone a data point falls, and not how far from the centroid it is within that cone. We formally prove that networks with a small Lipschitz modulus (which corresponds to a low susceptibility to adversarial attacks) map data points closer to the cluster centroids, which results in a mapping to a k-means-friendly space. To leverage this knowledge, we propose Centroid Based Tailoring as an alternative to the softmax function in the last layer of a neural network. The resulting Gauss network has similar predictive accuracy as traditional networks, but is less susceptible to one-pixel attacks; while the main contribution of this paper is theoretical in nature, the Gauss network contributes empirical auxiliary benefits.

研究动机与目标

  • 形式化建立深度神经网络中基于 softmax 的分类与 k-means 聚类之间的数学等价性。
  • 通过在变换特征空间中进行几何与邻近性分析,解释基于 softmax 的网络为何对单像素对抗性攻击特别脆弱。
  • 提出一种理论基础坚实的 softmax 函数替代方案,通过使网络输出与 k-means 友好的聚类行为对齐,提升鲁棒性。
  • 使神经网络能够对分布外或对抗性扰动输入表达合理的怀疑,从而提升可解释性与安全性。
  • 提出一种可训练的、基于邻近优化的方法,直接在最终层学习聚类质心,从而提升泛化能力与鲁棒性。

提出的方法

  • 证明 softmax 函数将倒数第二层的特征空间划分为类似 Voronoi 的圆锥区域,每个区域对应一个类别,这在数学上等价于将质心等距于原点的 k-means 聚类。
  • 基于输入特征到学习质心的距离,提出一种新的最终层激活函数——高斯网络,替代标准的 softmax。
  • 引入一种邻近最小化更新规则,直接优化网络权重以表示聚类质心,确保模型学习到 k-means 友好的表示。
  • 使用新损失函数通过标准反向传播训练高斯网络,实现端到端学习,同时保持高预测准确率。
  • 使用高斯网络置信度分数作为到最近类原型距离的度量,使模型能够标记不确定或异常的预测。
  • 在 CIFAR-10 和 MNIST 上使用 FGSM 和单像素攻击评估鲁棒性,比较准确率、置信度与异常检测性能。

实验结果

研究问题

  • RQ1在深度神经网络中,基于 softmax 的分类与 k-means 聚类之间是否存在形式化的数学等价性?
  • RQ2为何基于 softmax 的网络对单像素对抗性攻击特别脆弱?这种脆弱性与特征空间的几何结构有何关联?
  • RQ3通过显式建模聚类质心重构最终层,是否能提升对小幅度输入扰动的鲁棒性,同时不损失准确率?
  • RQ4通过测量与学习质心的距离,模型在多大程度上能对对抗性或分布外输入表达合理的怀疑?
  • RQ5网络的利普希茨模数与其与聚类质心的距离之间有何关系?这种距离是否在利普希茨连续性之外独立影响鲁棒性?

主要发现

  • 本文形式化证明了 softmax 分类在倒数第二层的变换特征空间中,数学上等价于以质心为中心的 k-means 聚类,每个类别对应一个围绕质心的圆锥区域。
  • 具有较小利普希茨模数的网络会将输入映射得更接近其对应类别的质心,从而通过使特征空间更具 k-means 友好性来增强鲁棒性。
  • 高斯网络通过用基于质心的激活替代 softmax,使 CIFAR-10 上易受单像素攻击的图像比例降低 2.7 至 6.8 倍。
  • 在 MNIST 上,高斯网络在噪声下保持高准确率,并能更好地区分原型(清晰数字)与异常值(抽象或失真数字),其置信度分数与人类感知一致。
  • 传统网络对噪声图像赋予高置信度(>0.9),而高斯网络则对这些异常值赋予接近零的置信度,展现出其表达合理怀疑的能力。
  • 与传统网络(均值 ~0.98)相比,高斯网络的置信度分数在置信度范围内分布更均匀(均值 ~0.56),表明其过自信现象减少,校准性更好。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。