Drift-Aware Spike Encoding for Low-Power Sensor Networks

Cheap environmental sensors drift. Over weeks and months their zero point creeps (baseline shift) and their response to the target gas or temperature flattens (sensitivity loss). The usual fix is to correct readings afterwards, on a server, against a reference instrument or against neighboring sensors. This proposal starts from a less obvious observation. In networks built to save power, nodes do not stream raw readings. They report only when the signal changes enough, which is "event-driven" or "spike" encoding. In that setting drift is an energy problem as well as an accuracy problem. A creeping baseline produces streams of spurious "change" events, and a loss of sensitivity hides real changes. Either way the node wastes radio energy or goes quiet when it should not.

We propose to move drift correction into the encoder. Each node turns readings into events using two slowly varying internal values, an offset and a gain. A recurrent spiking network at the gateway watches the incoming event streams from all nodes, infers how each sensor has drifted from disagreements with its spatial neighbors, and once a day sends each node updated offset and gain values. A spiking network is one whose neurons exchange binary pulses and do work only when a pulse arrives. Training is blind: no reference instrument is needed after the first days of deployment. The claim is that this closed loop matches post-hoc calibration accuracy while transmitting far fewer events than either uncorrected event encoding or dense streaming followed by central correction.

Core Claim

Model each sensor $i$ as reporting $y_i(t) = g_i(t)\,s_i(t) + b_i(t) + \epsilon_i(t)$, where $s_i$ is the true signal, $g_i$ a slowly decaying gain, $b_i$ a slowly wandering offset, and $\epsilon_i$ noise. A send-on-delta encoder emits an event whenever the corrected value

$$\hat{s}_i(t) = \frac{y_i(t) - \hat{b}_i}{\hat{g}_i}$$

moves more than a fixed step $\delta$ from the last transmitted level. Here $\hat{b}_i$ and $\hat{g}_i$ are the node's current offset and gain estimates.

If the estimates are wrong, the event rate depends on the hardware state instead of the environment. A drifting $b_i$ adds roughly $|\dot b_i|/\delta$ spurious events per unit time, since every $\delta$ of baseline motion crosses one step. A shrinking $g_i$ scales down the rate of genuine events. The proposal is to make $\hat{b}_i,\hat{g}_i$ the slow state variables of a recurrent spatio-temporal estimator and to close the loop back into the encoder. If this works, the event count per node should track environmental activity and stay flat as the hardware ages. Reconstruction error should stay at the level of the best post-hoc blind calibrator.

Three things would be new. Drift is treated as a cause of energy waste in event-driven sensing. Correction happens before encoding instead of after transmission. And the estimator keeps a recurrent state across months, which feedforward blind calibrators lack.

Positioning Against Prior Work

The nearest work is blind drift calibration with deep networks. PRNet (A Deep Learning Approach for Blind Drift Calibration of Sensor Networks, with its sparse-Bayesian predecessor Blind Drift Calibration of Sensor Networks using Sparse Bayesian Learning) does three things. It arranges sensors into rows of a sensor-by-time matrix, ordering them along a minimum spanning tree so that physical neighbors sit next to each other. It removes drift with convolutional residual blocks. And it trains without ground truth by injecting simulated drift into a short clean window recorded just after deployment. We reuse that training trick and that spatial ordering; it supplies the method.

PRNet differs from this proposal in three ways. It sees fixed windows and has no memory. Its authors name recurrent networks as future work. And it assumes dense, continuously transmitted data. Blind Calibration of Air Quality Wireless Sensor Networks Using Deep Neural Networks compares temporal convolutions, spatial 2D convolutions, and an attention-augmented LSTM on simulated networks, and finds the 2D convolution best. This is a constraint on our design: it warns that recurrence alone does not beat spatial modeling. Our estimator therefore keeps spatial convolution and adds recurrence on top, rather than replacing one with the other.

Evidence that recurrence matters for long-horizon drift comes from Using context to make gas classifiers robust to sensor drift. There, a recurrent "context" pathway tracks a 36-month metal-oxide drift trajectory and modulates a feedforward classifier, but it needs labels from past batches. That paper motivates the recurrent state. Our version is driven by cross-node disagreement instead of labels.

The 30-month CO2 study (A 30-month field evaluation of low-cost CO2 sensors using a reference instrument) shows why one correction is not enough. Fast environmental cross-sensitivity is handled well by linear regression. Slow aging, at rates differing tenfold between identical units, needs separate periodic correction. This motivates our split between a fast local encoder and a slow network-level update.

On the spiking side, recurrent spiking networks have been shown on spatio-temporal classification (Heterogeneous recurrent spiking neural network for spatio-temporal classification; Dynamic Spatiotemporal Pattern Recognition With Recurrent Spiking Neural Network), and methods exist for converting trained recurrent networks to spiking form (Conversion of Artificial Recurrent Neural Networks to Spiking Neural Networks for Low-power Neuromorphic Hardware). None of these address continuous-valued regression or physical drift, and the file lists precise regression as an open weakness of spiking networks. That is why our spiking estimator outputs only two slowly varying numbers per node instead of reconstructing the full signal.

We do not rely on headline neuromorphic energy figures such as Martí et al. or Tang et al.. Those measure compute energy on other tasks. Our energy argument is about transmitted events, which we measure directly.

Research Program

We will build three components and test each separately.

The first is the node encoder. It applies the corrected send-on-delta rule above with downloadable $\hat b_i,\hat g_i$ and an optional local short-term correction for temperature and humidity, kept linear as the CO2 study supports. It is cheap enough for a microcontroller or a single spiking neuron with adaptive threshold.

The second is the gateway estimator. It is a recurrent network whose input is the event streams of all nodes, arranged in PRNet's spanning-tree order and processed by spatial convolution. Its output is the per-node offset and gain. Its recurrent state is meant to carry the drift estimate across days and months. We build it in two forms with matched parameter counts. One is a spiking recurrent network with leaky integrate-and-fire neurons (neurons that accumulate input, leak, and pulse when a threshold is crossed), trained with surrogate gradients. The other is an ordinary convolutional GRU. Running both lets us separate the value of the closed loop from the value of spiking.

The third is blind training. Following PRNet, we take the first days after deployment as clean and inject synthetic drift: linear, random-walk, periodic, and multiplicative gain decay. Random drift rates are drawn per node so that units of the same model diverge, as observed in the CO2 study. The estimator is trained to recover the injected offset and gain from the resulting event streams. Because the estimator's outputs feed back into the encoder, training unrolls the loop over simulated weeks.

The analysis has three parts. We map how event rate and reconstruction error trade off against the step $\delta$. We find the fraction of simultaneously drifting nodes at which spatial redundancy stops identifying drift. And we test whether the recurrent state actually stores drift: we probe it against the true injected offset, and we reset it mid-deployment and measure recovery time.

Baselines

The naive reference is uncorrected send-on-delta encoding of raw readings with a fixed offset and gain from the initial calibration window. It shows how much drift inflates or suppresses event counts and how large the reconstruction error grows. On the CO2 data, the analogous uncorrected long-term error is about 28.1 ppm RMSE over two years (30-month CO2 study).

The strongest accuracy competitor is dense streaming followed by PRNet at the gateway. Every node transmits every sample, and PRNet removes drift post hoc. On the 24-sensor temperature testbed, PRNet reports recovery above 60% with 23 of 24 sensors drifting and an 80% successful drift recovery rate, against SPSR-TSBL falling below 60% once more than 10 sensors drift (PRNet). We retrain PRNet on our splits with the same augmentation recipe and the same tuning budget, measured in hyperparameter trials and GPU hours. Beating it means matching its reconstruction error and recovery rate within noise while transmitting a small fraction of its samples.

The strongest cheap competitor is send-on-delta plus PRNet applied to the reconstructed, step-quantized signal. Here events are sent uncorrected and correction happens only at the gateway. This isolates whether correcting before encoding matters.

The supervised reference is the CO2 study's two-tier scheme: multivariate linear regression plus linear-interpolation drift correction against the reference every 3 to 6 months, which reaches 2.4 ± 0.2 ppm RMSE over 30 months. It uses ground truth we deny ourselves, so it is a ceiling, not a competitor.

Two ablations isolate the key ingredients. The first keeps the closed loop but removes recurrence, using a feedforward spatial estimator on a sliding window like PRNet. The second keeps recurrence but removes spatial coupling, giving each node its own recurrent baseline tracker in the spirit of Using context to make gas classifiers robust to sensor drift without labels. The spiking-versus-GRU estimator comparison is a third ablation on the estimator itself.

Why not just…?

Why not just stream everything and run PRNet or regression at the gateway? Gateway compute is genuinely cheap, so the energy question is radio, not arithmetic. Dense streaming spends one transmission per sample, regardless of activity. The real threat is the cheap competitor: uncorrected events plus central correction. If that matches our loop on both event count and error, the closed loop is unnecessary and we will say so. Our expectation is that it loses on event count, because spurious baseline-crossing events are already sent before any central correction. It may also lose on error, because events lost to gain decay cannot be recovered afterward. The event-count comparison under injected drift settles this directly.

Why not just track the baseline locally, for example by subtracting the minimum seen during clean-air periods? Dynamic baseline tracking handles offset but not gain loss. It also needs clean intervals, which polluted urban sites may rarely see, and it cannot distinguish a real regional rise from local drift without neighbors. The no-spatial-coupling ablation, plus a minimum-tracking baseline, tests whether neighbors add anything beyond this.

Why not just use a quantized GRU on a microcontroller instead of a spiking network? This may work equally well. In our design the estimator runs at the gateway and outputs two numbers per node per day, so spiking compute savings are secondary. We run both estimators at matched size and report accuracy alongside synaptic or multiply-accumulate operation counts. If the GRU wins, the contribution reduces to the drift-aware encoding loop, which we regard as the main claim anyway.

Proposed Experiments

The primary testbed is the PRNet 24-sensor temperature dataset: 55 days, with reference thermometers used only for evaluation. We measure reconstruction RMSE, PRNet's recovery-rate criterion, and events transmitted per node per day, sweeping the number of drifting sensors from 1 to 23 and the step $\delta$.

Long-horizon behavior is tested on the Beijing 30-month CO2 data, six co-located K30 sensors. Co-location gives strong redundancy, and the tenfold spread in drift rates tests per-node gain and offset tracking over seasons. The reference is the 2.4 ppm supervised ceiling and the 28.1 ppm uncorrected floor.

Scaling to irregular layouts is tested by reimplementing the synthetic network generator described in Blind Calibration of Air Quality Wireless Sensor Networks Using Deep Neural Networks. Its reported Conv2D MSE of 0.0011 for PM2.5 is a reference, though not directly comparable unless our reimplementation reproduces their setup. PRNet's 50-node simulation also applies; for its error metrics, no reported result was found on Lacuna beyond capacity percentages. As a transfer check on real chemical aging, we use the Vergara 36-month gas drift dataset. The encoder corrects the sensor array before a fixed classifier, compared against the context-pathway result of 88.2% mean accuracy (feedforward 86.9%, SVM ensemble 76.4%).

Three decisive checks follow. First, under injected drift, does the closed loop keep event counts near the drift-free level while the uncorrected-plus-central competitor's counts grow? If not, the core claim fails. Second, does it match PRNet's reconstruction error on the temperature testbed at high drift fractions? If it is clearly worse, the event savings come at too high a cost. Third, does the recurrent state correlate with the true injected offset, and does removing recurrence hurt specifically on the 30-month CO2 data, where slow seasonal and aging drift dominate? If not, the recurrence earns no place and the design should revert to a windowed estimator.