Skip to main content
QUICK REVIEW

[论文解读] Fast Inference in Capsule Networks Using Accumulated Routing Coefficients

Zhao Zhen, Ashley Kleinhans|arXiv (Cornell University)|Apr 15, 2019
Caching and Content Delivery参考文献 6被引用 9
一句话总结

本文提出了一种快速推理方法,通过从训练数据中预计算并存储‘主’路由系数,将迭代动态路由替换为单次矩阵乘法,从而显著降低推理时间。在MNIST变体上仅损失不到0.5%的准确率,在CIFAR-10上损失约5%,实现了接近原始模型性能的实用化部署。

ABSTRACT

We present a method for fast inference in Capsule Networks (CapsNets) by taking advantage of a key insight regarding the routing coefficients that link capsules between adjacent network layers. Since the routing coefficients are responsible for assigning object parts to wholes, and an object whole generally contains similar intra-class and dissimilar inter-class parts, the routing coefficients tend to form a unique signature for each object class. For fast inference, a network is first trained in the usual manner using examples from the training dataset. Afterward, the routing coefficients associated with the training examples are accumulated offline and used to create a set of "master" routing coefficients. During inference, these master routing coefficients are used in place of the dynamically calculated routing coefficients. Our method effectively replaces the for-loop iterations in the dynamic routing procedure with a single matrix multiply operation, providing a significant boost in inference speed. Compared with the dynamic routing procedure, fast inference decreases the test accuracy for the MNIST, Background MNIST, Fashion MNIST, and Rotated MNIST datasets by less than 0.5% and by approximately 5% for CIFAR10.

研究动机与目标

  • 解决胶囊网络因迭代动态路由导致的推理速度慢的问题。
  • 探究是否可将训练数据中的路由系数聚合为单一、可重用的集合以用于推理。
  • 在显著降低推理时间的同时,保持高测试准确率,相比动态路由有显著提升。
  • 通过加速推理,实现胶囊网络在真实世界应用中的实用化部署,且准确率损失可忽略。

提出的方法

  • 在预处理阶段,从所有训练样本中累积路由系数,形成单一的‘主’路由系数矩阵。
  • 在推理阶段使用主路由系数,而非通过迭代动态路由重新计算。
  • 将动态路由中的r次迭代循环替换为单次矩阵乘法操作,实现在推理时的完全并行化。
  • 使用标准动态路由正常训练胶囊网络,然后从最终训练轮次中提取并存储路由系数。
  • 将主路由系数应用于所有测试输入,避免对每个样本重新计算路由。
  • 在动态路由与快速推理中均使用最大最小值或Softmax路由策略以进行对比。

实验结果

研究问题

  • RQ1能否将训练数据中的路由系数聚合为一个泛化能力良好的单一主矩阵?
  • RQ2用预计算的主矩阵替代迭代动态路由,在推理速度和准确率方面的影响程度如何?
  • RQ3路由系数的类内与类间相关性如何影响主路由方法的性能?
  • RQ4主路由系数是否不仅可用于推理,也可在未来用于加速训练?

主要发现

  • 与动态路由相比,该快速推理方法在MNIST、Background MNIST、Fashion MNIST和Rotated MNIST上的测试准确率损失小于0.5%。
  • 在CIFAR-10上,准确率下降约5%,表明在更复杂的数据集上性能差距更大。
  • 主路由系数在类内高度相关,但在类间相关性较低,尤其在MNIST等简单数据集上更为明显。
  • 该方法将动态路由的r次迭代替换为单次矩阵乘法,实现完全并行化,从而获得显著加速。
  • CIFAR-10上的性能差距归因于不同物体类别间预测向量区分度不足,导致路由系数聚合不可靠。
  • 基于类内相似性过滤异常路由系数矩阵,可能提升复杂数据集上的性能,为未来优化提供方向。

更好的研究,从现在开始

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

无需绑定信用卡

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