Leave-Bands-Out Test-Time Augmentation for Continuous Spectral Models

Some recent hyperspectral networks represent an image as a continuous function of position and wavelength. A coordinate network, a small neural net that takes $(x, y, \lambda)$ and returns a brightness value, can be queried at any wavelength. Some of these models can also accept input bands at arbitrary wavelengths. That second property allows a kind of test-time augmentation that ordinary channel-stacked networks cannot run. Test-time augmentation means running a frozen model on several perturbed copies of an input and combining the outputs. Here, the copies are different subsets of the input bands. Each member of the ensemble sees a subset, predicts the full continuous spectrum, and is then checked against the bands it was not shown. This is cross-validation inside a single test image, with no gradient steps. It yields a label-free score for each member at each wavelength, a weighted ensemble that does not need uniform averaging, and per-wavelength confidence bands on the reconstructed spectrum.

The opportunity matters because the two communities have each stopped short of this. Continuous spectral models such as SSIF, NeSR and SINR are run once, deterministically, and report no uncertainty. The test-time augmentation literature has shown that uniform averaging silently corrupts many correct predictions: When and Why Test-Time Augmentation Works reports that over one-third of ImageNet predictions changed by augmentation were made wrong. Its fixes learn global weights on a labelled validation set. Spectral data has a built-in internal check, because the bands we withhold are real measurements. We propose to use that check to weight the ensemble per image and per wavelength.

Core Claim

Consider a continuous spatial-spectral model trained to accept variable input band sets. At test time we split the observed bands into $K$ subsets and run the model once per subset. We then weight each member's predicted curve by its error on the bands it did not see. We claim this improves spectral fidelity, measured by spectral angle (SAM) and error near sharp absorption features, more than three alternatives: geometric test-time augmentation, wavelength-coordinate jitter, and output smoothing. We further claim that the spread across members is a calibrated per-wavelength uncertainty.

Concretely, member $k$ sees input band set $S_k$ and produces a continuous prediction $\hat f_k(x, \lambda)$. Its held-out error near wavelength $\lambda$ is

$$e_k(\lambda) = \sum_{b \notin S_k} \kappa(\lambda - \lambda_b)\, \big\| D\big[\textstyle\int r_b(\mu)\, \hat f_k(\cdot, \mu)\, d\mu\big] - y_b \big\|_1.$$

The terms are defined as follows. $\lambda_b$ is the center of observed band $b$, and $y_b$ is that band's measured low-resolution image. $r_b$ is the band's spectral response function, the curve describing how the sensor integrates light across a band (borrowed from SSIF's training-time sampler). $D$ is the known spatial degradation, and $\kappa$ is a kernel that spreads each held-out band's evidence to nearby wavelengths.

The final prediction combines the members with wavelength-dependent weights:

$$\hat f(x,\lambda)=\sum_k w_k(\lambda)\,\hat f_k(x,\lambda), \qquad w_k(\lambda) \propto \exp\big(-e_k(\lambda)/\tau\big).$$

Here $\tau$ is a single temperature tuned on validation scenes. The spread of the weighted members gives a per-wavelength confidence band.

This differs from the obvious version of continuous-coordinate augmentation, which queries $\lambda \pm \delta\lambda$ and averages. That approach is a low-pass filter on the model's own output. It would erase exactly the narrow peaks that coordinate networks already struggle to keep, a weakness SINR addresses with Fourier encodings. Our members differ in what evidence they see, not in where they are queried. Every member is evaluated at the same output wavelength, so peaks are averaged only where the members agree.

Relation to Prior Work

Several papers motivate the gap. SSIF, NeSR and SINR establish that a learned function of $(x,y,\lambda)$ beats discrete interpolation. SINR, for example, reports 32.24 dB PSNR on ICVL against 28.25 dB for trilinear interpolation. All three use single-pass inference. Hyperspectral Image Fusion with Spectral-Band and Fusion-Scale Agnosticism and HyperFree show that networks can accept arbitrary band configurations. That property is our precondition, but those papers treat it as a deployment convenience, not as a source of ensemble diversity.

Two papers come closest. Test-time augmentation with synthetic data addresses distribution shifts in spectral imaging replaces out-of-distribution pixel spectra using a 500,000-entry Monte Carlo lookup table. It works on fixed channels, uses a non-differentiable nearest-neighbour search, and depends on a tissue-specific physical simulator. Our method needs no simulator and no fixed channels. Test-time Training for Hyperspectral Image Super-resolution fine-tunes weights per image with a mean-teacher loop. It raises LIIF from 37.76 to 39.23 dB on CAVE, but it requires backpropagation at deployment, and its implicit function is continuous only in space. We keep the model frozen.

The aggregation design is shaped by Better Aggregation in Test-Time Augmentation. Its AugTTA learns one global weight per transformation and finds 72% of augmentations useless for ResNet-50. We replace the global, label-trained weights with per-image, per-wavelength weights computed from held-out bands. On the uncertainty side, Pitfalls of In-Domain Uncertainty Estimation and Ensembling in Deep Learning supplies the deep-ensemble-equivalent yardstick. Test-time Augmentation Improves Efficiency in Conformal Prediction supplies the route from member spread to intervals with guaranteed coverage.

Research Program

We will build an SSIF-style continuous model with three properties. It has a band-agnostic input encoder in the style of the spectral-band-agnostic fusion work, so each input band is embedded together with its wavelength and response curve. It has a Fourier-encoded coordinate head following SINR. It is trained with random input band-subset dropout.

The task is joint spatial and spectral super-resolution. The input is a low-spatial-resolution image with a sparse set of bands, for example 8 of CAVE's 31 bands or 24 of Spectral World's 204. The output is the dense, high-resolution continuous cube.

At test time we generate $K$ subsets, for example by interleaved or random partitions that hold out 25% of bands each. We then compute the held-out errors, the wavelength-dependent weights, and the confidence bands.

The analysis has two parts. The first tests whether held-out error actually predicts each member's true error at nearby wavelengths, using a rank correlation computed per scene and per wavelength. If it does not, the weighting is meaningless and we will report that. The second studies how gains depend on $K$, on the hold-out fraction, and on the kernel width $\kappa$.

Baselines

The naive reference is the same trained model run once on all input bands. The proposal must beat it on SAM and PSNR at matched training, otherwise nothing is gained.

Because band-dropout training alone may produce the improvement, a key ablation is that same band-dropout model run single-pass. A second ablation uses band-subset augmentation with uniform averaging. A third uses band-subset augmentation with AugTTA-style global weights learned on validation scenes. Together these isolate the contribution of the held-out-band weighting.

The geometric reference is the eight flips and rotations of Seven Ways to Improve Example-Based Single Image Super Resolution, applied to the same frozen model. That paper found the technique helpful in spatial super-resolution, and it costs the same eight forward passes we would use. The obvious continuous-coordinate baseline is wavelength jitter $\lambda \pm \delta\lambda$ with averaging, with $\delta\lambda$ tuned on validation. We also compare against simply smoothing the single-pass output curve with a tuned kernel. To show the continuous model itself is worthwhile, we include a discrete band-stacked network trained on the same inputs and interpolated to the target bands with cubic splines.

The strongest existing competitor is test-time training. Its best reported figure in the file is CAVE PSNR rising from 37.76 to 39.23 dB with a LIIF backbone, in Test-time Training for Hyperspectral Image Super-resolution. That result is for their spatial super-resolution setting, not ours, so we will rerun their mean-teacher procedure on our backbone and our splits. We will report accuracy alongside wall-clock time and memory.

For uncertainty, the reference is a deep ensemble of five independently trained models. The file contains no reported number for test-time augmentation on continuous spectral models, or for uncertainty on continuous spectral curves. Every method receives the same training data, backbone, and number of validation scenes for tuning its one or two hyperparameters.

Beating these baselines means three things. Our method must improve SAM over every forward-only baseline at equal $K$ on at least two of CAVE, Harvard and Spectral World. It must stay within the error bars of test-time training at a fraction of its compute. Its confidence bands must be better calibrated than geometric-augmentation spread and approach the deep ensemble.

Why not just…?

Why not just jitter the wavelength coordinate or smooth the output? We expect this to tie or win on PSNR for smooth reflectance spectra, since averaging reduces noise there. It should lose on SAM and on error at narrow absorption features, because it averages the model with itself rather than with independent evidence. This is the decisive comparison. If tuned smoothing matches our gains on feature-localized error, the proposal reduces to a filter and we will say so.

Why not just use flips and rotations? Geometric augmentation diversifies spatial errors, but every member sees identical spectral evidence. It therefore cannot correct a wrong spectral shape, and its spread underestimates spectral uncertainty. The synthetic-spectra paper likewise found the damaging shift lived along the spectral axis. We test this directly, and we also test the combination, since the two are complementary rather than exclusive.

Why not just do test-time training? It may reach higher PSNR, and that is a real threat. Its costs are backpropagation on the deployed device, per-image optimization that can become unstable (Li et al. needed channel-independent convolutions to stabilize it), and no uncertainty output. We report accuracy against compute so the trade-off is visible. We also test whether the held-out-band error can serve as a stopping signal for test-time training, which would make the two methods allies rather than rivals.

Why not just train a deep ensemble? It multiplies training cost by five and still needs five forward passes. We use it as the calibration ceiling, measured by deep-ensemble equivalent, rather than as a competitor on cost.

Proposed Experiments

We train on CAVE and test in-domain on CAVE. For cross-domain tests we use Harvard, which has natural illumination and a 420–720 nm range, and Spectral World, which has 204 bands over 400–1000 nm. We report PSNR, SSIM and SAM. We also report error restricted to wavelengths within a few nanometers of local spectral extrema, which is where smoothing should fail. For uncertainty we report correlation between predicted spread and true error, and empirical coverage of split-conformal intervals built from member spread. For downstream use we report classification accuracy on Pavia Centre, following SSIF's protocol.

A sensor-shift test runs each test scene with input band centers offset from the training configuration. This is where single-pass inference should degrade most and member disagreement should be most informative.

The decisive checks are three. First, held-out-band error must correlate with true member error. Second, our method must beat tuned output smoothing on feature-localized error. Third, it must beat the band-dropout-trained single-pass model. If any of the three fails, the core claim fails.