With the rise of Transformers as the standard for language processing, and their advancements in computer vision, along with their unprecedented size and amounts of training data, many have come to believe that they are not suitable for small sets of data. This trend leads to great concerns, including but not limited to: limited availability of data in certain scientific domains and the exclusion of those with limited resource from research in the field. In this paper, we dispel the myth that transformers are "data hungry" and therefore can only be applied to large sets of data. We show for the first time that with the right size and tokenization, transformers can perform head-to-head with state-of-the-art CNNs on small datasets. Our model eliminates the requirement for class token and positional embeddings through a novel sequence pooling strategy and the use of convolutions. We show that compared to CNNs, our compact transformers have fewer parameters and MACs, while obtaining similar accuracies. Our method is flexible in terms of model size, and can have as little as 0.28M parameters and achieve reasonable results. It can reach an accuracy of 95.29 % when training from scratch on CIFAR-10, which is comparable with modern CNN based approaches, and a significant improvement over previous Transformer based models. Our simple and compact design democratizes transformers by making them accessible to those equipped with basic computing resources and/or dealing with important small datasets. Our method works on larger datasets, such as ImageNet (80.28% accuracy with 29% parameters of ViT), and NLP tasks as well. Our code and pre-trained models are publicly available at https://github.com/SHI-Labs/Compact-Transformers.
翻译:随着变异器的崛起成为语言处理的标准,以及计算机网络图像的进步,以及它们前所未有的规模和培训数据数量,许多人开始相信它们不适合小数据集。这一趋势引出了巨大的关切,包括但不限于:某些科学领域的数据有限,以及将资源有限的数据排除在实地研究之外。在本文中,我们消除了变异器“数据饥饿”的神话,因此只能应用于大套数据。我们第一次显示,随着正确的尺寸和符号化,变异器能够以小数据集上最先进的CNN系统进行头对头的精确度。这个趋势导致人们非常关切,包括但不限于:某些科学领域的数据有限,以及将有限的资源排除在外地研究之外。我们发现,与CNNW相比,我们最紧凑的变异变器的参数和MACCR,同时获得类似的理解。我们的方法在模型规模和符号化方面是灵活易变异的,并且可能只有0.28ML的参数和合理的结果。我们的模式可以达到最先进的SNRFAR系统模型的精确度,也就是我们以前在设计上的重要的IMRFAR-10模型。我们用来进行重要的变现的简化的模型,这些变压式的模型可以比重的计算。