Batch-Oriented Element-Wise Approximate Activation for Privacy-Preserving Neural Networks
摘要
Privacy-Preserving Neural Networks (PPNN) offer a crucial solution for maintaining user privacy protection while enabling deep learning tasks. However, integrating Fully Homomorphic Encryption (FHE) into PPNN faces challenges, particularly in handling non-linear activation functions. This paper introduces novel approaches to address these challenges. The proposed method involves batch-oriented element-wise data packing and approximate activation, which train linear low-degree polynomials to approximate the non-linear activation function like ReLU. Compared with other approximate activation methods, the proposed fine-grained, trainable approximation scheme can effectively improve the inference efficiency, and reduce the inference accuracy loss caused by approximation errors. By employing element-wise data packing, the system can process large batches of images simultaneously, maximizing the utility ratio of ciphertext slots. Although this may lead to increased total inference time, the amortized time for each image decreases, especially with larger batch sizes. Additionally, knowledge distillation is employed during training to further enhance inference accuracy. Experimental results demonstrate significant inference efficiency improvements without sacrificing the inference accuracy. When performing ciphertext inference on 4096 input images, compared to the current most efficient channel-wise method, this approach improves accuracy by \(1.65\%\) while reducing amortized inference time by \(99.5\%\) .