NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CrypTFlow: Secure TensorFlow Inference

Nishant Kumar, Mayank Rathee, Nishanth Chandran, Divya Gupta, Aseem Rastogi, Rahul Sharma

TL;DR

CrypTFlow is the first end-to-end system that automatically converts standard TensorFlow models into Secure Multi-party Computation (MPC) protocols. It enables private, high-accuracy inference on massive ImageNet-scale networks like ResNet50 in under 30 seconds, providing a "push-button" solution for developers to deploy privacy-preserving machine learning.

What Problem Does This Paper Address?

While Secure Multi-party Computation (MPC) theoretically allows parties to compute functions on private data without revealing the inputs, applying it to Deep Learning (DL) has faced three major hurdles:

  1. Usability Gap: Machine learning developers use frameworks like TensorFlow, while MPC requires low-level cryptographic libraries. Manually rewriting complex models is error-prone and impractical.
  2. Scalability: Most prior secure inference systems were limited to "toy" datasets like MNIST or CIFAR-10. Running a 50-layer ResNet on ImageNet was considered computationally prohibitive.
  3. Security vs. Performance: Most efficient protocols assume "semi-honest" behavior (parties follow the rules but try to learn secrets). Protecting against "malicious" adversaries (who might deviate from the protocol) usually incurs a massive performance penalty.

Methods

The authors introduce a three-component toolchain to bridge these gaps:

  • Athos: An end-to-end compiler that takes a TensorFlow graph and converts it into a series of MPC-friendly operations. It features an automated float-to-fixed-point converter that treats the precision scale as a hyperparameter, "sweeping" to find the setting that maintains original model accuracy.
  • Porthos: A specialized 3-party computation (3PC) protocol. It optimizes convolutions by reducing the communication overhead of "Beaver triples" (a standard MPC technique for multiplication). By exploiting the structure of how filters move across images, it avoids redundant data transfers, making it significantly faster than previous 3PC protocols like SecureNN.
  • Aramis: A novel technique to achieve malicious security. It uses Trusted Execution Environments (TEEs) like Intel SGX to sign protocol messages. Crucially, Aramis only relies on the hardware for integrity (proving the protocol was followed) rather than confidentiality. This means even if the hardware's memory isolation is breached (a common vulnerability in SGX), the data remains private due to the underlying MPC.

Datasets

The authors evaluate CrypTFlow on a variety of benchmarks to demonstrate real-world utility:

  • ImageNet: Used to test large-scale models including ResNet50, DenseNet121, and ResNet200.
  • MNIST & CIFAR-10: Used for head-to-head comparisons with prior state-of-the-art systems.
  • Healthcare Case Studies: Evaluation on a Chest X-Ray dataset (predicting lung disease) and a Diabetic Retinopathy dataset, highlighting the system's potential for sensitive medical data.

Key Insights and Ideas

  • The "Push-Button" Philosophy: By targeting TensorFlow directly, the authors lower the barrier to entry for ML practitioners who aren't cryptography experts.
  • Integrity is Enough: The most striking insight is in Aramis. By using TEEs solely for integrity checks, they achieve malicious security with only a ~3x overhead over semi-honest protocols—a massive improvement over pure cryptographic approaches.
  • Fixed-Point Automation: Manually converting floating-point models to fixed-point integers is the "dark art" of secure inference. Athos automates this by treating it as a validation task, ensuring no loss in classification accuracy.
  • Communication is the Bottleneck: Porthos focuses on reducing the amount of data sent between parties rather than just the number of rounds, which is the primary factor in scaling to ImageNet.

Key Results

  • ImageNet Performance: CrypTFlow performed secure inference on ResNet50 in 25.9 seconds (semi-honest) and 75.4 seconds (malicious). This is the first time ImageNet-scale secure inference has been demonstrated at these speeds.
  • Accuracy Parity: The system achieved a Top-1 accuracy of 76.45% on ResNet50, matching the performance of plaintext TensorFlow.
  • Efficiency Gains: On standard MNIST benchmarks, Porthos was between 10x and 46x faster than concurrent malicious-secure frameworks like MP-SPDZ.
  • Scalability: The system demonstrates linear scaling with the depth of the neural network, proving it can handle the trend toward increasingly deep models.

Limitations and Future Work

  • CPU Bound: The current implementation is optimized for CPUs. The authors note that porting MPC protocols to GPUs is a significant challenge due to the high communication-to-computation ratio.
  • Training vs. Inference: CrypTFlow focuses on inference. Secure training is orders of magnitude more complex and remains a frontier for future research.
  • Hardware Requirement: Aramis requires hardware with attestation capabilities (like SGX), which may not be available in all cloud environments.
  • Protocol Support: While modular, the system currently supports a specific set of 2PC and 3PC backends; adding support for more parties or different trust models (e.g., honest majority vs. dishonest majority) is a direction for future expansion.

Summary updated

BibTeX
@inproceedings{kumar2020cryptflow,
  author = {Nishant Kumar and Mayank Rathee and Nishanth Chandran and Divya Gupta and Aseem Rastogi and Rahul Sharma},
  title = {{CrypTFlow: Secure TensorFlow Inference}},
  booktitle = {IEEE Symposium on Security and Privacy},
  year = {2020},
  url = {https://openreview.net/forum?id=gWhOcYHq33Q},
}
Figure