一句话:提出首个基于数据流分析的深度神经网络切片方法 NNSlicer,并验证其在检测、剪枝与保护中的应用。
程序切片已广泛用于软件工程任务,但现有技术仅处理由指令和变量构成的传统程序,无法直接应用于由神经元和突触组成的深度神经网络。本文提出 NNSlicer,首个基于数据流分析的深度神经网络切片方法。该方法通过比较神经元在特定输入下的激活行为与在整个数据集上的平均行为,理解各神经元对输入的反应;再从输出神经元出发递归回溯,量化神经元对切片准则的贡献,并将贡献较大的神经元和突触作为切片。作者在对抗输入检测、模型剪枝和选择性模型保护三个应用中验证了 NNSlicer 的有效性,结果显示其显著优于不依赖数据流分析的基线方法。
Program slicing has been widely applied in a variety of software engineering tasks. However, existing program slicing techniques only deal with traditional programs that are constructed with instructions and variables, rather than neural networks that are composed of neurons and synapses. In this paper, we introduce NNSlicer, the first approach for slicing deep neural networks based on data-flow analysis. Our method understands the reaction of each neuron to an input based on the difference between its behavior activated by the input and the average behavior over the whole dataset. Then we quantify the neuron contributions to the slicing criterion by recursively backtracking from the output neurons, and calculate the slice as the neurons and the synapses with larger contributions. We demonstrate the usefulness and effectiveness of NNSlicer with three applications, including adversarial input detection, model pruning, and selective model protection. In all applications, NNSlicer significantly outperforms other baselines that do not rely on data flow analysis.