Manuscript Offprint
arXiv:2609.09357Encrypt What Matters: When Selective Homomorphic Inference Is Efficient
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Fully homomorphic encryption (FHE) enables inference on private data without revealing it to the server, but evaluating an entire input under FHE is expensive. We study selective homomorphic inference, where only a sensitive region of interest (ROI) is encrypted, and computations independent of that region are performed in plaintext. Selective evaluation produces the same output as full FHE on the same model, without retraining. Its efficiency depends on how quickly encrypted dependencies spread through the network. For small encrypted ROIs, locality-preserving architectures can achieve order-of-magnitude homomorphic-evaluation speedups, whereas architectures with early global mixing provide essentially no speedup. These results identify locality as the key architectural property governing the benefit of selective homomorphic inference.
1 Introduction
Machine-learning inference is increasingly performed by remote services: a client sends an input to a server that owns a trained model and receives its prediction. This is convenient, but problematic when the input contains private information such as a medical image, an identity document, or a personal photograph. Fully homomorphic encryption (FHE) provides a way to run such inference without revealing the input to the server [Gentry, 2009]. With ordinary encryption, data must normally be decrypted before they can be processed, while FHE allows computation to be performed directly on encrypted values: the client encrypts an input x, the server evaluates the model on the ciphertext and returns an encrypted prediction that only the client can decrypt. The server therefore performs the inference without seeing the protected data.
The main obstacle is cost. Operations on encrypted values are substantially more expensive than ordinary arithmetic, making homomorphic neural-network inference much slower than plaintext inference [Gilad-Bachrach et al., 2016, Chou et al., 2018]. A large body of work has therefore focused on making encrypted inference cheaper. CryptoNets first demonstrated neural-network inference on encrypted inputs [Gilad-Bachrach et al., 2016], and subsequent systems improved its practicality through FHE-friendly architectures, discretizations, sparsity, packing, and programmable bootstrapping [Bourse et al., 2017, Brutzkus et al., 2019, Chou et al., 2018, Chillotti et al., 2021]. These approaches largely assume that the entire input is private and therefore encrypt the complete input.
In many applications, however, sensitivity is spatially local. A photograph may contain a sensitive face, a scan a particular lesion, or a document a name or identifier, while much of the remaining input can be public. Recent work has therefore considered encrypting only sensitive regions. PFHE [Dai, 2025] selectively encrypts privacy-sensitive image regions for CNN inference, while [Bakas and Schoinianakis, 2026] develops a general hybrid protocol for encrypted regions of interest (ROIs). These works establish that selective encryption is possible and can reduce computation when only part of an input must be hidden. In this work, we characterize how encrypted dependencies propagate

Figure 1: Selective homomorphic inference evaluates only the computations that depend on the encrypted ROI under FHE. The output remains identical to full encryption.
Algorithm 1 SELECTIVEHOMOMORPHICEVALUATION
Require: quantized network , input , public ROI index set
1: Client: Send and the visible pixels to the server.
2: Server: Construct the full inference circuit for .
3: Server: Propagate through to identify the tainted computation.
4: Server: Partially evaluate on the visible pixels to get the reduced circuit .
5: Client: Encrypt and send to the server.
6: Server: Evaluate homomorphically on and return the encrypted output.
7: Client: Decrypt the encrypted output to obtain .
through a network and when selective encryption retains a computational advantage. We notice that encrypting fewer input pixels does not necessarily mean performing proportionally less homomorphic inference. Neural networks repeatedly mix their inputs. After several layers, an activation far outside the original ROI may still depend on an encrypted pixel and must therefore also be computed homomorphically.
This paper asks: when is selective encryption actually efficient? We answer this through encrypted-dependency propagation, tracking which activations depend on encrypted inputs and therefore must remain under FHE. For CNNs, this dependency region grows predictably with the receptive field until saturation. We validate this behavior with real TFHE execution and use a support-propagation predictor to estimate speedup for other architectures. Overall, efficiency is governed less by depth or model family than by how long encrypted dependencies remain local.
Algorithm 1 and Figure 1 summarize the procedure. We propagate the ROI to identify computations dependent on encrypted inputs, evaluate everything else in plaintext, and execute only the remaining computation homomorphically while injecting plaintext-only contributions as clear constants.
The procedure is exact because each accumulator is simply split into encrypted and plaintext contributions,
AlexNet ResNet-18 VGG-11
(a) where the budget goes

(b) what it predicts
ROI area, % of
(c) what it is worth
ROI edge m (px)
Figure 2: The three panels connect dependency growth to realized speedup. (a) The tainted fraction shows how quickly each architecture exhausts its locality budget across convolution and pooling stages. (b) This propagation predicts how speedup changes as the encrypted ROI grows. (c) Real TFHE measurements follow the same ordering: architectures that preserve locality longer achieve larger gains.
where T denotes the set of tainted input indices for the current accumulator. So, with the same fixed quantization and lookup tables, selective and full evaluation produce the same output. Under the security of the underlying FHE scheme [Gentry, 2009, Chillotti et al., 2018], the encrypted ROI remains protected from the server, while the ROI index set and values outside the ROI are intentionally public.
To analyze the efficiency of this method, we present the following simple lemma for convolutional networks:
Lemma 1 (CNN locality and speedup). For a centered encrypted ROI in an input and a stack of stride-1, valid convolutions, the tainted region after layer i has edge
until saturation. When receptive-field growth is small relative to the input and ROI, the resulting speedup scales as
The benefit lasts only while the tainted region remains smaller than the feature map. In this idealized setting, it remains unsaturated through depth d when
After saturation, later layers are effectively as expensive as full encryption. Thus, a small ROI alone is insufficient: the architecture must preserve locality for enough of the network. The proof, exact cost expression, and extensions to boundaries, stride, padding, and pooling are deferred to Appendix B.
3 Experiments
We evaluate channel-narrowed variants of AlexNet [Krizhevsky et al., 2012], ResNet-18 [He et al., 2015], and VGG-11 [Simonyan and Zisserman, 2015] that preserve each architecture's spatial dependency-propagation pattern at using Concrete TFHE [Zama, 2022, Chillotti et al., 2018] with 4-bit weights and activations. Full and selective circuits share fixed quantization; timings are medians of three homomorphic evaluations excluding compilation, key generation, encryption, and decryption. All selective circuits reproduce the full-encryption integer output exactly.
As we see in Figure 2, at a ROI (2.04% of the input), VGG-11 achieves speedup, versus for ResNet-18 and for AlexNet. The ordering follows early down-sampling rather than depth: AlexNet's , stride-4 first convolution and ResNet-18's early reductions consume locality much faster than VGG-11. More implementation and measurement details are deferred to Appendix A.

Figure 3: Predicted speedup across architectures as the encrypted ROI grows. We estimate encrypted computation from dependency propagation using , where and are the full and tainted activation counts; full propagation rules are given in Appendix C. Architectures that preserve local dependencies retain large gains, while those with early global mixing don’t.
3.1 Across architectures
The results above suggest that architectural structure, rather than depth alone, determines whether selective encryption is effective. We therefore extend the comparison to ConvNeXt-T [Liu et al., 2022], EfficientNet-B0 [Tan and Le, 2020], ViT-B/16 [Dosovitskiy et al., 2021], Swin-T [Liu et al., 2021], MLP-Mixer [Tolstikhin et al., 2021], and a fully connected architecture.
Figure 3 shows a clear separation according to how architectures mix spatial information. At a ROI, VGG-11 retains an speedup, whereas ViT, MLP-Mixer, and a fully connected network don’t benefit at all from this scheme because encrypted dependence becomes global early. Swin-T retains through local windowed attention. Conversely, convolution alone is not sufficient: EfficientNet-B0 reaches only because global squeeze-and-excitation [Hu et al., 2019] spreads encrypted dependence across the feature map. The key architectural property is therefore how long encrypted dependencies remain local.
4 Discussion
Our results suggest treating encrypted-dependency propagation as an explicit architectural criterion for privacy-preserving neural networks. Alongside arithmetic complexity and nonlinear operations, choices such as kernel size, stride, pooling, attention windows, and global reductions determine how quickly a network consumes its “locality budget.” The support-propagation predictor could therefore serve as a design or architecture-search objective, favoring models that keep sensitive dependencies local for longer.
Selective inference also introduces a privacy–efficiency tradeoff. Smaller encrypted regions reduce homomorphic work, but only values inside the ROI are cryptographically protected. The relevant operating point is therefore the smallest ROI that covers the sensitive content, and ROI size should be considered jointly with the architecture’s dependency propagation.
5 Limitations
The predictor is an architectural cost model, not an exact runtime simulator. Thus, non-CNN results (Figure 3) are predictions rather than measured FHE runtimes. The wall-clock experiments use channel-narrowed variants of AlexNet, ResNet-18, and VGG-11 to make FHE evaluation tractable. These variants preserve the spatial dependency-propagation pattern, but their absolute runtimes should not be interpreted as those of the original full-width networks.
Acknowledgements
This work began as a final project for MIT 6.5610 (Spring 2025), and an earlier version of it appeared as the non-archival course report Encrypt What Matters: ROI-Guided FHE for CNN Inference. We thank the 6.5610 course staff for their feedback on the earlier version.
References
Alexandros Bakas and Dimitrios Schoinianakis. When only parts matter: Efficient privacy-preserving analytics with fully homomorphic encryption. Cryptology ePrint Archive, Paper 2026/103, 2026. URL https://eprint.iacr.org/2026/103.
Florian Bourse, Michele Minelli, Matthias Minihold, and Pascal Paillier. Fast homomorphic evaluation of deep discretized neural networks. Cryptology ePrint Archive, Paper 2017/1114, 2017. URL https://eprint.iacr.org/2017/1114.
Alon Brutzkus, Oren Elisha, and Ran Gilad-Bachrach. Low latency privacy preserving inference, 2019. URL https://arxiv.org/abs/1812.10659.
Ilaria Chillotti, Nicolas Gama, Mariya Georgieva, and Malika Izabachène. TFHE: Fast fully homomorphic encryption over the torus. Cryptology ePrint Archive, Paper 2018/421, 2018. URL https://eprint.iacr.org/2018/421.
Ilaria Chillotti, Marc Joye, and Pascal Paillier. Programmable bootstrapping enables efficient homomorphic inference of deep neural networks. Cryptology ePrint Archive, Paper 2021/091, 2021. URL https://eprint.iacr.org/2021/091.
Edward Chou, Josh Beal, Daniel Levy, Serena Yeung, Albert Haque, and Li Fei-Fei. Faster cryptonets: Leveraging sparsity for real-world encrypted inference, 2018. URL https://arxiv.org/abs/1811.09953.
Bill Dai. PFHE: Partially homomorphic encryption on CNN inference. Master's thesis, University of Illinois Urbana-Champaign, 2025. URL https://hdl.handle.net/2142/132598.
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth words: Transformers for image recognition at scale, 2021. URL https://arxiv.org/abs/2010.11929.
Craig Gentry. Fully homomorphic encryption using ideal lattices. In Proceedings of the Forty-First Annual ACM Symposium on Theory of Computing, STOC '09, pages 169–178, New York, NY, USA, 2009. Association for Computing Machinery. ISBN 9781605585062. doi: 10.1145/1536414.1536440. URL https://doi.org/10.1145/1536414.1536440.
Ran Gilad-Bachrach, Nathan Dowlin, Kim Laine, Kristin Lauter, Michael Naehrig, and John Wernsing. Cryptonets: Applying neural networks to encrypted data with high throughput and accuracy. In Maria Florina Balcan and Kilian Q. Weinberger, editors, Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 201–210, New York, New York, USA, 20–22 Jun 2016. PMLR. URL https://proceedings.mlr.press/v48/gilad-bachrach16.html.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition, 2015. URL https://arxiv.org/abs/1512.03385.
Jie Hu, Li Shen, Samuel Albanie, Gang Sun, and Enhua Wu. Squeeze-and-excitation networks, 2019. URL https://arxiv.org/abs/1709.01507.
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C.J. Burges, L. Bottou, and K. Weinberger, editors, Advances in Neural Information Processing Systems, volume 25. Curran Associates, Inc., 2012. URL https://proceedings.neurips.cc/paper_files/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf.
Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows, 2021. URL https://arxiv.org/abs/2103.14030.
Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s, 2022. URL https://arxiv.org/abs/2201.03545.
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition, 2015. URL https://arxiv.org/abs/1409.1556.
Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks, 2020. URL https://arxiv.org/abs/1905.11946.
Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, and Alexey Dosovitskiy. Mlp-mixer: An all-mlp architecture for vision, 2021. URL https://arxiv.org/abs/2105.01601.
Zama. Concrete: TFHE Compiler that converts python programs into FHE equivalent, 2022. https://github.com/zama-ai/concrete.
A Measurement Details
This appendix provides the experimental configuration used for the wall-clock measurements in Section 3. We report both absolute homomorphic-evaluation latencies and the corresponding speedups.
Hardware and software. All experiments were run on a single Apple M1 Pro (MacBookPro18,1) with 10 CPU cores (8 performance and 2 efficiency cores) and 16 GiB of unified memory, running macOS 26.6.2 (arm64). Homomorphic evaluation was CPU-only; no GPU acceleration was used. The software environment consisted of Python 3.11.16, concrete-python 2.11.0, and NumPy 1.26.4. Both the full and selective circuits were evaluated with the same thread configuration, using 8 threads via OMP_NUM_THREADS=8 and RAYON_NUM_THREADS=8.
Cryptographic parameters. TFHE parameters were selected independently for each compiled circuit by the Concrete optimizer using the multi-parameter strategy (MULTI, with single_precision=False). We retained Concrete's default 128-bit security level and default error target. Because parameter selection is performed separately for each circuit, the optimizer may choose less expensive parameters for a selective circuit when its arithmetic requirements are smaller. This effect is therefore included in the measured wall-clock speedup.
Across the circuits used in our experiments, the compiler-reported error probabilities ranged from to for the full circuits and from to for the selective circuits.
Quantization and programmable bootstrapping. Activations are represented as 4-bit unsigned integers. Weights are quantized to 4-bit symmetric signed integers in , using a per-tensor scale of
Each convolutional or dense layer first computes an integer accumulator and then applies a single lookup table implemented by programmable bootstrapping (PBS). The lookup table jointly performs the nonlinearity and output re-quantization.
For each layer, we derive a provable lower bound on the accumulator from the quantized weights and the input range. The accumulator is offset by this bound and rounded so that the resulting lookup-table index fits within 6 bits. Thus, the programmable bootstrap operates on a 6-bit table index even when the unrounded integer accumulator has a larger range.
Output scales are calibrated using the 99.9th percentile of positive accumulator values over 256 calibration images. The selective circuit reuses the same lookup tables, accumulator bounds, rounding parameters, and output scales as the corresponding full circuit. Partial evaluation only separates
Table 1: Homomorphic-evaluation latency for inputs. Times are medians of three runs, with interquartile ranges in parentheses. “PBS” denotes the number of compiled programmable bootstraps. The full-encryption baseline is measured once per architecture and shared across ROI sizes.
| Architecture | Width | m | ROI | PBS (full) | PBS (sel.) | Full (s) | Selective (s) | Speedup |
|---|---|---|---|---|---|---|---|---|
| AlexNet | 1/16 | 16 | 0.51% | 356,480 | 58,112 | 1571.7 (43.3) | 241.6 (0.8) | 6.51× |
| 32 | 2.04% | 89,472 | 362.2 (2.1) | 4.34× | ||||
| 56 | 6.25% | 105,216 | 426.8 (9.9) | 3.68× | ||||
| ResNet-18 | 1/32 | 16 | 0.51% | 485,296 | 81,140 | 2166.2 (4.3) | 349.4 (0.6) | 6.20× |
| 32 | 2.04% | 95,620 | 421.5 (9.5) | 5.14× | ||||
| 56 | 6.25% | 128,172 | 577.8 (39.9) | 3.75× | ||||
| VGG-11 | 1/64 | 16 | 0.51% | 644,448 | 26,864 | 4517.7 (38.2) | 147.5 (0.9) | 30.63× |
| 32 | 2.04% | 42,896 | 251.1 (0.5) | 17.99× | ||||
| 56 | 6.25% | 80,368 | 503.7 (0.6) | 8.97× |
plaintext and encrypted contributions to the same integer accumulator; consequently, the accumulator presented to each lookup table is identical in the full and selective executions.
For the timing experiments, network weights were trained in floating point on an MNIST-on-canvas dataset containing 12,000 training images and 2,000 test images for 25 epochs, then quantized and frozen before FHE compilation.
Channel width. The encrypted-dependency mask is spatial: all channels at a tainted spatial location are treated identically. To make the wall-clock FHE experiments tractable, we therefore use channel-narrowed versions of the three convolutional architectures: AlexNet at 1/16 of its original channel width, ResNet-18 at 1/32, and VGG-11 at 1/64. Each scaling factor is an exact divisor of the channel counts in the corresponding architecture.
Channel narrowing does not change the spatial dependency-propagation pattern, and both the full and selective circuits use the same narrowed architecture in each comparison. The absolute latencies and measured speedups reported in Table 1 therefore refer to these narrowed variants; they should not be interpreted as absolute runtimes of the original full-width networks.
Timing protocol. Evaluation latency is the median of three executions of circuit.run on a single input. The reported evaluation time excludes compilation, key generation, encryption, and decryption. These costs are reported separately in Table 2.
Each circuit was compiled and keyed once and then reused for all three timed executions. For each architecture, the full-encryption baseline was measured once (as the median of three executions) and reused when computing the speedup for each ROI size.
Before collecting timing measurements, we verified correctness against the plaintext quantized implementation. Full and selective executions produced identical integer outputs on eight held-out inputs under Concrete simulation. We additionally verified under real TFHE keys that the decrypted outputs of both circuits matched the plaintext reference. All configurations reported below passed these checks.
At the ROI used in the main comparison, for example, the measured VGG-11 homomorphic-evaluation time decreases from 4517.7 s under full encryption to 251.1 s under selective evaluation, corresponding to a speedup.
The additional per-input cost introduced by selective evaluation is therefore negligible relative to homomorphic evaluation. At , the reduction in homomorphic-evaluation time is substantially larger than the difference in one-time setup cost for all three measured architectures.
Table 2: Costs excluded from the homomorphic-evaluation measurements in Table 1, reported at . Compilation and key generation are performed once per circuit and can be reused across inference requests. Partial evaluation is performed once per input. Decryption takes less than 0.02 s in every configuration and is omitted.
| Architecture | Compile (s) | Key generation (s) | Encryption (s) | Partial eval. (s) | |||
|---|---|---|---|---|---|---|---|
| Full | Sel. | Full | Sel. | Full | Sel. | Sel. | |
| AlexNet | 3014.0 | 2936.7 | 15.8 | 13.5 | 5.44 | 0.11 | 0.007 |
| ResNet-18 | 2782.3 | 2886.5 | 13.8 | 14.6 | 3.92 | 0.09 | 0.007 |
| VGG-11 | 178.9 | 184.3 | 18.9 | 17.2 | 3.36 | 0.08 | 0.004 |
B CNN Locality and Cost Scaling
We now derive the locality result used in Lemma 1. The closed-form analysis considers a centered encrypted ROI in an input and a stack of stride-1, valid convolutions. More general architectural operations are handled by the support-propagation procedure in Appendix C.
Consider first one spatial dimension. Let a tainted interval have length . An output of a stride-1 convolution is tainted exactly when its receptive field intersects this interval. Provided the expanding interval has not reached a feature-map boundary, a convolution with kernel width therefore increases its length to
Applying the same argument independently along both spatial axes, the tainted region after layers is a square with edge
At the same time, each valid convolution reduces the feature-map edge. After layers,
Consequently, the exact tainted edge for a centered ROI is
Before saturation, the first term is smaller and Equation (5) reduces to Equation (3).
Saturation occurs when the expanding tainted region reaches the boundary of the shrinking feature map. Requiring the ROI to remain unsaturated through depth gives
or equivalently
which is Equation (2) in the main text.
For the same idealized stack, assume that encrypted computation has constant cost per spatial position. Before saturation, the selective cost is
whereas full encryption evaluates every spatial position and therefore costs
The resulting speedup is
When receptive-field growth is small relative to both and , the numerator and denominator scale respectively as and . Hence
which is the scaling stated in Lemma 1.
The centered-ROI assumption gives the cleanest closed form. Near an image boundary, dependency growth can be clipped because part of the receptive field lies outside the valid feature map. Similarly, stride, padding, pooling, residual connections, attention, and other architectural operations change dependency propagation in ways that are more naturally handled directly on the network graph. We therefore use the numerical support-propagation procedure below for the architectures evaluated in the experiments.
C Support-Propagation Predictor and Limitations
The predictor replaces the numerical forward pass with binary dependency propagation. The encrypted ROI initializes the support mask, and an activation is marked tainted whenever it can depend on an encrypted input. Learned weights are treated as structurally active, while additive constants do not introduce dependency.
Propagation follows the architecture. Convolution and pooling taint an output when its receptive field intersects the tainted region; point-wise operations preserve support; and additions or residual connections take the union of their input supports. Local attention propagates support within its window, as in Swin Transformer [Liu et al., 2021], whereas architectures with global token mixing, such as ViT and MLP-Mixer [Dosovitskiy et al., 2021, Tolstikhin et al., 2021], can make dependency global once any participating input is tainted. Global reductions are handled similarly, including squeeze-and-excitation [Hu et al., 2019], where a tainted reduced value can subsequently be broadcast across the feature map.
For each recorded activation , let denote the total number of activation elements and the number marked tainted. The predicted speedup is
Algorithm 2 PREDICTSPEEDUP
Require: architecture , encrypted-input mask
1: Propagate an all-ones mask through and record at each activation.
2: Propagate using the dependency rules above and record the tainted count .
3: return .
We check that an empty ROI produces no tainted computation, a whole-image ROI gives exactly predicted speedup, and tainted computation is non-decreasing with ROI size. Across the nine configurations with real TFHE measurements, the predictor has median error and worst-case error.