Deep Learning (DL) is a class of machine learning algorithms that are used in a wide variety of applications. Like any software system, DL programs can have bugs. To support bug localization in DL programs, several tools have been proposed in the past. As most of the bugs that occur due to improper model structure known as structural bugs lead to inadequate performance during training, it is challenging for developers to identify the root cause and address these bugs. To support bug detection and localization in DL programs, in this paper, we propose Theia, which detects and localizes structural bugs in DL programs. Unlike the previous works, Theia considers the training dataset characteristics to automatically detect bugs in DL programs developed using two deep learning libraries, Keras and PyTorch. Since training the DL models is a time-consuming process, Theia detects these bugs at the beginning of the training process and alerts the developer with informative messages containing the bug's location and actionable fixes which will help them to improve the structure of the model. We evaluated Theia on a benchmark of 40 real-world buggy DL programs obtained from Stack Overflow. Our results show that Theia successfully localizes 57/75 structural bugs in 40 buggy programs, whereas NeuraLint, a state-of-the-art approach capable of localizing structural bugs before training localizes 17/75 bugs.
翻译:深度学习(DL)是一类广泛应用于多种场景的机器学习算法。与任何软件系统一样,深度学习程序也可能存在缺陷。为支持深度学习程序中的缺陷定位,过去已提出多种工具。由于大多数由不当模型结构(称为结构缺陷)引起的错误会导致训练期间性能不足,开发者难以识别根本原因并修复这些缺陷。为支持深度学习程序中的缺陷检测与定位,本文提出 Theia,该系统能够检测并定位深度学习程序中的结构缺陷。与先前工作不同,Theia 通过考虑训练数据集特征,自动检测使用 Keras 和 PyTorch 两种深度学习库开发的程序中的缺陷。由于训练深度学习模型耗时较长,Theia 在训练过程初期即检测这些缺陷,并通过包含缺陷位置及可操作修复建议的信息提示开发者,从而帮助其改进模型结构。我们在包含 40 个源自 Stack Overflow 的真实缺陷程序基准集上评估了 Theia。实验结果表明,Theia 在 40 个缺陷程序中成功定位了 57/75 个结构缺陷,而当前最先进的、能够在训练前定位结构缺陷的方法 NeuraLint 仅定位了 17/75 个缺陷。