TL;DR

Swift is a two-party (2PC) secure neural-network inference scheme that combines CKKS fully homomorphic encryption with secret sharing: FHE (coefficient encoding) handles convolutions and fully-connected layers locally on the server, and a new FHE+SS protocol handles ReLU and max pooling exactly without garbled circuits or oblivious transfer [Abstract, §I]. On the Chameleon 3-layer MNIST CNN, Swift reports 1.9x end-to-end speed-up over Cheetah (USENIX 2022) under WAN [§I, §V-C].

Problem and motivation

Two-party neural-network inference must keep the client’s input hidden from the server and the server’s model hidden from the client. Existing hybrid frameworks (Cheetah, CrypTFlow2) handle linear layers efficiently with HE but rely on garbled circuits or oblivious-transfer Millionaire protocols for ReLU/max pooling; these incur high communication and O(log p)-round interactions [§I, §II-A]. Pure-FHE alternatives need polynomial ReLU approximations and expensive bootstrapping [§IV-C]. Threat model: two-party, semi-honest, one party corrupted; network structure is not hidden; the channel is assumed authenticated and untampered [§IV-A].

Key contributions

FHE setup

ML setup

Datasets

Dataset Task Size (train/test) Modality Notes
MNIST Handwritten-digit classification Not reported 28x28 grayscale images Standard MNIST; used to evaluate end-to-end 2PC inference latency vs Cheetah [§V-A]

Pipeline diagram

flowchart LR
    subgraph Client
        A[Preprocess image] --> B[CKKS encrypt input]
        B --> K[Hold sk]
    end
    subgraph Server
        L1[Conv coeff-enc]
        EC[Pi_EC convert]
        R1[Pi_ReLU FHE+SS]
        L2[FC coeff-enc]
        EC2[Pi_EC convert]
        R2[Pi_ReLU FHE+SS]
        L3[FC coeff-enc]
    end
    subgraph Client_dec [Client]
        D[Decrypt result] --> E[argmax digit]
    end
    B -. Enc X .-> L1
    L1 --> EC
    EC -. interact .-> K
    EC --> R1
    R1 -. interact .-> K
    R1 --> L2
    L2 --> EC2
    EC2 -. interact .-> K
    EC2 --> R2
    R2 -. interact .-> K
    R2 --> L3
    L3 -. Enc logits .-> D

Pipeline steps (text)

  1. Client generates a CKKS key pair, encodes the 28x28 input under coefficient encoding, encrypts with the public key, and sends Enc(X) to the server [§IV-B, §IV-C].
  2. Server homomorphically computes the first convolution Enc(Z) = W * Enc(X) locally, without interaction [§IV-C].
  3. Server and client run Pi_EC to convert the coefficient-encoded conv output into a SIMD-encoded ciphertext [§IV-C].
  4. Server and client run Pi_ReLU (two online rounds: server sends Enc(rx - a); client decrypts and returns plain rx - a) to obtain Enc(ReLU(Z)) under SIMD encoding [§IV-B].
  5. Server converts the SIMD result back to coefficient encoding (Pi_EC) and runs the FC 720 -> 100 as a single homomorphic multiplication [§IV-C].
  6. Repeat Pi_EC and Pi_ReLU for the second activation, then run the final FC 100 -> 10 locally on the server [§V-A].
  7. Server returns the encrypted 10-d logit ciphertext to the client; client decrypts and takes argmax for the predicted digit.

Architecture diagram

flowchart LR
    I([Input 1x28x28]) --> C1[Conv 5, 5x5, s=2]
    C1 --> A1[ReLU exact via Pi_ReLU]
    A1 --> F[Flatten 720]
    F --> FC1[FC 720 to 100]
    FC1 --> A2[ReLU exact via Pi_ReLU]
    A2 --> FC2[FC 100 to 10]
    FC2 --> O([argmax])

Note: the paper also evaluates a stand-alone max-pooling protocol Pi_MP (2x2 window) in benchmarks, but the Chameleon-derived MNIST CNN it runs end-to-end does not include a max-pool layer — only two ReLUs [§V-A].

Results

End-to-end timings are reported relative to Cheetah (the paper’s tables giving absolute seconds are figures and not present as text in the OCR). All numbers below are from the body text [§I, §V-C].

Metric This paper (Swift) Baseline (Cheetah) Hardware
ReLU end-to-end, LAN 7.2x faster 1.0x 2x 16-core AMD EPYC 3.2GHz, 128GB RAM, single thread, 10Gbps / 0.3ms RTT
ReLU end-to-end, WAN 7.4x faster 1.0x same CPU, 100Mbps / 40ms RTT
Max pooling, LAN 4.5x faster 1.0x same
Max pooling, WAN 13.3x faster 1.0x same
MNIST CNN end-to-end, LAN 1.7x faster 1.0x same
MNIST CNN end-to-end, WAN 1.9x faster 1.0x same
Pi_EC encoding conversion, WAN ~29 ms (batch 2^10) seconds (NeuJeans, IDFT-based) same [§V-C]
ReLU communication per comparison 6 log q bits (~0.05 MB for ReLU-1000) 1.68 MB (Gazelle GC); 2.0 MB / 0.9 MB (MP2ML GC / GMW) n/a [§V-B]
Multiplicative depth per ReLU 1 (2 incl. next linear) 2 (3 incl. next linear) for HeFUN n/a [§V-B]
Inference accuracy on MNIST Not reported Not reported n/a

Limitations and assumptions

Cheetah (USENIX 2022) — primary baseline; CrypTFlow2; Gazelle; MP2ML (ABY: GC + GMW); HeFUN (random-masking FHE ReLU); NeuJeans (DFT-based encoding conversion); BumbleBee (dense ciphertext packing); CryptoNets; Chameleon (source of the MNIST CNN architecture); nGraph-HE2; MiniONN; SecureML; DeepSecure; XONN [§II, §IV-C, §V-B].

Code and artifacts

Not released (no repository URL is given in the paper text; the implementation references Cheetah’s open-source linear-function code under SEAL) [§V-A].

Extra diagrams (optional)

Threat model

flowchart LR
    C[Client: input X, sk] -- Enc X --> S[Server: model W]
    S -- Enc r*x - a --> C
    C -- plain r*x - a --> S
    S -- Enc result --> C

Two-party, semi-honest; one party may be corrupted but follows the protocol; channel is authenticated [§IV-A].

Open questions