TL;DR

The paper presents EDLaaS, a Dockerized client-server system that runs encrypted inference of a 1D CNN under CKKS to forecast dairy milk yields, achieving an MAPE of 12.4% (87.6% accuracy) on a 30-year dataset from the Langhill Dairy herd while keeping data private end-to-end [Abstract][§3]. It is one of the first encrypted-deep-learning works to target sequence data and a real-world agri-food problem rather than image classification [§1].

Problem and motivation

Agri-food stakeholders are hesitant to share commercially sensitive data (genetics, feed composition, yields) needed to train ML models, blocking collaborations on yield forecasting and sustainability [§1.1]. FHE removes the need to trust the data processor: the server computes on ciphertexts without ever holding the secret key [§1.1]. The threat model is an honest-but-curious / potentially malicious data processor — the authors keep HTTPS on top of FHE specifically to defend against application-layer attacks such as MITM and unauthenticated servers that could return purposefully wrong predictions [§2]. Prior FHE-DL work focused on CNNs over images (MNIST, CIFAR) and had not been validated on sequence data or in realistic client-server deployments [§1].

Key contributions

FHE setup

ML setup

Datasets

Dataset Task Size (train/test) Modality Notes
Langhill Dairy herd (SRUC, Dumfries) Milk-yield regression (sequence) 40,389 train / 17,309 test (further 70-30 train/val split inside training) from 57,698 sequences derived from 93,283 time-points Tabular time series, 7 numeric/derived features × 21 time-points per cow 30 years of breeding/feeding/yield data; normalized to [0,1] with z = (x−min)/(max−min); categoricals one-hot; temporal 70-30 split [§2.1.1]

Pipeline diagram

flowchart LR
    subgraph Client [Client / Jetson Nano]
        A[Wrangle data] --> B[Normalize 0-1]
        B --> E[Encrypt CKKS]
    end
    subgraph Server [Server Docker stack]
        N[Nginx reverse proxy] --> F[Flask REST API]
        F --> I[1D CNN forward]
        I --> R[Relinearize+rescale]
        R --> M[Modulus switch down]
        M --> DB[(MongoDB)]
    end
    subgraph ClientDec [Client]
        D[Decrypt sk] --> P[Postprocess yield]
    end
    E -. HTTPS ciphertext .-> N
    M -. HTTPS ciphertext .-> D

Pipeline steps (text)

  1. Owner uploads raw milk-yield data via dashboard to Jetson Nano edge device [§2.2].
  2. Edge device wrangles 7 features × 20-week rolling window and normalizes to [0,1] [§2.1.1].
  3. Edge device CKKS-encrypts the input with a locally held secret key and serializes the ciphertext [§2.1.2].
  4. Ciphertext is sent over HTTPS to the server (Nginx reverse-proxy + load-balanced Flask/WSGI containers) [§2.1.3][Fig. 1].
  5. Server runs encrypted forward pass of the 1D CNN, applying relinearization and rescaling after each ciphertext multiplication [Fig. 1].
  6. Server modulus-switches down to the smallest ciphertext before storing/returning the result [§2.1.3].
  7. Server returns ciphertext over HTTPS to client; client decrypts with secret key and post-processes the predicted yield [§2.1.3].

Architecture diagram

flowchart LR
    I([Input 7x20 window]) --> CC[1D CNN filter 5x1x7]
    CC --> A1[poly-sigmoid]
    A1 --> D1[Dense 16]
    D1 --> A2[poly-sigmoid]
    A2 --> O([y_hat milk yield])
    O --> L[MSE loss plaintext]

Results

Metric This paper Baseline Hardware
MAPE / accuracy on milk yield 12.4% MAPE / 87.6% accuracy [§3] Same architecture in plaintext: identical to 3 s.f. [Table 3] LAN, MS-SEAL via Python-ReSeal
MSE (test) ciphertext vs plaintext 0.02233 / 0.02233 [Table 3] — LAN
MAE (test) ciphertext vs plaintext 0.1241 / 0.1241 [Table 3] — LAN
Single inference latency 0.966 s local; 3.13 s remote (incl. transmission) [Table 2] — Local LAN; CPU model not reported
Encryption 0.0136 s local; 0.454 s remote [Table 2] — LAN
Decryption 0.0330 s local; 1.14 s remote [Table 2] — LAN
Cipher×Cipher mul 0.277 s [Table 2] Cipher×Plain mul: 0.0500 s LAN
Ciphertext size (len 8192, poly-mod 16,384) 9,600,592 bytes (≈9.60 MB) vs plaintext NumPy 65,648 bytes (≈0.0656 MB) [Table 4] — —

Limitations and assumptions

CryptoNets (Gilad-Bachrach et al.) [Ref 1]; Lee et al. 2021 CKKS deep CNN on CIFAR-10 [Ref 5]; GAZELLE (Juvekar et al., BFV via PALISADE) [Ref 6]; DOReN (Meftah et al.) [Ref 4]; Marcano et al. FHE-DL [Ref 3]; Ali et al. polynomial-ReLU [Ref 12]; Chen et al. logistic regression over CKKS (source of the sigmoid approximation) [Ref 23].

Code and artifacts

Python-ReSeal: https://github.com/DreamingRaven/python-reseal [Ref 22]. License: OSLv3 [§2.3].

Extra diagrams (optional)

Threat model

flowchart LR
    O[Data owner] -- raw data --> J[Jetson Nano edge]
    J -- enc CKKS x over HTTPS+TLS --> S[Server Nginx+Flask+MongoDB]
    S -- enc CKKS y_hat over HTTPS+TLS --> J
    J -- decrypted yield --> O
    note[Server is honest-but-curious; HTTPS guards against MITM and rogue servers]

Activation approximation

Sigmoid is replaced by σ(x) ≈ 0.5 + 0.197x − 0.004x³ (Chen et al., cubic) [Eq. 4]. Approximation is faithful on [−5, 5]; outside this range it diverges. Authors normalize inputs to [0,1] and keep filter/dense weights initialized within [0,1] (and divided by filter size 5·1·7=35) so the sum-of-products stays below 1 and activations remain inside the approximation’s “golden range” [§2.4.1][Fig. 5].

Open questions