Proceedings

Specifying and Testing k-Safety Properties for Machine-Learning Models

Download BibTeX Cite

Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence. Main Track. Pages 4748-4757.

https://doi.org/10.24963/ijcai.2023/528

Abstract

Machine-learning models are becoming increasingly prevalent in our lives, for instance assisting in image-classification or decision-making tasks. Consequently, the reliability of these models is of critical importance and has resulted in the development of numerous approaches for validating and verifying their robustness and fairness. However, beyond such specific properties, it is challenging to specify, let alone check, general functional-correctness expectations from models. In this paper, we take inspiration from specifications used in formal methods, expressing functional-correctness properties by reasoning about k different executions---so-called k-safety properties. Considering a credit-screening model of a bank, the expected property that "if a person is denied a loan and their income decreases, they should still be denied the loan" is a 2-safety property. Here, we show the wide applicability of k-safety properties for machine-learning models and present the first specification language for expressing them. We also operationalize the language in a framework for automatically validating such properties using metamorphic testing. Our experiments show that our framework is effective in identifying property violations, and that detected bugs could be used to train better models.

  1. [Albarghouthi et al., 2017] Aws Albarghouthi, Loris D'Antoni, Samuel Drews, and Aditya V. Nori. FairSquare: Probabilistic verification of program fairness. PACMPL, 1:80:1-80:30, 2017.
  2. [Bastani et al., 2019] Osbert Bastani, Xin Zhang, and Ar- mando Solar-Lezama. Probabilistic verification of fairness properties via concentration. PACMPL, 3:118:1-118:27, 2019.
  3. [Berrada et al., 2021] Leonard Berrada, Sumanth Dathathri, Krishnamurthy Dvijotham, Robert Stanforth, Rudy Bunel, Jonathan Uesato, Sven Gowal, and M. Pawan Kumar. Make sure you're unsure: A framework for verifying probabilistic specifications. In NeurIPS, pages 11136-11147, 2021.
  4. [Brockman et al., 2016] Greg Brockman, Vicki Cheung, Lud- wig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym. CoRR, abs/1606.01540, 2016.
  5. [Carlini and Wagner, 2017] Nicholas Carlini and David A. Wagner. Towards evaluating the robustness of neural net- works. In S&P, pages 39-57. IEEE Computer Society, 2017.
  6. [Cer et al., 2018] Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St. John, Noah Con- stant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, Yun-Hsuan Sung, Brian Strope, and Ray Kurzweil. Univer- sal sentence encoder. CoRR, abs/1803.11175, 2018.
  7. [Chen et al., 1998] Tsong Yueh Chen, S. C. Cheung, and Siu- Ming Yiu. Metamorphic testing: A new approach for gener- ating next test cases. Technical Report HKUST-CS98-01, HKUST, 1998.
  8. [Clarkson and Schneider, 2008] Michael R. Clarkson and Fred B. Schneider. Hyperproperties. In CSF, pages 51-65. IEEE Computer Society, 2008.
  9. [Deng et al., 2021] Yao Deng, Guannan Lou, James Xi Zheng, Tianyi Zhang, Miryung Kim, Huai Liu, Chen Wang, and Tsong Yueh Chen. BMT: Behavior driven development- based metamorphic testing for autonomous driving mod- els. In MET@ICSE, pages 32-36. IEEE Computer Society, 2021.
  10. [Deng et al., 2022] Yao Deng, Xi Zheng, Tianyi Zhang, Huai Liu, Guannan Lou, Miryung Kim, and Tsong Yueh Chen. A declarative metamorphic testing framework for autonomous driving. TSE, pages 1-20, 2022.
  11. [Dwarakanath et al., 2018] Anurag Dwarakanath, Manish Ahuja, Samarth Sikand, Raghotham M. Rao, R. P. Ja- gadeesh Chandra Bose, Neville Dubash, and Sanjay Podder. Identifying implementation bugs in machine learning based image classifiers using metamorphic testing. In ISSTA, pages 118-128. ACM, 2018.
  12. [Eniser et al., 2022] Hasan Ferit Eniser, Timo P. Gros, Valentin Wüstholz, Jörg Hoffmann, and Maria Christakis. Metamorphic relations via relaxations: An approach to obtain oracles for action-policy testing. In ISSTA, pages 52-63. ACM, 2022.
  13. [Galhotra et al., 2017] Sainyam Galhotra, Yuriy Brun, and Alexandra Meliou. Fairness testing: Testing software for discrimination. In ESEC/FSE, pages 498-510. ACM, 2017.
  14. [Gehr et al., 2018] Timon Gehr, Matthew Mirman, Dana Drachsler-Cohen, Petar Tsankov, Swarat Chaudhuri, and Martin T. Vechev. AI2: Safety and robustness certification of neural networks with abstract interpretation. In S&P, pages 3-18. IEEE Computer Society, 2018.
  15. [Goodfellow et al., 2015] Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
  16. [He et al., 2020] Pinjia He, Clara Meister, and Zhendong Su. Structure-invariant testing for machine translation. In ICSE, pages 961-973. ACM, 2020.
  17. [Hoare, 1969] C. A. R. Hoare. An axiomatic basis for com- puter programming. CACM, 12:576-580, 1969.
  18. [Hofmann, 1994] Hans Hofmann. The German credit dataset. https://archive.ics.uci.edu/ml/datasets/Statlog+ (German+Credit+Data), 1994. Accessed: 2023-04-28. Link
  19. [Huang et al., 2017] Xiaowei Huang, Marta Kwiatkowska, Sen Wang, and Min Wu. Safety verification of deep neural networks. In CAV, volume 10426 of LNCS, pages 3-29. Springer, 2017.
  20. [Katz et al., 2017] Guy Katz, Clark W. Barrett, David L. Dill, Kyle Julian, and Mykel J. Kochenderfer. Reluplex: An efficient SMT solver for verifying deep neural networks. In CAV, volume 10426 of LNCS, pages 97-117. Springer, 2017.
  21. [Larson et al., 2016] Jeff Larson, Surya Mattu, Lauren Kirch- ner, and Julia Angwin. How we analyzed the COMPAS recidivism algorithm. https://www.propublica.org/article/ how-we-analyzed-the-compas-recidivism-algorithm, 2016. Accessed: 2023-04-28. Link
  22. [LeCun et al., 1998] Yann LeCun, Léon Bottou, Yoshua Ben- gio, and Patrick Haffner. Gradient-based learning applied to document recognition. In Proc. IEEE, pages 2278-2324. IEEE Computer Society, 1998.
  23. [LeCun et al., 1999] Yann LeCun, Corinna Cortes, and Christopher J.C. Burges. The MNIST database of hand- written digits. http://yann.lecun.com/exdb/mnist, 1999. Ac- cessed: 2023-04-28. Link
  24. [Li et al., 2020] Renjue Li, Jianlin Li, Cheng-Chao Huang, Pengfei Yang, Xiaowei Huang, Lijun Zhang, Bai Xue, and Holger Hermanns. PRODeep: A platform for robustness verification of deep neural networks. In ESEC/FSE, pages 1630-1634. ACM, 2020.
  25. [Liu, 2017] Jiashen Liu. 515K hotel reviews data in Europe. https://www.kaggle.com/datasets/jiashenliu/ 515k-hotel-reviews-data-in-europe, 2017. Accessed: 2023- 04-28. Link
  26. [Ma et al., 2020] Pingchuan Ma, Shuai Wang, and Jin Liu. Metamorphic testing and certified mitigation of fairness vi- olations in NLP models. In IJCAI, pages 458-465. ijcai.org, 2020. IJCAI
  27. [Madry et al., 2018] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR. OpenReview.net, 2018.
  28. [Meyer, 1992] Bertrand Meyer. Eiffel: The Language. Prentice-Hall, 1992.
  29. [Parr, 2013] Terence Parr. The Definitive ANTLR 4 Reference, 2nd Edition. O'Reilly Media, 2013.
  30. [Raffin et al., 2019] Antonin Raffin, Ashley Hill, Maximil- ian Ernestus, Adam Gleave, Anssi Kanervisto, and Noah Dormann. Stable baselines3, 2019. https://github.com/ DLR-RM/stable-baselines3. Link
  31. [Schulman et al., 2017] John Schulman, Filip Wolski, Pra- fulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017.
  32. [Segura et al., 2016] Sergio Segura, Gordon Fraser, Ana B. Sánchez, and Antonio Ruiz Cortés. A survey on metamor- phic testing. TSE, 42:805-824, 2016.
  33. [Seshia et al., 2018] Sanjit A. Seshia, Ankush Desai, Tom- maso Dreossi, Daniel J. Fremont, Shromona Ghosh, Edward Kim, Sumukh Shivakumar, Marcell Vazquez- Chanlatte, and Xiangyu Yue. Formal specification for deep neural networks. In ATVA, volume 11138 of LNCS, pages 20-34. Springer, 2018.
  34. [Sharma and Wehrheim, 2020] Arnab Sharma and Heike Wehrheim. Higher income, larger loan? Monotonicity testing of machine learning models. In ISSTA, pages 200- 210. ACM, 2020.
  35. [Singh et al., 2019] Gagandeep Singh, Timon Gehr, Markus Püschel, and Martin T. Vechev. An abstract domain for certifying neural networks. PACMPL, 3:41:1-41:30, 2019.
  36. [Sousa and Dillig, 2016] Marcelo Sousa and Isil Dillig. Cartesian Hoare logic for verifying k-safety properties. In PLDI, pages 57-69. ACM, 2016.
  37. [Sun et al., 2018] Youcheng Sun, Min Wu, Wenjie Ruan, Xi- aowei Huang, Marta Kwiatkowska, and Daniel Kroening. Concolic testing for deep neural networks. In ASE, pages 109-119. ACM, 2018.
  38. [Tian et al., 2018] Yuchi Tian, Kexin Pei, Suman Jana, and Baishakhi Ray. DeepTest: Automated testing of deep- neural-network-driven autonomous cars. In ICSE, pages 303-314. ACM, 2018.
  39. [Tian et al., 2020] Yuchi Tian, Ziyuan Zhong, Vicente Or- donez, Gail E. Kaiser, and Baishakhi Ray. Testing DNN image classifiers for confusion & bias errors. In ICSE, pages 1122-1134. ACM, 2020.
  40. [Tramèr et al., 2017] Florian Tramèr, Vaggelis Atlidakis, Roxana Geambasu, Daniel J. Hsu, Jean-Pierre Hubaux, Mathias Humbert, Ari Juels, and Huang Lin. FairTest: Discovering unwarranted associations in data-driven ap- plications. In EuroS&P, pages 401-416. IEEE Computer Society, 2017.
  41. [Udeshi et al., 2018] Sakshi Udeshi, Pryanshu Arora, and Sudipta Chattopadhyay. Automated directed fairness test- ing. In ASE, pages 98-108. ACM, 2018.
  42. [Urban et al., 2020] Caterina Urban, Maria Christakis, Valentin Wüstholz, and Fuyuan Zhang. Perfectly parallel fairness certification of neural networks. PACMPL, 4:185:1-185:30, 2020.
  43. [Usman et al., 2021] Muhammad Usman, Yannic Noller, Co- rina S. Pasareanu, Youcheng Sun, and Divya Gopinath. NEUROSPF: A tool for the symbolic analysis of neural networks. In ICSE, pages 25-28. IEEE Computer Society, 2021.
  44. [via Isotopic Replacement, 2022] Improving Machine Trans- lation Systems via Isotopic Replacement. Sun, zeyu and zhang, jie m. and xiong, yingfei and harman, mark and papadakis, mike and zhang, lu. In ICSE, pages 1181-1192. ACM, 2022.
  45. [Wang and Su, 2020] Shuai Wang and Zhendong Su. Meta- morphic object insertion for testing object detection sys- tems. In ASE, pages 1053-1065. IEEE Computer Society, 2020.
  46. [Wang et al., 2018] Shiqi Wang, Kexin Pei, Justin White- house, Junfeng Yang, and Suman Jana. Formal security analysis of neural networks using symbolic intervals. In Security, pages 1599-1614. USENIX, 2018.
  47. [Wang et al., 2021] Shiqi Wang, Huan Zhang, Kaidi Xu, Xue Lin, Suman Jana, Cho-Jui Hsieh, and J. Zico Kolter. Beta- CROWN: Efficient bound propagation with per-neuron split constraints for neural network robustness verification. In NeurIPS, pages 29909-29921, 2021.
  48. [Warden, 2018] Pete Warden. Speech commands: A dataset for limited-vocabulary speech recognition. CoRR, abs/1804.03209, 2018.
  49. [Wicker et al., 2018] Matthew Wicker, Xiaowei Huang, and Marta Kwiatkowska. Feature-guided black-box safety test- ing of deep neural networks. In TACAS, volume 10805 of LNCS, pages 408-426. Springer, 2018.
  50. [Yang et al., 2021] Pengfei Yang, Renjue Li, Jianlin Li, Cheng-Chao Huang, Jingyi Wang, Jun Sun, Bai Xue, and Lijun Zhang. Improving neural network verification through spurious region guided refinement. In TACAS, volume 12651 of LNCS, page 12651. Springer, 2021.
  51. [Zhang et al., 2018] Mengshi Zhang, Yuqun Zhang, Ling- ming Zhang, Cong Liu, and Sarfraz Khurshid. Deep- Road: GAN-based metamorphic testing and input vali- dation framework for autonomous driving systems. In ASE, pages 132-142. ACM, 2018.
  52. [Zhang et al., 2020] Peixin Zhang, Jingyi Wang, Jun Sun, Guoliang Dong, Xinyu Wang, Xingen Wang, Jin Song Dong, and Ting Dai. White-box fairness testing through adversarial sampling. In ICSE, pages 949-960. ACM, 2020.
  53. [Zhou and Sun, 2019] Zhi Quan Zhou and Liqun Sun. Meta- morphic testing of driverless cars. CACM, 62:61-67, 2019.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards