The public model zoo containing enormous powerful pretrained model families (e.g., ResNet/DeiT) 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 efficiently assemble these readily available models in a family for dynamic accuracy-efficiency trade-offs at runtime. To this end, 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 given a family of pretrained neural networks, which we call anchors. Specifically, SN-Net splits the 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. 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.
翻译:公共模型动物园(例如,ResNet/DeiT)拥有巨大的强大、未经训练的模范家庭(例如,ResNet/DeiT)已经达到了前所未有的前所未有的规模,大大促进了深层次学习的成功。每个模范家庭由各种规模(例如,DeiT-Ti/S/B)的预先训练模型组成,因此自然会产生一个根本问题,即如何在一个家庭中高效率地组装这些现成的模范,以便在运行时进行动态精准-效率交易。为此,我们介绍了一个新颖的可调制神经网络(SN-Net),这是一个新的可升级和高效的模型部署框架,这种模型以廉价的方式产生众多网络,其复杂性和性能交换率是不同的。鉴于一个经过预先训练的神经网络,SNNet可以立即适应具有不同程度的神经网络,同时通过转换经训练的单个性能定位,在SNNER网络上进行动态的资源限制。