Due to their widespread use on heterogeneous hardware devices, deep learning (DL) models are compiled into executables by DL compilers to fully leverage low-level hardware primitives. This approach allows DL computations to be undertaken at low cost across a variety of computing platforms, including CPUs, GPUs, and various hardware accelerators. We present BTD (Bin to DNN), a decompiler for deep neural network (DNN) executables. BTD takes DNN executables and outputs full model specifications, including types of DNN operators, network topology, dimensions, and parameters that are (nearly) identical to those of the input models. BTD delivers a practical framework to process DNN executables compiled by different DL compilers and with full optimizations enabled on x86 platforms. It employs learning-based techniques to infer DNN operators, dynamic analysis to reveal network architectures, and symbolic execution to facilitate inferring dimensions and parameters of DNN operators. Our evaluation reveals that BTD enables accurate recovery of full specifications of complex DNNs with millions of parameters (e.g., ResNet). The recovered DNN specifications can be re-compiled into a new DNN executable exhibiting identical behavior to the input executable. We show that BTD can boost two representative attacks, adversarial example generation and knowledge stealing, against DNN executables. We also demonstrate cross-architecture legacy code reuse using BTD, and envision BTD being used for other critical downstream tasks like DNN security hardening and patching.
翻译:由于不同硬件装置的广泛使用,深度学习(DL)模型被汇编成DL编译员的可执行文件,以充分利用低水平硬件原始数据。这一方法使得DL计算能够以低成本在各种计算平台中进行,包括CPU、GPU和各种硬件加速器。我们提供了BTD(Bin to DNNN),这是深层神经网络可执行软件的解析器。BTD采用DNNNN的可执行文件和产出全模规格,包括DNN操作员的类型、网络表层学、尺寸和参数,与输入模型的相同。这个方法使得DLNNT的计算可以以低成本进行计算。BTD提供了一个实用的框架,由不同的 DL编译员汇编的DNNT的可执行文件,并在 x86 平台上进行了全面优化。我们采用了基于学习的技术来推导DNNN操作员,用动态分析来显示DNNN的可推断尺寸和参数。我们的评估表明,BTD能够准确恢复复杂的DTD的完整规格, 并显示REDNNN的准确的精确操作,并显示其尾部前的版本,可以显示前的SDNNNND。