@inproceedings{Zhang-FSE-20, author = {Zhang, Ziqi and Li, Yuanchun and Guo, Yao and Chen, Xiangqun and Liu, Yunxin}, title = {Dynamic Slicing for Deep Neural Networks}, year = {2020}, isbn = {9781450370431}, publisher = {Association for Computing Machinery}, address = {New York, NY, USA}, url = {https://doi.org/10.1145/3368089.3409676}, doi = {10.1145/3368089.3409676}, abstract = {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.}, booktitle = {Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering}, pages = {838¨C850}, numpages = {13}, keywords = {Deep neural networks, data-flow analysis, dynamic slicing, program slicing}, location = {Virtual Event, USA}, series = {ESEC/FSE 2020} }