Skip to main content
QUICK REVIEW

[论文解读] Fast Single-Class Classification and the Principle of Logit Separation

Gil Keren, Sivan Sabato|arXiv (Cornell University)|May 29, 2017
Domain Adaptation and Few-Shot Learning参考文献 30被引用 3
一句话总结

本文提出了单 logits 分类(SLC)任务,其中神经网络仅通过单个目标类的 logits 进行分类,从而实现快速推理。本文提出了 logits 分离原则(PoLS)作为损失函数的设计准则,表明与 PoLS 对齐的损失函数相比交叉熵损失,可将 SLC 准确率提升至少 20%,同时在 400,000 个类别下实现高达 10 倍的推理速度提升。

ABSTRACT

We consider neural network training, in applications in which there are many possible classes, but at test-time, the task is a binary classification task of determining whether the given example belongs to a specific class, where the class of interest can be different each time the classifier is applied. For instance, this is the case for real-time image search. We define the Single Logit Classification (SLC) task: training the network so that at test-time, it would be possible to accurately identify whether the example belongs to a given class in a computationally efficient manner, based only on the output logit for this class. We propose a natural principle, the Principle of Logit Separation, as a guideline for choosing and designing losses suitable for the SLC. We show that the cross-entropy loss function is not aligned with the Principle of Logit Separation. In contrast, there are known loss functions, as well as novel batch loss functions that we propose, which are aligned with this principle. In total, we study seven loss functions. Our experiments show that indeed in almost all cases, losses that are aligned with the Principle of Logit Separation obtain at least 20% relative accuracy improvement in the SLC task compared to losses that are not aligned with it, and sometimes considerably more. Furthermore, we show that fast SLC does not cause any drop in binary classification accuracy, compared to standard classification in which all logits are computed, and yields a speedup which grows with the number of classes. For instance, we demonstrate a 10x speedup when the number of classes is 400,000. Tensorflow code for optimizing the new batch losses is publicly available at https://github.com/cruvadom/Logit Separation.

研究动机与目标

  • 为解决在类别数量极多的神经网络中推理计算成本过高的问题,特别是在推理时仅查询单个类别的情况下。
  • 通过训练模型使目标类别的 logits 单独决定分类准确性,从而实现在推理时的快速单 logits 推理。
  • 识别出一个基本原理——logits 分离——以确保正确类别的 logits 在 logits 空间中与错误类别的 logits 明确分离。
  • 设计并评估与 logits 分离原则对齐的损失函数,以提升 SLC 的性能,超越标准交叉熵损失。

提出的方法

  • 提出单 logits 分类(SLC)任务,即在推理时仅计算查询类别的 logits。
  • 提出 logits 分离原则(PoLS),要求在 logits 空间中,正确类别 logits 显著高于错误类别 logits。
  • 分析七种损失函数,包括标准交叉熵和新型批量损失,评估其与 PoLS 的对齐程度。
  • 定义批量损失(如批量交叉熵、批量最大间隔损失),通过确保每个小批量中正确类 logits 主导错误类 logits,从而强制实现 PoLS。
  • 通过理论分析证明,与 PoLS 对齐的损失函数在损失趋近于零的极限下,可确保正确类别 logits 与错误类别 logits 在 logits 空间中实现严格分离。
  • 基于 KL 散度与间隔约束的理论框架,形式化定义了分离条件。

实验结果

研究问题

  • RQ1是否可以训练神经网络,使得单个类别的 logits 单独决定样本是否属于该类别?
  • RQ2尽管交叉熵损失被广泛使用,为何其在 SLC 设置下表现不佳?
  • RQ3何种原理可指导设计使单类别 logits 对分类具有实际意义的损失函数?
  • RQ4能否构建基于批量的损失函数,以在所有类别上强制实现 logits 分离?
  • RQ5PoLS 对齐损失在 SLC 准确率与推理速度上的实际影响如何?

主要发现

  • 与 logits 分离原则(PoLS)对齐的损失函数相比交叉熵损失,SLC 准确率至少提升 20%。
  • 交叉熵损失与 PoLS 不对齐,因其无法确保正确类别与错误类别 logits 之间具备足够的分离度。
  • 新提出的批量损失——批量交叉熵与批量最大间隔损失——已被证明与 PoLS 对齐,并在 SLC 任务中优于标准交叉熵损失。
  • 在 400,000 个类别下,所提出的 SLC 方法相比完整 softmax 推理,实现 10 倍的推理速度提升。
  • SLC 方法在保持与标准全类别训练相当的二分类准确率的同时,未造成性能下降。
  • 理论分析证实,PoLS 对齐的损失函数可在 logits 空间中严格实现正确类别与错误类别 logits 的分离。

更好的研究,从现在开始

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

无需绑定信用卡

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