Bi-CryptoNets: Leveraging Different-Level Privacy for Encrypted Inference

Man-Jie Yuan, Zheng Zou, Wei Gao

Abstract

Privacy-preserving neural networks have attracted increasing attention in recent years, and various algorithms have been developed to keep the balance between accuracy, computational complexity, and information security from the cryptographic view. This work takes a different view from the input data and structure of neural networks. We decompose the input data (e.g., some images) into sensitive and insensitive segments according to importance and privacy. The sensitive segment includes important and private information such as human faces, and we take strong homomorphic encryption to keep security, whereas the insensitive one contains background and we add perturbations. We propose the bi-CryptoNets, i.e., plaintext and ciphertext branches, to deal with two segments, respectively, and the ciphertext branch could utilize the information from the plaintext branch by unidirectional connections. We adopt knowledge distillation for our bi-CryptoNets by transferring representations from a well-trained teacher neural network. Empirical studies show the effectiveness and decrease of inference latency for our bi-CryptoNets.

Introduction

Machine Learning as a Service (MLaaS) has revolutionized how users interact with powerful AI models, allowing them to upload data to cloud servers for complex inference tasks. However, this convenience introduces significant privacy risks. While Homomorphic Encryption (HE) has emerged as the standard solution—allowing servers to perform computations on encrypted data without ever decrypting it—it remains notoriously slow.

A primary reason for this inefficiency is "ciphertext spread." In standard convolutional layers, the influence of a single encrypted pixel eventually spreads across the entire feature map, forcing the entire network to perform computationally expensive HE operations. Bi-CryptoNets addresses this bottleneck by challenging the assumption that every pixel in an image requires the same level of privacy protection.

The Bi-CryptoNets Architecture

Bi-CryptoNets introduces a "divide and conquer" strategy by splitting input data into sensitive and insensitive segments. This allows the system to apply heavy-duty encryption only where it is truly needed. The architecture consists of two parallel paths:

  1. Ciphertext Branch: This branch handles the "sensitive" segment (e.g., the center of an image containing a face) using the CKKS homomorphic encryption scheme. This ensures high-level security for the most critical data.
  2. Plaintext Branch: This branch processes the "insensitive" segment (e.g., the background) using standard plaintext computation. To maintain a baseline of privacy, noise and perturbations are added to this data.

Technical Innovations

To ensure the two branches work harmoniously without compromising security, the authors implemented several key innovations:

  • Unidirectional Connections: To improve prediction accuracy, the ciphertext branch is allowed to "borrow" features from the plaintext branch. Crucially, this is a one-way street; information never flows from the ciphertext side back to the plaintext side, preventing sensitive data leakage.
  • Channel-Rotation: Because the two branches may have different channel dimensions, a channel-rotation function is used. This allows the ciphertext branch to automatically extract and align useful information from multiple plaintext channels.
  • Feature-based Knowledge Distillation (FKD): Decomposing an image can lead to a loss of global context, which typically hurts accuracy. To mitigate this, the authors use a "teacher" network (trained on the full, unencrypted image) to coach the bi-branch "student" network. This helps the student learn internal representations that account for the missing global context.
  • BHW Packing: The researchers developed a new data packing method that allows multiple image segments to be processed within a single encrypted ciphertext, maximizing the efficiency of each HE operation.

Experimental Evaluation

The researchers evaluated Bi-CryptoNets on three standard benchmarks: MNIST, CIFAR-10, and CIFAR-100. For these tests, the "sensitive" segment was defined as a quarter-sized square in the center of the image—a common heuristic for centered objects.

Key Results

Bi-CryptoNets demonstrated superior performance compared to existing privacy-preserving frameworks like LoLa, SHE, and CryptoDL:

  • Significant Speedups: The model reduced inference latency by 1.15x to 3.43x for single images. In batch processing scenarios, the amortized latency dropped by a factor of 4.59x to 13.7x.
  • Improved Accuracy: Interestingly, the model often outperformed the non-decomposed backbone. On the CIFAR-10 dataset, Bi-CryptoNets achieved a 2.1% accuracy improvement over the baseline.
  • Computational Efficiency: On the MNIST dataset, the architecture reduced the number of heavy Homomorphic Encryption operations (HEOPs) by 2.35x.

Conclusion and Future Work

Bi-CryptoNets proves that privacy in neural networks does not have to be a binary choice between total encryption and total exposure. By recognizing that different parts of a data instance have different privacy requirements, Bi-CryptoNets achieves a more favorable balance between security and speed.

Future research will focus on moving beyond fixed sensitive areas. In real-world applications, sensitive information like license plates or faces can appear anywhere in a frame. Developing methods to dynamically detect and segment these areas for irregular shapes will be critical for the deployment of Bi-CryptoNets in diverse, real-world MLaaS environments.

Summary updated

BibTeX
@inproceedings{yuan2024bi,
  author = {Man-Jie Yuan and Zheng Zou and Wei Gao},
  title = {{Bi-CryptoNets: Leveraging Different-Level Privacy for Encrypted Inference}},
  booktitle = {PAKDD},
  year = {2024},
  url = {https://openreview.net/forum?id=BYMdWGUYEV},
}
Figure