Design by Contract for Deep Learning APIs
Shibbir Ahmed, Sayem Mohammad Imtiaz, Syeda Khairunnesa Samantha, Breno Dantas Cruz, Hridesh Rajan
摘要
Deep Learning (DL) techniques are increasingly being incorporated in critical software systems today. DL software is buggy too. Recent work in SE has characterized these bugs, studied fix patterns, and proposed detection and localization strategies. In this work, we introduce a preventative measure. We propose design by contract for DL libraries, DL Contract for short, to document the properties of DL libraries and provide developers with a mechanism to identify bugs during development. While DL Contract builds on the traditional design by contract techniques, we need to address unique challenges. In particular, we need to document properties of the training process that are not visible at the functional interface of the DL libraries. To solve these problems, we have introduced mechanisms that allow developers to specify properties of the model architecture, data, and training process. We have designed and implemented DL Contract for Python-based DL libraries and used it to document the properties of Keras, a well-known DL library. We evaluate DL Contract in terms of effectiveness, runtime overhead, and usability. To evaluate the utility of DL Contract, we have developed 15 sample contracts specifically for training problems and structural bugs. We have adopted four well-vetted benchmarks from prior works on DL bug detection and repair. For the effectiveness, DL Contract correctly detects 259 bugs in 272 real-world buggy programs, from well-vetted benchmarks provided in prior work on DL bug detection and repair. We found that the DL Contract overhead is fairly minimal for the used benchmarks. Lastly, to evaluate the usability, we conducted a survey of twenty participants who have used DL Contract to find and fix bugs. The results reveal that DL Contract can be very helpful to DL application developers when debugging their code.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 3 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Fair preprocessing: towards understanding compositional fairness of data transformers in machine learning pipeline 引用了 Do the machine learning models on a crowd sourced platform exhibit bias? an empirical study on model fairness
- Fair preprocessing: towards understanding compositional fairness of data transformers in machine learning pipeline 引用了 Repairing deep neural networks: fix patterns and challenges
- Mock Deep Testing: Toward Separate Development of Data and Models for Deep Learning 引用了 Repairing deep neural networks: fix patterns and challenges
- Mock Deep Testing: Toward Separate Development of Data and Models for Deep Learning 引用了 Taxonomy of real faults in deep learning systems
- Inferring Data Preconditions from Deep Learning Models for Trustworthy Prediction in Deployment 引用了 Do the machine learning models on a crowd sourced platform exhibit bias? an empirical study on model fairness
- Inferring Data Preconditions from Deep Learning Models for Trustworthy Prediction in Deployment 引用了 Fair preprocessing: towards understanding compositional fairness of data transformers in machine learning pipeline
- Inferring Data Preconditions from Deep Learning Models for Trustworthy Prediction in Deployment 引用了 Repairing deep neural networks: fix patterns and challenges
- A comprehensive study on challenges in deploying deep learning based software 引用了 Taxonomy of real faults in deep learning systems
- Fix Fairness, Don't Ruin Accuracy: Performance Aware Fairness Repair using AutoML 引用了 Do the machine learning models on a crowd sourced platform exhibit bias? an empirical study on model fairness
- Fix Fairness, Don't Ruin Accuracy: Performance Aware Fairness Repair using AutoML 引用了 Fair preprocessing: towards understanding compositional fairness of data transformers in machine learning pipeline
引用它的顶会 Paper3
- Fix Fairness, Don't Ruin Accuracy: Performance Aware Fairness Repair using AutoMLGiang Nguyen, Sumon Biswas, Hridesh RajanFSE 2023 · 15 次引用
- Inferring Data Preconditions from Deep Learning Models for Trustworthy Prediction in DeploymentShibbir Ahmed, Hongyang Gao, Hridesh RajanICSE 2024 · 3 次引用
- Mock Deep Testing: Toward Separate Development of Data and Models for Deep LearningRuchira Manke, Mohammad Wardat, Foutse Khomh, Hridesh RajanICSE 2025
它引用的 Paper19
- Taxonomy of real faults in deep learning systemsNargiz Humbatova, Gunel Jahangirova, Gabriele Bavota, Vincenzo Riccio 等ICSE 2020 · 281 次引用
- A comprehensive study on challenges in deploying deep learning based softwareZhenpeng Chen, Yanbin Cao, Yuanqiang Liu, Haoyu Wang 等FSE 2020 · 121 次引用
- Repairing deep neural networks: fix patterns and challengesMd Johirul Islam, Rangeet Pan, Giang Nguyen, Hridesh RajanICSE 2020 · 102 次引用
- Fair preprocessing: towards understanding compositional fairness of data transformers in machine learning pipelineSumon Biswas, Hridesh RajanFSE 2021 · 101 次引用
- Do the machine learning models on a crowd sourced platform exhibit bias? an empirical study on model fairnessSumon Biswas, Hridesh RajanFSE 2020 · 96 次引用
相关 Paper
- DeepLocalize: Fault Localization for Deep Neural NetworksMohammad Wardat, Wei Le, Hridesh RajanICSE 2021 · 93 次引用
- ACETest: Automated Constraint Extraction for Testing Deep Learning OperatorsJingyi Shi, Yang Xiao, Yuekang Li, Yeting Li 等ISSTA 2023 · 24 次引用
- Deep learning library testing via effective model generationZan Wang, Ming Yan, Junjie Chen, Shuang Liu 等FSE 2020 · 165 次引用
- Understanding performance problems in deep learning systemsJunming Cao, Bihuan Chen, Chao Sun, Longjie Hu 等FSE 2022 · 33 次引用
- DocTer: documentation-guided fuzzing for testing deep learning API functionsDanning Xie, Yitong Li, Mijung Kim, Hung Viet Pham 等ISSTA 2022 · 72 次引用
