The public model zoo containing enormous powerful pretrained model families (e.g., DeiT/Swin) has reached an unprecedented scope than ever, which significantly contributes to the success of deep learning. As each model family consists of pretrained models with diverse scales (e.g., DeiT-Ti/S/B), it naturally arises a fundamental question of how to effectively assemble these readily available models in a family for dynamic accuracy-efficiency trade-offs at runtime. In this work, we present Stitchable Neural Networks (SN-Net), a novel scalable and efficient framework for model deployment which cheaply produces numerous networks with different complexity and performance trade-offs. Specifically, SN-Net splits a family of pretrained neural networks, which we call anchors, across the blocks/layers and then stitches them together with simple stitching layers to map the activations from one anchor to another. With only a few epochs of training, SN-Net effectively interpolates between the performance of anchors with varying scales. At runtime, SN-Net can instantly adapt to dynamic resource constraints by switching the stitching positions. Furthermore, we provide a comprehensive study on what, how and where to stitch as well as a simple strategy for effectively and efficiently training SN-Net. Extensive experiments on ImageNet classification demonstrate that SN-Net can obtain on-par or even better performance than many individually trained networks while supporting diverse deployment scenarios. For example, by stitching Swin Transformers, we challenge hundreds of models in Timm model zoo with a single network. We believe this new elastic model framework can serve as a strong baseline for further research in wider communities.
翻译:公共模型动物园(Deit-Ti/S/B)包含巨大的强大、未经训练的模范家庭(例如DeiT/Swin),其规模空前,大大促进了深层次学习的成功。由于每个模范家庭由各种规模(例如DeiT-Ti/S/B)的预先训练模型组成,自然会产生一个根本问题,即如何在一个大家庭中有效地组装这些现成的模型,以便在运行时进行动态的精确-效率交易。在这项工作中,我们介绍了一个崭新的可调的神经网络(SN-Net),这是一个新的可升级和高效的模型部署框架,它廉价地产生了许多复杂和性能网络交易的网络。具体地说,SNN-Net将一组先行的神经网络网络网络网网分割成一组,我们称之为固定的锚,然后用简单的缝合层来将这些模型和现成的模型连接起来,我们用不同的规模来获得新的螺钉。在运行时,SNN-Net可以立即适应动态的资源限制,而我们用一个经过训练得力的模型进行更精确的网络化的网络化的模型,同时进行更精确的模拟的实验, 将一个简单的SNSIS化的模型进行一个简单的实验,可以有效地地展示, 进行一个简单的的实验,用来在做成一个简单的的模拟的模拟的模型, 做成一个简单的的模拟的模拟的实验,用来做成一个简单的SNSSS-totototototoir 。此外, 。