Abstract
We present CRYPTFLOW, a system that converts TensorFlow inference code into Secure Multi-party Computation (MPC) protocols at the push of a button. To do this, we build two components. Our first component is an end-to-end compiler from TensorFlow to a variety of MPC protocols. The second component is an improved semi-honest 3-party protocol that provides significant speedups for inference. We empirically demonstrate the power of our system by showing the secure inference of real-world neural networks such as DENSENET121 for detection of lung diseases from chest X-ray images and 3D-UNet for segmentation in radiotherapy planning using CT images. In particular, this paper provides the first evaluation of secure segmentation of 3D images, a task that requires much more powerful models than classification and is the largest secure inference task run till date.
Introduction: The Usability and Scalability Gaps
Secure Multi-party Computation (MPC) offers a promising solution for privacy-preserving machine learning, allowing a data owner (e.g., a hospital) and a model owner (e.g., a diagnostic company) to compute results without exposing their private inputs. However, two major hurdles have prevented its widespread adoption in clinical settings:
- The Usability Gap: Historically, converting high-level Deep Learning (DL) models into cryptographic circuits required manual, expert-level intervention. This process is error-prone and often leads to accuracy degradation when moving from floating-point to fixed-point arithmetic.
- The Scalability Gap: Most MPC benchmarks have been limited to small-scale datasets like MNIST. Real-world medical imaging requires massive architectures like DenseNet121 or 3D-UNet, which involve trillions of operations and significant communication overhead.
CRYPTFLOW addresses these challenges by providing a "push-button" toolchain that automates the transition from standard TensorFlow code to optimized MPC protocols.
The CRYPTFLOW Toolchain
CRYPTFLOW consists of two primary components designed to bridge the gap between high-level ML development and low-level cryptographic execution.
Athos: Bridging the Usability Gap
Athos is the compiler frontend of the system. It takes a pre-trained TensorFlow model and compiles it through two intermediate representations: High-Level Intermediate Language (HLIL) and Low-Level Intermediate Language (LLIL).
A critical feature of Athos is its automated float-to-fixed-point conversion. It performs a search across various precision levels to identify a scale that maintains the model's original floating-point accuracy while remaining compatible with the integer-based math required by MPC protocols. This automation ensures that ML practitioners do not need to manually rewrite their models for secure execution.
Porthos: Optimizing for Scalability
Porthos is an optimized semi-honest 3-party computation (3PC) protocol. It introduces two key improvements over previous state-of-the-art protocols like SecureNN:
- Convolution Optimization: By utilizing smarter matrix reshaping, Porthos reduces the communication required for Beaver triples—a standard multiplication technique—by up to two orders of magnitude.
- Efficient Non-linear Layers: It reduces the communication cost of ReLU and MaxPool layers by 25% by eliminating redundant secret shares.
Experimental Evaluation and Results
The researchers evaluated CRYPTFLOW on high-stakes medical imaging tasks, providing the first-ever secure execution of large-scale 3D medical image segmentation.
Medical Imaging Benchmarks
- Lung Disease Detection: Using DenseNet121 on the NIH Chest X-ray dataset, the system achieved an average AUROC of 0.845. Crucially, there was zero loss in accuracy compared to the non-secure, cleartext model.
- 3D Radiotherapy Planning: The system performed secure 3D-UNet segmentation on pelvic CT scans to identify tumors and organs at risk. This task requires approximately 1.87 Teraflops per inference, a scale previously considered unreachable for MPC.
Performance Metrics
Porthos demonstrated a 1.4x to 1.5x speedup over SecureNN. While secure inference remains slower than cleartext—for instance, a 3D-UNet segmentation takes approximately 1 hour and 57 minutes—this latency is often acceptable in clinical workflows where manual segmentation by specialists can take several hours and radiotherapy planning typically spans multiple days.
Conclusion and Future Directions
CRYPTFLOW demonstrates that cryptographic privacy can scale to real-world clinical models without sacrificing accuracy or requiring specialized cryptographic knowledge from ML developers. While the communication volume for 3D tasks remains high (e.g., 557 GB for 3D-UNet), the system proves that secure, automated medical image analysis is a viable reality. Future work will likely focus on reducing communication overhead and extending these optimizations to malicious security models.
Summary updated