Fixed-Budget Encrypted Offloading: Edge Triage That Does Not Leak Through Its Traffic

Running a neural network on encrypted data with homomorphic encryption (HE: arithmetic performed directly on ciphertexts, so the server never sees the input) is thousands of times slower than ordinary inference and inflates each input into a very large ciphertext. An obvious way to cut that cost is to let the sensing device, such as a drone, a wearable gateway, or a camera, act as a filter. It would classify easy inputs itself with a small plaintext model and encrypt and upload only the hard ones. The problem is that this filter works by changing when and how much the device transmits. HE hides the contents of a ciphertext but not the fact that one was sent. A patient monitor that goes quiet for hours and then suddenly uploads has told an eavesdropper that something abnormal happened, and the encryption does nothing to prevent that.

We propose to fix the device's upload schedule instead of letting it vary. Every epoch, the device sends exactly one packed ciphertext with a fixed number of slots $B$. The edge filter's job changes from deciding whether to send to deciding what fills the fixed slots: it ranks recent inputs by difficulty, packs the top $B$, and fills any unused slots with encrypted dummies. The server and the network then observe the same constant-rate, constant-size stream no matter what the device sees. The cloud's cost per epoch is one fully used ciphertext, which also matches how packed HE schemes like to be run. The research question is how much accuracy this leak-free design gives up, compared with the leaky variable-rate cascade and with encrypting everything, for a given cryptographic budget.

Core Claim

Packed HE schemes like CKKS pay roughly the same cost for a ciphertext whether its thousands of slots are full or nearly empty. CryptoNets packs 4,096 values per ciphertext to reach high throughput, and HTCNN interleaves images to approach full slot use on edge-class CPUs. Edge filtering, by contrast, produces sparse and bursty streams, so naively combining the two either wastes slots or delays results. We claim that fixing the ciphertext budget per epoch in advance, and learning a difficulty ranking that decides what fills it, resolves two problems at once. First, the traffic side channel disappears, because traffic volume and timing no longer depend on the data. Second, the slot-underuse problem disappears, because the budget is always spent. We further claim that, at a budget well below the raw input rate, this design keeps most of the accuracy benefit of cloud offloading.

Let $r$ be the raw input rate, $T$ the epoch length, and $B$ the slot budget per epoch, with $B < rT$. The expected accuracy is

$$\text{Acc}(B,T) = \mathbb{E}\big[\,\mathbb{1}[x \in S_B]\, a_{\text{cloud}}(x) + \mathbb{1}[x \notin S_B]\, a_{\text{edge}}(x)\,\big].$$

Here $S_B$ is the set of $B$ inputs the filter selects in an epoch, $a_{\text{cloud}}(x)$ is the probability that the encrypted cloud model is correct on input $x$, and $a_{\text{edge}}(x)$ is the probability that the on-device model is correct. The selection $S_B$ is worthwhile only where the gap $a_{\text{cloud}} - a_{\text{edge}}$ is large. The filter should therefore be trained to predict that gap, not raw uncertainty.

Relation to Prior Work

Two lines of work motivate the proposal. Edge-cloud cascades show that difficulty-based routing pays off in plaintext: the difficult-case discriminator for object detection keeps easy frames on the device and uploads hard ones to a large cloud model, and MINIONS uses a small local language model to condense context before cloud calls. Neither system encrypts anything, and both let upload volume track content, which is exactly the behavior we remove. Encrypted edge pipelines, in turn, show the cost of skipping triage. The UAV face detection system encrypts every captured frame under CKKS and states that it never measured latency or energy on real hardware. HTCNN batches every input without selecting among them. We keep their encrypted cloud models and add the budgeted selection step.

Three works supply methods we reuse. HTCNN supplies the packing and rotation tricks for the cloud-side evaluator. HEMET supplies its lesson that encrypted-model latency is governed by multiplicative depth (the number of sequential multiplications) rather than by FLOPs. That lesson constrains the cloud architecture we choose: shallow and wide.

Selective-encryption work is the closest in spirit but encrypts a different thing. Bi-CryptoNets encrypts a fixed central region of each image. SecDOOD encrypts the top half of feature channels ranked by importance scores computed offline. SHE-LoRA encrypts the most privacy-relevant fraction of fine-tuning parameters. All three choose which parts of each item to encrypt. We choose which items reach the encrypted model, and we require that the choice itself stays hidden.

SAFHIRE constrains the design. Its interactive protocol makes the client decrypt and re-encrypt between layers, and the authors acknowledge that the client must stay online throughout. That rules out interactivity for intermittently connected devices, so our cloud evaluation is non-interactive leveled HE: one upload and one download per epoch.

Research Program

The system has three parts.

The first part is a small plaintext on-device classifier with a gap-predicting head. The head is trained on held-out data to estimate $a_{\text{cloud}}(x) - a_{\text{edge}}(x)$, using the empirical correctness of the encrypted cloud model, which is measured by running it once offline in plaintext simulation of its polynomial activations.

The second part is an epoch scheduler with parameters $(B, T)$. It keeps a buffer of inputs that arrived during the epoch. At the epoch boundary it packs the top-$B$ inputs by predicted gap into one CKKS ciphertext, fills the remaining slots with encryptions of a fixed dummy input, and sends the ciphertext. If more than $B$ inputs are selected, the overflow is labeled by the edge model. Worst-case latency is therefore bounded by $T$ plus one cloud evaluation. The device decrypts the returned results; the cloud never learns which slots were real.

The third part is a depth-limited cloud CNN compiled with HTCNN-style packing. It uses Chebyshev-approximated activations as in the UAV system, and it is materially stronger than the edge model on hard inputs.

Analytically, we will state the security argument: under the semantic security of CKKS and a data-independent schedule, the network transcript is independent of both the inputs and the filter's decisions. We will also derive how $\text{Acc}(B,T)$ behaves in two regimes, bursty event streams, where buffering over a longer $T$ helps, and uniform streams, where it does not.

Baselines

The naive reference is encrypt-everything: HTCNN-style batching of every input through the same cloud model, sized to the raw rate. On MNIST, HTCNN reports 15.6 images per second at 98.95% accuracy. On CIFAR-10 it processed 227 images in 678 seconds at 74.19% accuracy. We rerun it on our hardware and with our cloud model so that both cost and accuracy are measured under identical conditions.

The strongest existing method on the efficiency axis is the variable-rate cascade. It adapts the difficult-case discriminator to our setting: it encrypts and uploads each hard input as it appears, packed as soon as a batch or timeout is reached. In plaintext, that paper reports about a 50% cut in uploaded data, with mAP at 91.22% to 92.52% of cloud-only. No encrypted version of this cascade has a reported result on Lacuna. It shares our edge model, cloud model, and gap threshold, tuned with the same budget. We beat it if our method matches its accuracy within one point at equal average ciphertext count, while its traffic leaks and ours does not.

The key ablation is uniform subsampling at budget $B$: the same fixed schedule, but slots are filled with randomly chosen inputs. This isolates the value of learned selection. The difficulty-ranked version must beat it clearly at every $B$ below the raw rate.

We also run a ranking-by-edge-entropy variant to test whether predicting the cloud–edge gap matters beyond plain uncertainty.

We include an edge-only model as the lower bound and a trusted-enclave reference as the non-cryptographic speed bound. For the enclave, the systematic comparison reports TF-Trusted at about 0.14 s per image, against about 549 s and roughly 56 GB for HE-Transformer on malaria cell images.

Why not just…?

Why not just use the variable-rate cascade and pad it with cover traffic? Padding a variable-rate stream until it hides its bursts means sending at its peak rate, which costs about as much as encrypting everything. Padding to anything less still leaks when bursts exceed the padding. Our design is in fact a principled form of padding. What it adds is a chosen budget below the peak and a learned ranking that decides which inputs lose out when a burst exceeds that budget. The uniform-subsampling ablation shows whether that ranking is worth anything. If it is not, the honest conclusion is that constant-rate padding alone is enough.

Why not just use a trusted enclave? It is roughly three orders of magnitude faster in the systematic comparison, and for many deployments it is the right answer. However, that same study notes the enclave's limited protected memory, and enclaves rely on hardware isolation rather than a mathematical hardness assumption. More importantly for this proposal, an enclave does not fix the traffic side channel either: a variable-rate upload into an enclave leaks just as much. Our scheduler applies unchanged to an enclave backend, and we will report that pairing as well.

Why not run everything on the device? This option is a real threat whenever the edge model is nearly as good as the cloud model. That can easily happen because encrypted models are weakened by polynomial activations, as HTCNN's 74.19% on CIFAR-10 shows. The edge-only baseline settles the question directly. If the measured cloud–edge gap on hard inputs is small, the method has no reason to exist on that task, and we will say so. The standing reason to consult the cloud is that model owners in encrypted inference settings keep their weights off client devices.

Proposed Experiments

We build input streams from MNIST, CIFAR-10, and DroneFace. The UAV paper reports 95.139% encrypted accuracy on DroneFace, against 95.602% unencrypted. Each stream mixes "event" items (hard or target-class) with background items, at event densities from 1% to 30%, under both uniform and bursty (Markov-switching) arrival patterns.

We measure four things: accuracy; ciphertexts and bytes per hour; worst-case and mean latency; and edge energy on a single-board computer. The cryptographic side runs on an HTCNN-class CPU.

Leakage is measured empirically. We train a classifier to predict event occurrence from traffic traces (timing and size) and report its AUROC. The variable-rate cascade should score near 1.0, and our schedule should score near 0.5.

The decisive check is the accuracy-versus-budget curve. At a budget of 10% of the raw rate, on bursty streams with 5% event density, the fixed-budget method should retain at least 95% of encrypt-everything accuracy while holding traffic-classifier AUROC near 0.5. It should also beat uniform subsampling by a clear margin. If learned selection does not beat random selection, or if the leak-free schedule needs budgets near the peak rate to match the leaky cascade, the idea fails in its current form.