Drought-Aware Carbon Flux Models That Run Under Homomorphic Encryption

Estimating how much carbon a forest or grassland absorbs, and whether a drought has turned it from an absorber into an emitter, increasingly depends on machine-learned models trained on flux towers, weather, and satellite imagery. The data owners and the model owners are often different parties who do not trust each other. A forestry company or a national inventory office may hold confidential site measurements. A modeling group may hold a model trained on pooled, partly licensed data that it will not hand out. Homomorphic encryption, a way of computing directly on encrypted numbers so the server never sees the inputs, fits this setting. But current encrypted networks were designed for image classification, and they model nonlinearity with symmetric squaring functions. Ecology says drought responses are strongly asymmetric: productivity lost in a dry spell exceeds productivity gained in an equally wet one.

This note proposes a carbon flux regressor built to fit a fixed encryption budget. It has two parts. The first is a rule for splitting work between client and server: every nonlinear function of the client's own inputs is computed by the client before encryption, so it costs the server nothing. The second is a small number of encrypted multiplications, spent on a water-stress gate that is allowed to be asymmetric and that multiplies light and greenness terms, the way classic light-use-efficiency models do. The claim to test is that this structure keeps most of a deep multimodal model's skill during drought, while running on encrypted data without bootstrapping, the expensive noise-refresh step. The test also covers whether the image-style recipe of squaring activations fails specifically in dry periods.

Core Claim

Under a fixed multiplicative depth budget, the accuracy of an encrypted flux model depends mostly on where the few ciphertext-by-ciphertext multiplications go, not on how closely it imitates a plaintext deep network. Placing them in an asymmetric, saturating water-stress interaction should preserve drought-period skill and the sign of sink-to-source transitions. A symmetric squaring activation at equal depth, as in CryptoNets, should lose skill disproportionately in drought hours. Encryption error in the approximate-arithmetic scheme CKKS (Floating-Point Homomorphic Encryption) should be negligible relative to model error at this depth.

The research file found no existing work connecting the two directions. The closest pieces are separate. CarbonSense is a benchmark of 385 flux towers with MODIS patches and ERA5 weather. Its EcoPerceiver model uses Fourier feature encodings and softmax cross-attention over a 32-hour window, and it beats XGBoost in 12 of 15 ecosystem types, but it ignores encryption. The encrypted-inference line of work only benchmarks vision classification. It includes channel-wise polynomial replacement in SAFENet, fully polynomial Hadamard-product backbones in PolyNeXt, and cryptographic-cost-aware architecture search in NASS. The proposal differs from the obvious combination, "make EcoPerceiver polynomial," in one respect. It does not approximate the deep model's components. It argues that most of them should move to the client or be replaced by a physically structured interaction.

Why the Obvious Port Is the Wrong Target

The research file frames the Fourier encodings in EcoPerceiver as a barrier, because sines and cosines cannot be evaluated on ciphertexts. That barrier mostly disappears once we notice that these encodings are functions of the client's own inputs. The client can compute sines at public frequencies, powers of soil-moisture anomalies, vapor-pressure deficit, and antecedent 30- and 90-day soil-water means in plaintext, then encrypt them. Multiplying an encrypted input by a plaintext weight is cheap and consumes one noise level. Multiplying two encrypted values together is the expensive operation that exhausts the noise budget and eventually forces bootstrapping (Circuit Bootstrapping: Faster and Smaller).

So any additive model in client-lifted features is essentially free. Encrypted cost goes only to interactions among learned combinations of features. This also gives a cheap route to the months-long legacy effects of drought that a 32-hour window misses: the client supplies lagged water-stress summaries as inputs.

What remains is a question about interactions. The Vegetation Photosynthesis and Respiration Model in Segura et al. expresses uptake as a product of temperature, soil-moisture, light, and greenness scalars. It also adds an explicit soil-moisture stress term that shuts down uptake under drought. Pantropical data in Fan et al. show negative asymmetry in productivity responses, with an asymmetry index between −0.115 and −0.041 across products. Eddy-covariance evidence from 2003 in Granier et al. shows that respiration continues while uptake collapses. Together these motivate a specific design: a few multiplicative interactions, one of which is gated by water stress, rather than deep stacks of generic activations.

Research Program

The model has the form

$$\hat{y} = w_0^\top \phi(x) + \sum_{k=1}^{K} \big(a_k^\top \phi(x)\big)\,\big(b_k^\top \phi(x)\big)\,\big(g_k^\top \psi(x)\big),$$

where $\hat{y}$ is predicted net ecosystem exchange for one hour. Here $\phi(x)$ is the client-computed lift of the 32-hour weather window and satellite summaries, and $\psi(x)$ is the subset of lifted water-stress features: soil-moisture monomials, vapor-pressure deficit, and antecedent anomalies. The vectors $w_0, a_k, b_k, g_k$ are the provider's secret plaintext weights, and $K$ is the number of interaction terms.

The third factor is the water-stress gate. Its weights are trained with a penalty that keeps it monotone and saturating over the observed range of soil moisture. Odd-degree terms in $\psi$ let it respond more steeply to drying than to wetting. Each term costs two ciphertext products, so the whole model sits at a small fixed depth. We fix that depth in advance at a level that needs no bootstrapping under 128-bit security parameters from the Homomorphic Encryption Standard.

Temporal mixing across the 32 hours is a learned linear filter with plaintext weights. It is folded into $\phi$'s linear maps and costs one level. Satellite patches enter either as client-computed band summaries or through a learned linear projection. An ablation compares the two.

Packing is the second contribution. It addresses the finding in CryptoNets that encrypted inference is practical only when thousands of samples share one ciphertext, which yielded 58,982 predictions per hour but 250-second latency. Carbon accounting is naturally a batch workload: a season of hourly windows across a client's sites. We place one independent window in each ciphertext slot, and use a separate ciphertext for each lifted feature. Then every linear layer is a weighted sum of whole ciphertexts, and every interaction is a slot-wise product. No slot rotations are ever needed, and slot rotations are the costly key-switching operations that the research file flags as unaddressed for spatio-temporal data. The price is that ciphertext count and upload size grow with the width of $\phi$. We will measure this trade-off directly against a rotation-based packing.

The training program has three parts. First, we train the model in plaintext with CKKS-level noise injected, so that the learned weights tolerate approximation error. Second, we sweep $K$ and the lift width against measured encrypted latency and bytes. This is a small grid, not a reinforcement-learning search like NASS, which the research file reports at about 60 GPU hours. Third, we run encrypted inference on CPU, with GPU acceleration via cuHE as an optional speedup.

Out of scope: the threat model covers confidentiality of client inputs and provider weights only. It does not cover whether the client reports the decrypted output honestly. That integrity question matters for carbon credit verification and is left open.

Baselines

The naive reference is a per-site climatological mean diurnal and seasonal cycle of net exchange, computed from training years and evaluated on held-out years. Any model that fails to beat this during drought hours is not tracking drought at all.

The plaintext upper reference is EcoPerceiver from CarbonSense. It is trained on the same splits with its published configuration and receives the same hyperparameter trial count and GPU-hour budget as our model. The paper reports that it outperformed XGBoost in 12 of 15 ecosystem types and recommends Nash-Sutcliffe efficiency as the metric. No reported aggregate result for EcoPerceiver's efficiency score on CarbonSense was found on Lacuna, so we will reproduce it and report our reproduction. We also run plaintext XGBoost on the same features as the tabular reference. As an external anchor from another dataset, the Cubist regression trees of Wylie et al. report site cross-validation mean absolute deviation of 1.14 g C m⁻² day⁻¹ for croplands and 0.81 for grasslands in the Great Plains. We compare against these only for CarbonSense sites of matching type and aggregated to daily resolution, with the caveat that splits differ.

The strongest encrypted competitors are EcoPerceiver-derived models at the same depth budget. The first is a CryptoNets-style version, with activations replaced by squaring, softmax attention replaced by linear attention, and Fourier features moved client-side so the comparison isolates the interaction design. The second is a PolyNeXt-style version built from Hadamard-product blocks and polynomial attention (PolyNeXt). Both run under the same CKKS parameters and packing, with the same tuning budget.

The physically structured competitor is an encrypted polynomial version of the modified VPRM from Segura et al.. Its light-response division and hyperbolic tangent are replaced by low-degree fits, and its few parameters are refit per ecosystem type on CarbonSense.

The key ablation keeps our model fixed but replaces the asymmetric gate with a symmetric squaring gate of equal depth. A second ablation removes the gate entirely, spending the same depth on generic interactions. A third removes the antecedent water-stress features from the client lift.

Beating the encrypted competitors means one of two outcomes at equal depth and no bootstrapping: higher efficiency on drought hours with no loss on non-drought hours, or matching efficiency at lower latency and upload size. Success against the plaintext reference means recovering most of EcoPerceiver's efficiency gap over climatology on held-out drought hours. We will state the fraction recovered rather than claim parity.

Why not just…?

Why not just give the client the model and run it locally? If the provider's weights are not sensitive, this is correct and encryption is unnecessary. The proposal applies only where the provider will not release a model trained on pooled or licensed data, and where the client will not reveal site inputs. We will say plainly that the method adds value only in that two-sided setting, and we will report the full encrypted overhead so that practitioners can weigh it against a legal agreement.

Why not just encrypt a simple light-use-efficiency model like VPRM? This is the most serious threat. VPRM is almost a product of scalars already, and Segura et al. show it captures the 2022 southwestern European drought loss of 91.7 TgC once a soil-moisture term is added. If the encrypted VPRM matches our model on drought-hour efficiency across CarbonSense's ecosystem types, the correct conclusion is that physical structure is sufficient. The learned lift and gate would then be unnecessary, and we would report it that way. We expect the learned model to win where VPRM's static land-cover parameters fail, a limitation the research file notes. The per-ecosystem comparison directly tests that expectation.

Why not just run the nonlinearities in a two-party protocol, as Delphi or SAFENet do? Hybrid protocols exchange messages for every nonlinear layer. SAFENet found that activations still dominate online latency even after channel-wise approximation, and Haralampieva documents traffic of tens of gigabytes per request for deep networks. For offline seasonal accounting over good connections, that cost might be tolerable. So we will measure our total upload bytes and one-round latency and report them next to the published protocol overheads, rather than assume the protocols lose.

Why not just add differential privacy to the inputs? Differential privacy limits what a trained model reveals about its training data. It does not hide a query's raw inputs from the server. Noise added directly to meteorological or flux inputs also corrupts the small residual between uptake and respiration that determines whether a site is a sink. We will quantify this by adding input noise at several levels to the plaintext model and reporting drought-hour efficiency and sign accuracy.

Proposed Experiments

All experiments use CarbonSense with held-out sites and held-out years, stratified by ecosystem type. Drought hours are defined as hours when ERA5 root-zone soil moisture falls below the site's 10th percentile. We report Nash-Sutcliffe efficiency overall and on drought hours.

Three drought-specific diagnostics follow. The first applies the asymmetry index of Fan et al. to predicted versus observed responses to anomalies larger than one standard deviation. The second measures sign accuracy of annual net exchange at site-years with documented droughts, including the European 2003 sites in FLUXNET2015 studied by Granier et al., and 2022 sites if the benchmark's ICOS coverage includes that year. The third is the error of the drought-year anomaly in annual net exchange.

Encrypted runs report four quantities: the maximum and mean deviation of decrypted outputs from the plaintext model, amortized latency per window, ciphertext bytes uploaded per window, and depth used.

Three checks decide the claim. First, the squaring-gate ablation must lose markedly more efficiency on drought hours than on non-drought hours; if the loss is uniform, asymmetry is not the operative factor. Second, the proposed model must beat both encrypted EcoPerceiver ports at equal depth on drought hours, and must at least match the encrypted VPRM. Third, encryption error must be at least an order of magnitude below model error, so that accuracy differences reflect model design and not cryptographic noise.

If the encrypted VPRM ties, or if the squaring gate shows no drought-specific penalty, the headline changes. The finding becomes that client-side lifting plus a structured product model suffices, and that is still a useful, publishable answer to how encrypted carbon accounting should be built.