MGtest: Python Coverage-Guided Model-Level Fuzzing for DL Frameworks
摘要
Deep learning frameworks, as core infrastructure for building artificial intelligence systems, directly impact model reliability through their security. Existing model-level fuzzing approaches exhibit limitations in detecting framework vulnerabilities: model mutation operators lack multi-dimensional design for layer structures, and mutation scheduling strategies fail to effectively utilize code coverage feedback. To address these challenges, this paper proposes a novel model-level fuzzing method named MGtest. First, we design multi-granularity model mutation techniques that generate diverse test cases. By modifying convolutional layer parameters, deep logical errors in frameworks are triggered. Second, we propose a dynamic coverage-guided mutation scheduling algorithm that employs dynamic instrumentation to collect real-time Python code coverage, optimizing seed energy allocation and mutation operator priorities to enhance testing efficiency. Experiments on TensorFlow and PyTorch frameworks validate the method’s effectiveness using 12 classical models. Results demonstrate that MGtest improves code coverage by 26.5% and 19.4% on TensorFlow and PyTorch, respectively, while detecting 2 new vulnerabilities in PyTorch. Compared to the state-of-the-art tool LEMON, the multi-granularity mutation strategy significantly strengthens framework vulnerability detection capabilities, and the coverage feedback mechanism improves testing resource utilization.