一句话:提出 DeepLocalize,通过动态追踪 DNN 训练中层间数值传播趋势,自动检测并定位故障层或超参数。
DNN 普遍存在缺陷,但模型常表现为黑箱,现有调试技术难以定位 DNN 错误。本文提出 DeepLocalize,将深度学习应用转换为命令式表示,或利用回调机制插入探针,在训练数据上动态分析 DNN 产生的执行轨迹。基于层间传播数值的历史趋势,算法捕获数值错误并监控训练过程,评估各层/参数与模型结果的关联,从而判定模型是否有缺陷并定位根因(故障层或超参数)。作者从 Stack Overflow 和 GitHub 收集含 40 个真实错误模型及补丁的基准。评估表明:DeepLocalize 在 34/40 例中检测出故障,优于 Keras 最佳调试方法的 32/40;并能定位 21/40 个缺陷,而 Keras 未定位任何故障。
Deep Neural Networks (DNNs) are becoming an integral part of most software systems. Previous work has shown that DNNs have bugs. Unfortunately, existing debugging techniques don't support localizing DNN bugs because of the lack of understanding of model behaviors. The entire DNN model appears as a black box. To address these problems, we propose an approach and a tool that automatically determines whether the model is buggy or not, and identifies the root causes for DNN errors. Our key insight is that historic trends in values propagated between layers can be analyzed to identify faults, and also localize faults. To that end, we first enable dynamic analysis of deep learning applications: by converting it into an imperative representation and alternatively using a callback mechanism. Both mechanisms allows us to insert probes that enable dynamic analysis over the traces produced by the DNN while it is being trained on the training data. We then conduct dynamic analysis over the traces to identify the faulty layer or hyperparameter that causes the error. We propose an algorithm for identifying root causes by capturing any numerical error and monitoring the model during training and finding the relevance of every layer/parameter on the DNN outcome. We have collected a benchmark containing 40 buggy models and patches that contain real errors in deep learning applications from Stack Overflow and GitHub. Our benchmark can be used to evaluate automated debugging tools and repair techniques. We have evaluated our approach using this DNN bug-and-patch benchmark, and the results showed that our approach is much more effective than the existing debugging approach used in the state-of-the-practice Keras library. For 34/40 cases, our approach was able to detect faults whereas the best debugging approach provided by Keras detected 32/40 faults. Our approach was able to localize 21/40 bugs whereas Keras did not localize any faults.