arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.01314cs.CVcs.AI
收藏

使用无Softmax的Transformers和序列归一化进行计算高效的医学图像分类

Compute-Efficient Medical Image Classification with Softmax-Free Transformers and Sequence Normalization

University Hospital Aachen(亚琛大学医院);Else Kroener Fresenius Center for Digital Health(埃尔瑟·克勒纳·弗雷森纽斯数字健康中心);Medical Faculty Carl Gustav Carus(卡尔·古斯塔夫·卡鲁斯医学院);Technical University Dresden(德累斯顿工业大学);University Hospital and Faculty of Medicine Carl Gustav Carus, TUD Dresden University of Technology(德累斯顿工业大学卡尔·古斯塔夫·卡鲁斯大学医院及医学院);National Center for Tumor Diseases (NCT)(国家肿瘤疾病中心);University Hospital Heidelberg(海德堡大学医院)

Firas Khader, Omar S. M. El Nahhas, Tianyu Han, Gustav Müller-Franzes, Sven Nebelung, Jakob Nikolas Kather, Daniel Truhn

AI总结:

本文提出一种简单有效的方法,通过移除注意力机制中的softmax函数并结合序列归一化和矩阵乘法重排,将Transformer的计算与内存复杂度降至线性,在多种医学图像数据集上实现了与传统模型相当的性能且能高效处理长序列。

摘要:

Transformer模型在推动自然语言处理、语音识别和计算机视觉等领域发展方面发挥了关键作用。然而,该模型的一个关键局限在于其相对于序列长度的二次计算和内存复杂度,这限制了它在更长序列上的应用。在医学成像中这一点尤为关键,因为高分辨率图像可达到千兆像素规模。为解决此问题,以往的努力主要集中在复杂的技术上,例如分解Transformer架构中不可或缺的softmax操作。本文针对Transformer模型的这种二次计算复杂度,提出了一种极其简单且有效的方法,通过从注意力机制中移除softmax函数,并对key、query和value token采用序列归一化技术来规避这一问题。结合矩阵乘法的重新排序,该方法将内存和计算复杂度降低至线性规模。我们在包含眼底镜、皮肤镜、放射学和组织学成像数据的多种医学成像数据集上对该方法进行了评估。研究结果表明,这些模型表现出与传统transformer模型相当的性能,同时能高效处理更长的序列。

英文摘要:

The Transformer model has been pivotal in advancing fields such as natural language processing, speech recognition, and computer vision. However, a critical limitation of this model is its quadratic computational and memory complexity relative to the sequence length, which constrains its application to longer sequences. This is especially crucial in medical imaging where high-resolution images can reach gigapixel scale. Efforts to address this issue have predominantely focused on complex techniques, such as decomposing the softmax operation integral to the Transformer's architecture. This paper addresses this quadratic computational complexity of Transformer models and introduces a remarkably simple and effective method that circumvents this issue by eliminating the softmax function from the attention mechanism and adopting a sequence normalization technique for the key, query, and value tokens. Coupled with a reordering of matrix multiplications this approach reduces the memory- and compute complexity to a linear scale. We evaluate this approach across various medical imaging datasets comprising fundoscopic, dermascopic, radiologic and histologic imaging data. Our findings highlight that these models exhibit a comparable performance to traditional transformer models, while efficiently handling longer sequences.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑