Toxic fungi such as Fusarium in wheat and Aspergillus in maize grow inside a kernel for days before anything shows on its surface. Imaging methods that only see the surface miss this window. Coherent waves that can see inside an intact kernel, such as terahertz pulses (far-infrared light whose echo timing reveals buried layers), return echoes covered in speckle. Speckle is the grainy interference pattern that appears when a coherent wave scatters off a rough surface. On a single scan it can bury the echo from an internal layer completely. We propose to borrow a trick from cosmology. Astronomers cannot see the 150-megaparsec acoustic shell around any single galaxy. They still measure it precisely as a small bump in the statistics of galaxy separations, averaged over millions of galaxies. Changes in the bump's apparent size then tell them how space between galaxies has stretched. We would do the same inside grain. Healthy kernels of a given cultivar have internal tissue layers of fairly stable thickness. Averaged over many speckled echoes, these layers should produce a preferred echo-delay separation, a "standard ruler." When fungal hyphae invade, they change the tissue's water content and structure, which changes how fast the wave travels. The ruler then appears stretched, and stretched differently in different frequency bands, because lower frequencies penetrate deeper.
The core claim is narrow and testable. A ruler-dilation statistic, computed in each frequency band on speckle-whitened terahertz echoes from intact kernels, detects internal colonization during the stage when no symptoms are visible. In that stage it should outperform surface hyperspectral imaging, raw-waveform neural networks, and a simple bulk time-of-flight measurement. Detection here means separating colonized from clean kernels and estimating how deep the hyphae have reached. The method senses tissue change, not toxin molecules at parts-per-billion levels. Toxin concentration (deoxynivalenol, measured destructively in the lab) is treated as a correlated outcome, not something the instrument reads directly.
Where This Sits
Three pieces of prior work motivate the gap.
- Hyperspectral imaging. The review by Kabir et al. (Detection of Mycotoxins in Cereal Grains and Nuts Using Machine Learning Integrated Hyperspectral Imaging: A Review) collects visible-to-shortwave-infrared imaging studies that reach very high accuracy on surface reflectance. These methods do not resolve depth.
- Single-point surface spectroscopy. The banana anthracnose work (A Vis/NIR spectra-based approach for identifying bananas infected with Colletotrichum musae) stages infection day by day with a one-dimensional convolutional network. It also sees only the surface.
- Terahertz grain spectroscopy. The wheat-variety study (Discrimination of Wheat Varieties by Terahertz Time-Domain Spectroscopy and Convolutional Neural Network) shows that terahertz absorption carries biochemical information about grain. It obtains clean spectra only by grinding kernels into powder pressed into 1.2 mm pellets. That step destroys exactly the depth structure we want, and it sidesteps speckle rather than handling it.
Two lines of work supply the method.
- Speckle whitening. In exoplanet imaging, deep PACO (deep PACO: Combining statistical models with deep learning for exoplanet detection and characterization in direct imaging at high contrast) models speckle with local patch covariances and whitens images before a learned detector. Its authors report that training directly on raw speckled data failed. That negative result constrains our design. We reuse the whitening step, but not the point-source detector, which they note fails on extended structures. A tissue layer is an extended structure.
- Correlation-peak ruler. The baryon acoustic oscillation (BAO) analyses supply the estimator. They detect a preferred separation in the two-point correlation function and report its apparent size relative to a reference as a dilation parameter. Examples are Baryon acoustic oscillations in the Sloan Digital Sky Survey Data Release 7 galaxy sample and DESI DR2 results. II. Measurements of baryon acoustic oscillations and cosmological constraints. The DESI validation (Validation of the DESI DR2 measurements of baryon acoustic oscillations from galaxies and quasars) shows how much precision depends on sharpening the peak before fitting: reconstruction cut uncertainties by "up to 42-47%." Our speckle whitening plays the analogous sharpening role.
Dual-frequency radar snow-depth retrieval is the closest physical analogue. The DuST algorithm (Estimating snow depth over Arctic sea ice from calibrated dual-frequency radar freeboards) subtracts Ka- and Ku-band scattering horizons. It converts the difference to depth with a fixed velocity factor of 0.781, and it needs empirical airborne calibration because physical models of the snow microstructure were too error-prone. Our proposal differs in two ways. The calibration comes from an internal ruler measured in the data itself, not an external campaign. The wave-speed change is the signal rather than a nuisance. As far as the research file shows, no prior work has profiled intact grain with coherent waves while handling speckle statistically.
Research Program
We would build a dataset of intact kernels scanned in reflection by terahertz time-domain spectroscopy.
- Kernels and treatments. We would use two wheat cultivars inoculated with Fusarium graminearum and sampled at several days after inoculation, plus maize inoculated with Aspergillus flavus as a second host.
- Moisture-matched controls. Some kernels would be mock-inoculated with sterile medium and held at the same humidity. Water alone changes the wave speed in tissue, so these controls separate a colonization effect from a wetting effect.
- Speckle realizations. Each kernel would be raster-scanned at many neighboring positions and several orientations. Each position counts as one speckle realization.
- Ground truth after scanning. Every kernel would be sectioned for histology, giving the depth of hyphal invasion. Batches would be assayed for deoxynivalenol or aflatoxin B1. The same kernels would also be imaged hyperspectrally before scanning, so all baselines see identical specimens.
The processing has four stages.
- Whitening. Following deep PACO, we estimate the covariance of echo waveforms across neighboring scan positions on each kernel and whiten the echoes. The goal is to turn speckle into approximately uncorrelated noise.
- Band splitting. We split each pulse into three frequency bands, roughly 0.2–0.5, 0.5–0.9 and 0.9–1.4 THz. These sit inside the clean window used by the wheat-variety study. In each band we deconvolve against a reference pulse to get a depth-resolved impulse response.
- Ensemble autocorrelation. Over all scan positions on a kernel, we average the autocorrelation of the impulse response. The peak at lag $\tau_b$ in band $b$ marks the characteristic spacing between the outer seed coat and the underlying tissue interface.
- Ruler dilation. We fit the dilation in each band:
$$\alpha_b = \frac{\tau_b}{\tau^{\mathrm{ref}}_b},$$
Here $\tau^{\mathrm{ref}}_b$ is the peak lag measured on healthy kernels of the same cultivar. It plays the role that the sound horizon, fixed by early-universe physics, plays in cosmology.
Converting dilation to depth. If the physical layer spacing $L$ is fixed, then $\alpha_b$ equals the ratio of the effective refractive index in the tissue sampled by band $b$ to its healthy value, because echo delay is $2nL/c$. Low-frequency bands probe deeper, so the pattern of $\alpha_b$ across bands acts as a coarse depth profile of the change, in the same way Ka and Ku horizons bracket a snow layer. We would fit an amplitude-damping parameter alongside the peak position, as BAO fits damp the peak for nonlinear smearing. The final predictor of colonization depth would be a small model taking $\alpha_b$, the damping estimates and the whitened waveform summary.
What would kill the idea. The key physical assumption is that $L$ is stable within a cultivar. We test it directly by comparing histological layer thickness to $\tau^{\mathrm{ref}}_b$ on healthy kernels. If the spread in thickness is comparable to the colonization-induced shift, the ruler concept fails.
Baselines
Naive reference. The do-nothing reference is the majority-class predictor together with a trained human visual symptom score on the same kernels. In the asymptomatic window this should sit near chance. It shows how much of the task is trivially easy at later stages.
Surface hyperspectral imaging. We apply partial least squares regression and a convolutional classifier to the hyperspectral images, tuned with the same cross-validation budget as our model. This is the strongest established competitor for non-destructive mycotoxin screening. Kabir et al.'s review reports linear discriminant and nearest-neighbour classifiers reaching "100% accuracy in some DON detection studies in wheat," and partial least squares reaching an $R^2$ of 0.9935 for aflatoxin B1 in wheat (Detection of Mycotoxins in Cereal Grains and Nuts Using Machine Learning Integrated Hyperspectral Imaging: A Review). These figures come from mostly symptomatic or surface-contaminated samples, so they do not transfer directly. To beat this baseline, our method must show a higher area under the ROC curve for colonized versus clean kernels in the asymptomatic subset. That subset is defined as kernels that hyperspectral imaging scores negative and histology scores positive, with confidence intervals from kernel-level bootstrap. We also require no loss on symptomatic kernels.
Raw-waveform network. This is a one-dimensional convolutional network on the raw terahertz echoes, without whitening or ruler features. Its architecture follows the network used for banana spectra (A Vis/NIR spectra-based approach for identifying bananas infected with Colletotrichum musae), scaled to match our parameter count and training compute. The closest terahertz grain result in the file is 97.8% prediction accuracy for variety discrimination on powdered pellets (Discrimination of Wheat Varieties by Terahertz Time-Domain Spectroscopy and Convolutional Neural Network). That is a different task on destroyed samples. We found no reported result on Lacuna for terahertz detection of fungal colonization in intact kernels.
Bulk time-of-flight index. We measure kernel thickness optically and divide the through-kernel echo delay by it, giving one average refractive index per kernel.
Ablations. Three ablations isolate the key ingredients: ruler features without whitening, whitening without ruler features (whitened waveform only), and a single broad band instead of three bands. All models share kernel-level splits, so no kernel appears in both training and test. Splits are stratified by inoculation batch, and we hold out a cultivar entirely to test transfer.
Why not just…?
Why not just use hyperspectral or near-infrared imaging, which already reports near-perfect accuracy? This is the most serious threat. The published accuracies are high. If colonization changes kernel surface chemistry early enough, surface imaging may already close the window. The prior work does not settle this, because those studies were not stratified by days since infection or confirmed by histology as asymptomatic. Our design settles it directly. We report both methods on the identical asymptomatic subset. If hyperspectral imaging matches the ruler method there, the depth-profiling motivation collapses, and we would report that as the main finding.
Why not just train a deep network on raw terahertz waveforms? Deep PACO's authors found that raw training on speckled data failed to converge in their domain. That is suggestive, not proof, for grain. The raw-waveform baseline and the no-whitening ablation test it here. If the raw network matches our model in the asymptomatic window, whitening and the ruler are unnecessary, and we would say so.
Why not just measure the bulk refractive index from kernel thickness and transit time? This is cheap and physically sensible. It captures any colonization signal that changes the average wave speed. The ruler adds two things: a layer-specific measurement that does not require transmission through a lossy hydrated kernel, and depth discrimination across bands. Both advantages are only hypotheses. If bulk index alone reaches the same asymptomatic AUC, the ruler is redundant. The head-to-head comparison is part of the core results, not an afterthought.
Why not just apply an off-the-shelf despeckling filter? Partial-differential-equation and diffusion despeckling filters smooth homogeneous regions while keeping edges. Examples are the Perona–Malik module in SAR-to-Optical Image Translation via Neural Partial Differential Equations and A tunable despeckling neural network stabilized via diffusion equation. They were designed for two-dimensional images, and they may shift echo timing, which is exactly the quantity the ruler measures. We include one such filter as a substitute for whitening. We then measure both the bias it introduces in $\tau^{\mathrm{ref}}_b$ and the detection AUC.
Decisive Checks
Three results decide the proposal.
- Ruler stability. On healthy kernels, the spread of $\tau^{\mathrm{ref}}_b$ within a cultivar must be clearly smaller than the dilation measured in histologically colonized kernels.
- Not just water. The moisture-matched mock-inoculated controls must show dilation distinguishable from that of colonized kernels. Otherwise the signal is water, not fungus.
- Beating surface imaging. In the asymptomatic subset, the ruler-plus-whitening model must exceed hyperspectral imaging and bulk time-of-flight in AUC. Its depth estimate must also correlate with histological invasion depth better than the single-band ablation does.
Secondary transfer check. The estimator is not grain-specific. We would also apply the whitened correlation-peak fit to coincident CryoSat-2 and AltiKa waveforms over the Operation IceBridge tracks. The comparison point is DuST's leave-one-year-out root-mean-square deviation of 5.3–7.7 cm against airborne snow depths (Estimating snow depth over Arctic sea ice from calibrated dual-frequency radar freeboards). Matching it without airborne calibration would show that the ruler idea generalizes. Failing there would not by itself sink the grain result.
References
- Detection of Mycotoxins in Cereal Grains and Nuts Using Machine Learning Integrated Hyperspectral Imaging: A Review
- A Vis/NIR spectra-based approach for identifying bananas infected with Colletotrichum musae
- Discrimination of Wheat Varieties by Terahertz Time-Domain Spectroscopy and Convolutional Neural Network
- deep PACO: combining statistical models with deep learning for exoplanet detection and characterization in direct imaging at high contrast
- Baryon acoustic oscillations in the Sloan Digital Sky Survey Data Release 7 galaxy sample
- DESI DR2 results. II. Measurements of baryon acoustic oscillations and cosmological constraints
- Validation of the DESI DR2 measurements of baryon acoustic oscillations from galaxies and quasars
- Estimating snow depth over Arctic sea ice from calibrated dual-frequency radar freeboards
- SAR-to-Optical Image Translation via Neural Partial Differential Equations
- A tunable despeckling neural network stabilized via diffusion equation