一句话:提出SeaM,通过梯度搜索保留与目标任务相关的权重,再工程DNN模型以降低复用开销和缺陷继承。
训练DNN模型计算与时间成本高,复用已有模型成为重要方向。但现有复用方法存在两个问题:复用整个模型而只需少量功能会带来推理开销;同时会继承原模型的缺陷与安全隐患。为此,作者提出SeaM,面向给定目标任务和已训练模型,利用基于梯度的搜索方法定位与目标任务相关的权重,并对模型进行再工程,仅保留相关权重后复用于目标任务。在常用模型上的评估表明,再工程模型仅保留原模型10.11%的权重,推理时间减少42.41%,分类准确率反而提升5.85%,且相比复用完整模型平均少继承57%的缺陷。
Training deep neural network (DNN) models, which has become an important task in today's software development, is often costly in terms of computational resources and time. With the inspiration of software reuse, building DNN models through reusing existing ones has gained increasing attention recently. Prior approaches to DNN model reuse have two main limitations: 1) reusing the entire model, while only a small part of the model's functionalities (labels) are required, would cause much overhead (e.g., computational and time costs for inference), and 2) model reuse would inherit the defects and weaknesses of the reused model, and hence put the new system under threats of security attack. To solve the above problem, we propose SeaM, a tool that re-engineers a trained DNN model to improve its reusability. Specifically, given a target problem and a trained model, SeaM utilizes a gradient-based search method to search for the model's weights that are relevant to the target problem. The re-engineered model that only retains the relevant weights is then reused to solve the target problem. Evaluation results on widely-used models show that the re-engineered models produced by SeaM only contain 10.11% weights of the original models, resulting 42.41% reduction in terms of inference time. For the target problem, the re-engineered models even outperform the original models in classification accuracy by 5.85%. Moreover, reusing the re-engineered models inherits an average of 57% fewer defects than reusing the entire model. We believe our approach to reducing reuse overhead and defect inheritance is one important step forward for practical model reuse.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2304-00245,
title = {Reusing Deep Neural Network Models through Model Re-engineering},
author = {Binhang Qi and Hailong Sun and Xiang Gao and Hongyu Zhang and Zhaotian Li and Xudong Liu},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse48619.2023.00090}
}