Unlike cloud-based deep learning models that are often large and uniform, edge-deployed models usually demand customization for domain-specific tasks and resource-limited environments. Such customization processes can be costly and time-consuming due to the diversity of edge scenarios and the training load for each scenario. Although various approaches have been proposed for rapid resource-oriented customization and task-oriented customization respectively, achieving both of them at the same time is challenging. Drawing inspiration from the generative AI and the modular composability of neural networks, we introduce NN-Factory, an one-for-all framework to generate customized lightweight models for diverse edge scenarios. The key idea is to use a generative model to directly produce the customized models, instead of training them. The main components of NN-Factory include a modular supernet with pretrained modules that can be conditionally activated to accomplish different tasks and a generative module assembler that manipulate the modules according to task and sparsity requirements. Given an edge scenario, NN-Factory can efficiently customize a compact model specialized in the edge task while satisfying the edge resource constraints by searching for the optimal strategy to assemble the modules. Based on experiments on image classification and object detection tasks with different edge devices, NN-Factory is able to generate high-quality task- and resource-specific models within few seconds, faster than conventional model customization approaches by orders of magnitude.
翻译:与通常规模庞大且形态统一的云端深度学习模型不同,边缘部署的模型通常需要针对特定领域任务和资源受限环境进行定制化。由于边缘场景的多样性和每个场景下的训练负载,这种定制化过程可能成本高昂且耗时。尽管已有多种方法分别针对快速资源导向定制和任务导向定制进行了研究,但同时实现两者仍具挑战性。受生成式人工智能和神经网络模块化可组合性的启发,我们提出了NN-Factory——一种适用于多样化边缘场景的“一揽子”框架,用于生成定制化轻量级模型。其核心思想是直接使用生成模型来生成定制化模型,而非训练模型。NN-Factory的主要组件包括一个包含可条件激活预训练模块的模块化超网络,以及一个根据任务和稀疏性要求操控这些模块的生成式模块组装器。给定一个边缘场景,NN-Factory通过搜索最优的模块组装策略,能够高效定制出专注于边缘任务且满足边缘资源约束的紧凑模型。基于不同边缘设备上的图像分类和目标检测任务实验,NN-Factory能够在数秒内生成高质量的任务特定和资源特定模型,比传统模型定制方法快数个数量级。