TL;DR

A UNT master’s thesis that implements the same two-layer feedforward neural network (3-4-1) under both CKKS FHE (Microsoft SEAL) and Garbled Circuits (TinyGarble2.0), then benchmarks them on a shared VM under a unified NetIO instrumentation [Abstract][§1.4]. Results show GC is roughly 130× faster and ~95× more memory-efficient than CKKS for this micro-network, while FHE is the only paradigm that delivers true non-interactive inference and hides model structure [§5.7, Table 5.2].

Problem and motivation

Privacy-Preserving Machine Learning (PPML) for ML-as-a-Service must protect both the client’s input and the server’s proprietary model parameters during inference [§1.1]. Two cryptographic paradigms dominate the space — Fully Homomorphic Encryption (FHE) and Garbled Circuits (GC) — but the PPML literature lacks system-level, apples-to-apples comparisons under identical model, input, and threat-model assumptions [§3.1.1, §3.1.3]. The thesis fills that gap. Threat model: semi-honest (honest-but-curious) two-party setting, no trusted hardware, no collusion or side channels, channels assumed TLS-protected [§1.2].

Key contributions

FHE setup

ML setup

Datasets

Dataset Task Size (train/test) Modality Notes
Synthetic 3-d input vectors Functional output check vs plaintext 11 hand-chosen input vectors (e.g. [1.0,2.0,3.0]) Tabular / vector No real dataset; inputs hardcoded to remove I/O noise and isolate protocol cost [§5.1.4, Table 5.1]

Pipeline diagram

flowchart LR
    subgraph Client_FHE [Client - FHE branch]
        A1[KeyGen pk/sk/relin/galois] --> B1[Encode + encrypt x]
    end
    subgraph Server_FHE [Server - FHE branch]
        C1[Homomorphic W1·x + b1] --> C2[Square = ReLU approx]
        C2 --> C3[Homomorphic W2·z + b2]
        C3 --> C4[Poly sigmoid 0.5+0.197z-0.004z^2]
    end
    subgraph Client_FHE_dec [Client - FHE decrypt]
        D1[Decrypt + decode y]
    end
    B1 -. enc(x) + eval keys .-> C1
    C4 -. enc(y) .-> D1

    subgraph Server_GC [Server - GC branch]
        G1[Fixed-pt encode W,b] --> G2[Garble per-op netlists]
    end
    subgraph Client_GC [Client - GC branch]
        H1[Fixed-pt encode x] --> H2[Get input labels via OT]
        H2 --> H3[Eval matmul/relu/poly]
        H3 --> H4[Reveal + rescale y]
    end
    G2 -. garbled tables + metadata .-> H3
    H1 -. OT requests .-> G1

Pipeline steps (text)

  1. (FHE) Client generates CKKS public, secret, relinearization, and Galois keys, then encrypts the input vector x into a single ciphertext (8192 slots, first 3 used) [§4.4.4 step 1-2].
  2. (FHE) Client sends enc(x) + public/relin/Galois keys to the server in one batch (~151.5 MiB total) [§5.4.2].
  3. (FHE) Server homomorphically evaluates each row of W1: multiply, rotate-and-sum, add b1 [§4.4.4 step 3].
  4. (FHE) Server squares the result to approximate ReLU, then applies the second FC layer (W2, b2), then the degree-2 polynomial sigmoid; rescaling + modulus switching are applied as required by SEAL [§4.4.4 step 4-5, §4.6.2].
  5. (FHE) Server returns the output ciphertext; client decrypts and decodes [§4.4.4 step 6].
  6. (GC) Server encodes W1, W2, b1, b2 as fixed-point integers (scale 1000) and registers them as ALICE inputs via TG_int_init() [§4.5.4 step 1].
  7. (GC) Server garbles each precompiled netlist (matmul, relu, divscale, polynomial blocks) and streams the garbled tables to the client; client obtains its input labels via Oblivious Transfer [§4.5.4 step 2-3, §5.4.2].
  8. (GC) Client sequentially evaluates each garbled sub-circuit using sequential_2pc_exec_sh(), passing intermediate label wires between stages [§4.5.4 step 3-4, §4.6.3].
  9. (GC) Final output labels are revealed and rescaled back to floating point client-side [§4.5.4 step 5].

Architecture diagram

The paper compares two cryptographic systems running the same NN. The taxonomy diagram below shows the FHE-vs-GC split as well as the shared 2-layer model.

FHE-vs-GC system taxonomy

flowchart LR
    Root([SNNI under semi-honest model]) --> FHE[FHE branch]
    Root --> GC[GC branch]
    FHE --> F1[CKKS / SEAL 4.1]
    F1 --> F2[poly mod 16384]
    F1 --> F3[mod chain 60-40-40-40-30-30]
    F1 --> F4[x^2 ReLU, poly sigmoid]
    GC --> G1[TinyGarble2.0 / EMP-OT]
    G1 --> G2[fixed-pt scale 1000]
    G1 --> G3[exact ReLU, poly sigmoid]
    G1 --> G4[Half-Gates + Free-XOR]

Shared 2-layer NN

flowchart LR
    I([Input x in R^3]) --> FC1[FC W1 4x3 + b1]
    FC1 --> A1[ReLU - x^2 FHE / exact GC]
    A1 --> FC2[FC W2 1x4 + b2]
    FC2 --> A2[Sigmoid - 0.5+0.197z-0.004z^2]
    A2 --> O([Output y])

Results

Headline numbers from §5.2-§5.5 and the summary Table 5.2 [p. 64].

Metric This paper (FHE / GC) Plaintext baseline Hardware
Mean round-trip time FHE 5.07723 s (×20912); GC 0.03909 s (×161) 0.00024 s Proxmox VM, 8 vCPUs x86_64-v2 + AES-NI, 32 GB RAM, Ubuntu 24.04 [§5.1.1, Fig 5.1]
Peak memory (MaxRSS) FHE 1053.75 MB Alice / 705 MB Bob (×182); GC 11.15 MB (×2) 5.78 MB Same as above [§5.3.2, Fig 5.2]
Total data sent FHE ≈ 151.2 MiB (≈158.81 MB in Table 5.2); GC ≈ 268.8 KiB - 3.5 MiB (≈3.94 MB in Table 5.2) 28 B Same as above [§5.4.2, Fig 5.3, Table 5.2]
Communication rounds FHE 1 (non-interactive); GC 7 (6 OT + 1 reveal) n/a [§5.4.2]
Max abs output deviation vs plaintext (11 inputs) FHE 121.69%; GC 23.46% 0% [Table 5.1]
Slowdown vs plaintext (round-trip) FHE ×20912; GC ×161 ×1 [§5.2.2]

Note: single_inference_seconds in the front matter is the FHE end-to-end mean (5.07723 s); the GC counterpart is 0.03909 s. The comparison table’s single_inference_hardware describes the shared VM.

Limitations and assumptions

The thesis positions itself against survey-level prior work and prior frameworks rather than reproducing their numbers:

Code and artifacts

Extra diagrams (optional)

Threat model

flowchart LR
    A[Client / Bob - holds x] -- enc(x) + pk/relin/galois (FHE) --> S[Server / Alice - holds W,b]
    S -- enc(y) (FHE, 1 round) --> A
    A -- OT queries for x labels (GC) --> S
    S -- garbled tables + metadata (GC, 7 rounds total) --> A
    A -- output labels reveal (GC) --> A

Federated round

N/A — this is a 2-party client/server inference setting, not a federated-learning paper.

Activation approximation

Open questions