Randomized Sample–Buffer Scheduling for Resonant Metasurface Sensors

Resonant sensors trap light or microwaves in a small structure (a metasurface, a ring, a split-ring resonator) so that a tiny change in the surrounding liquid's refractive index or permittivity shifts the resonance frequency by a measurable amount. The field reports progress mainly as sensitivity and sharpness: nanometers of shift per refractive-index unit, quality factor, figure of merit. At the claimed limits, though, the signal is small compared with how much the resonance wanders on its own because of temperature, pump pulsation, laser jitter and slow surface adsorption. Almost every published protocol measures a baseline fluid, then the sample, then subtracts. That is a before–after comparison with a single treated unit. Clinical trial methodology exists largely to show why such comparisons mislead.

We propose to borrow the logic of the micro-randomized trial from mobile health, in which each person is re-randomized many times to receive or not receive a prompt, and apply it to the fluidics of one sensor chip. A computer-controlled valve assigns each short time slot to sample or matched buffer by a known random schedule. The analyte's effect on the resonance is then estimated as a randomized contrast whose error bars are valid by design, whatever shape the drift takes. The deliverable is not a sharper resonance. It is a readout protocol and a "randomized limit of detection" that comes with a calibrated false-positive rate. Using it, we will test whether randomization actually beats the engineering tools already in use: reference channels, periodic modulation with lock-in detection, and fitted drift correction.

Core Claim

When sample and buffer exposures are assigned by a known randomization, sensor drift cannot be correlated with treatment. A simple paired estimator is then unbiased for the resonance shift caused by the sample, and a randomization test gives a p-value that needs no model of the drift. Carryover can also be estimated directly: fluid left in the channel, or adsorbed material still on the surface, shows up as a lagged treatment effect in the same regression. Concretely, split the run into $B$ pairs of adjacent slots and randomize the order within each pair. Let $A_{b1}\in\{0,1\}$ indicate whether the first slot of pair $b$ receives sample, and let $Y_{b1}, Y_{b2}$ be the fitted resonance frequencies at the end of each slot. The estimator is

$$\hat\tau = \frac{1}{B}\sum_{b=1}^{B}(2A_{b1}-1)\,(Y_{b1}-Y_{b2}).$$

Under the randomization, drift enters only through the increment within each pair. Drift therefore inflates the variance of $\hat\tau$ but cannot bias it. The reference distribution of $\hat\tau$ comes from re-drawing the sign pattern, not from a noise model.

To check for carryover, we fit $Y_t = \alpha(t) + \tau A_t + \gamma A_{t-1} + \varepsilon_t$ with a flexible trend $\alpha(t)$. A nonzero $\gamma$ is direct evidence that one slot's exposure leaks into the next. We define the randomized limit of detection as the lowest concentration at which the randomization test rejects in at least 95% of repeated runs while holding a 5% false-positive rate on blank-versus-blank runs.

What is new here is not randomizing run order. Analytical chemists do that across samples. The new part is re-randomizing exposure within a single continuous sensor trace, using the stratified micro-randomized design of Dempsey et al. to plan how many slots are needed. We also treat the sensor's own transduction, rather than a human's behavior, as the object of causal estimation. The research file found no paper that combines resonant metasurface sensing with randomized designs. The nearest work either uses off-the-shelf sensors as passive endpoints inside clinical trials, or, as in Dempsey et al., uses wearable sensor readings only to trigger interventions on people.

Research Program

The primary testbed is microwave, because it is cheap to replicate and fast to switch. We will build a coupled three-ring split-ring resonator with a capillary, following the SRR complex-permittivity sensor, which reports a 5.05 GHz unloaded resonance, Q of 104.2, a 58.7 MHz ethanol shift and volumes down to 0.13 µL. A second testbed follows the W-shaped meta-surface absorber of Huang et al., which reports a 3 MHz minimum resolution between edible oils at about 9.887 GHz. That claim is exactly the kind of small-margin comparison where drift and run order matter.

The SRR paper's small sample volume is what makes second-scale switching plausible. By contrast, the 50 µL PDMS delivery of the all-dielectric metacavity would make fast switching wasteful. If lab access permits, an optical replication uses a chalcogenide resonator with a PDMS channel, following Anderson et al., who report 182 nm/RIU and a detection limit of $8\times10^{-7}$ RIU for isopropanol solutions.

We will build three things. The first is a two-valve switching manifold driven by a logged random schedule. The second is a characterization of the switching transient, which sets the minimum slot length. The third is an analysis package that implements the paired estimator, the lagged-carryover regression and the randomization test. The design of Dempsey et al. plans sample size from pilot observational data. We will do the same, using blank-versus-blank traces to size the number of slot pairs needed for 80% power at a target shift.

The approach has a real limit, and we address it directly. Randomized switching within one trace only works for reversible effects: bulk permittivity or refractive-index changes, and weak or regenerable binding. Irreversible surface binding, such as the SARS-CoV-2 pseudovirus capture in Zheng et al., cannot be switched off. For that regime, randomization moves to space. On a chip with several resonators, which ones are functionalized and which are blocked is decided at random. The contrast is then estimated across resonators, with a synthetic difference-in-differences reference as the competing analysis. We treat this as a secondary, harder aim.

Baselines

The do-nothing reference is the standard protocol: measure a baseline fluid, switch once to sample, and report the resonance shift. Its uncertainty is estimated from repeated baselines. This is how every sensor paper in the file reports sensitivity.

The strongest engineering competitor is dual-channel differential referencing. A second, matched resonator sees buffer only, and its shift is subtracted from the sensing channel's. No reported result on Lacuna quantifies how well this rejects drift on these platforms. Its known weakness is that it assumes both channels drift identically. Synthetic Difference-in-Differences shows that this "parallel trends" assumption is costly when it fails. On the Proposition 99 panel it reports standard errors of 17.7 for plain difference-in-differences against 8.4 for its reweighted estimator. That comparison comes from economics, not sensors. We will therefore also run a reweighted reference: an SDID-style weighted combination of several reference resonators. This is the strongest non-randomized referencing competitor.

The most dangerous baseline is periodic square-wave modulation with lock-in demodulation at the same duty cycle. We found no reported result on Lacuna for flow-modulated lock-in on these resonators. We will also include a sequential schedule with post-hoc drift correction: a spline fitted to the buffer segments and subtracted.

For the head-to-head sensitivity comparison, we will use the numbers each platform's source paper reports. These are 3 MHz resolution among oils for the absorber (Huang et al.) and $8\times10^{-7}$ RIU for the optical resonator (Anderson et al.).

Fairness rules apply to every method. All methods use the same device, fluids and total acquisition time, and the same number of sample-exposed seconds. Each gets an equal budget of pilot runs for tuning slot length, modulation frequency or spline stiffness. All are scored on held-out runs.

Two ablations separate the ingredients. In the first, we analyze the randomized schedule with a naive mean difference, which isolates the contribution of the estimator. In the second, we analyze the periodic schedule with our paired estimator and a permutation test that wrongly treats it as random, which isolates the contribution of the randomization itself.

Our method beats a baseline only if two things hold. Its 95% intervals must cover the reference-refractometer truth at close to the nominal rate while the baseline's do not. And at equal coverage, it must reach an equal or lower detection limit.

Why not just…?

Why not just use a reference channel and subtract? This is cheap and often adequate. It fails exactly when the two channels drift differently: one resonator heats faster, one channel adsorbs more, or chip inhomogeneity makes their temperature coefficients differ, as Anderson et al. describe for spatial variation across their chips. Experiment 1 deliberately creates asymmetric thermal drift to measure how biased the subtraction becomes. If referencing stays unbiased with correct coverage there, we will say so, and our method's value narrows to single-resonator devices.

Why not just modulate periodically and use a lock-in amplifier? This is the real threat. For stationary noise, square-wave modulation and randomized pairs have similar variance. Randomization should win only in three cases. The first is when an interferer is itself periodic, such as pump strokes, thermostat cycling or mains-coupled heating, and can alias with the modulation frequency. The second is when carryover depends on the previous slot, because a fixed alternation cannot separate $\tau$ from $\gamma$. The third is error bars, which lock-in estimates from a noise model rather than from the design. Experiment 2 injects a controlled periodic disturbance near the modulation frequency. If lock-in matches our coverage and detection limit without the injected disturbance and still matches it with the disturbance present, the proposal reduces to "report randomization-based error bars." That would be a smaller, still useful result.

Why not just fit and subtract the drift? Fitted drift correction works when the drift is smooth and the model is right. It gives overconfident intervals when adsorption or thermal steps are abrupt. It also couples the estimate to the analyst's choice of spline stiffness, a forking-paths problem the randomized estimator avoids. Experiment 1 compares coverage across drift shapes.

Why not just improve surface chemistry or push Q higher? These address a different problem. A narrower resonance, such as the 0.097 nm linewidth simulated by Wang et al., responds more to every perturbation, including drift. Randomization offers no chemical selectivity. It cannot tell a target molecule from a same-index interferent present in the sample, and recognition layers remain necessary for that, with their known fouling and humidity problems (Liu et al. review). We present the method as complementary: it makes whatever selectivity the surface provides measurable with honest uncertainty.

Proposed Experiments

Experiment 1 tests validity under known drift. On the SRR, we deliver water–ethanol mixtures at concentrations spanning the bottom decade of detectability, with ground-truth permittivity from a reference measurement. We impose three drift regimes: ambient, a linear heater ramp, and abrupt thermal steps, each applied asymmetrically to the sensing and reference resonators. The metrics are bias and root-mean-square error of the estimated shift, coverage of nominal 95% intervals, and false-positive rate on blank-versus-blank runs. The decisive check is whether randomized coverage stays near 95% across all three regimes while referencing and spline correction lose coverage under asymmetric or step drift.

Experiment 2 is the head-to-head with lock-in. Using the same SRR and fluids, we compare randomized pairs with square-wave lock-in at matched duty cycle. The comparison runs both without and with an injected periodic interferer near the modulation frequency, and with a deliberately long-residence channel that induces carryover. The metrics are randomized limit of detection, coverage, and whether the lagged term $\gamma$ is recovered against a known dead-volume flush time. This experiment decides whether the proposal's core claim survives.

Experiment 3 is a blinded replication of a small-margin claim. On the meta-surface absorber, an operator who does not know the key assigns oils and low-level adulterated blends to runs at random. We test whether the reported 3 MHz inter-oil resolution of Huang et al. holds when run order and identity are randomized and hidden. The metric is classification accuracy with confidence intervals. We do this in the spirit of the blinded randomized evaluation of Thakkar et al., which evaluated LLM review feedback. Here the target of the evaluation is a sensor's resolution claim.

If optical access permits, we repeat Experiment 1 with isopropanol on a chalcogenide resonator and ask whether the randomized limit of detection approaches the reported $8\times10^{-7}$ RIU with valid coverage. We then pilot the spatially randomized functionalization design for irreversible binding, comparing it against the SDID-weighted reference.