Modularizing while Training: A New Paradigm for Modularizing DNN Models
Binhang Qi, Hailong Sun, Hongyu Zhang, Ruobing Zhao, Xiang Gao
Abstract
Deep neural network (DNN) models have become increasingly crucial components of intelligent software systems. However, training a DNN model is typically expensive in terms of both time and computational resources. To address this issue, recent research has focused on reusing existing DNN models - borrowing the concept of software reuse in software engineering. However, reusing an entire model could cause extra overhead or inherit the weaknesses from the undesired functionalities. Hence, existing work proposes to decompose an already trained model into modules, i.e., modularizing-after-training, to enable module reuse. Since the trained models are not built for modularization, modularizing-after-training may incur huge overhead and model accuracy loss. In this paper, we propose a novel approach that incorporates modularization into the model training process, i.e., modularizing-while-training (MwT). We train a model to be structurally modular through two loss functions that optimize intra-module cohesion and inter-module coupling. We have implemented the proposed approach for modularizing Convolutional Neural Network (CNN) models. The evaluation results on representative models demonstrate that MwT outperforms the existing state-of-the-art modularizing-after-training approach. Specifically, the accuracy loss caused by MwT is only 1.13 percentage points, which is less than that of the existing approach. The kernel retention rate of the modules generated by MwT is only 14.58%, with a reduction of 74.31% over the existing approach. Furthermore, the total time cost required for training and modularizing is only 108 minutes, which is half the time required by the existing approach. Our work demonstrates that MwT is a new and more effective paradigm for realizing DNN model modularization, offering a fresh perspective on achieving model reuse.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 429dc50f-4e73-450a-ad80-4c9455ad0bc3Cited by top-tier papers1
Ask how each one uses itBuilds on17
- Oriented R-CNN for Object DetectionXingxing Xie, Gong Cheng, Jiabao Wang, Xiwen Yao et al.ICCV 2021 · 1,070 citations
- On the Integration of Self-Attention and ConvolutionXuran Pan, Chunjiang Ge, Rui Lu, Shiji Song et al.CVPR 2022 · 516 citations
- Model-Reuse Attacks on Deep Learning SystemsYujie Ji, Xinyang Zhang, Shouling Ji, Xiapu Luo et al.CCS 2018 · 197 citations
- VulCNN: An Image-inspired Scalable Vulnerability Detection SystemYueming Wu, Deqing Zou, Shihan Dou, Wei Yang et al.ICSE 2022 · 141 citations
- Towards Real-world X-ray Security Inspection: A High-Quality Benchmark And Lateral Inhibition Module For Prohibited Items DetectionRenshuai Tao, Yanlu Wei, Xiangjian Jiang, Hainan Li et al.ICCV 2021 · 113 citations
Related papers
- Reusing Deep Neural Network Models through Model Re-engineeringBinhang Qi, Hailong Sun, Xiang Gao, Hongyu Zhang et al.ICSE 2023 · 16 citations
- On decomposing a deep neural network into modulesRangeet Pan, Hridesh RajanFSE 2020 · 38 citations
- Decomposing Convolutional Neural Networks into Reusable and Replaceable ModulesRangeet Pan, Hridesh RajanICSE 2022 · 30 citations
- ModularEvo: Evolving Multi-Task Models via Neural Network Modularization and CompositionWenrui Long, Binhang Qi, Hailong Sun, Zongzhen Yang et al.ICSE 2026
- Patching Weak Convolutional Neural Network Models through Modularization and CompositionBinhang Qi, Hailong Sun, Xiang Gao, Hongyu ZhangASE 2022 · 13 citations
