Current position:
An invisible leaf disease can be easily detected by this spectral algorithm! A hardcore paper helps you understand a new approach to hyperspectral detection

An invisible leaf disease can be easily detected by this spectral algorithm! A hardcore paper helps you understand a new approach to hyperspectral detection

2026-07-22 16:27 CHNSpec

Peers working on agricultural product inspection and spectral analysis often encounter a real headache: early crop diseases are hidden inside the leaves, showing no abnormalities on the surface. By the time lesions become visible to the naked eye, the pathogens have already spread over a large area, driving orchard losses straight to the maximum.


The journal Chemometrics and Intelligent Laboratory Systems has published an interesting study that grafts the Matrix Profile algorithm from time-series analysis onto hyperspectral imaging. It specifically targets the early non-destructive screening of apple scab, solving the pain points of easy misjudgment and weak lesion contrast in traditional spectral detection.


I. Why Does Traditional Hyperspectral Detection Always Tend to "Misjudge"?


Hyperspectral imaging can simultaneously acquire image spatial information and hundreds of bands of spectral data, allowing the analysis of internal moisture and organic matter changes in crops without destroying the samples. It is a commonly used tool for non-destructive agricultural detection. However, when placed in field leaf detection scenarios, its shortboards are infinitely amplified.


The paper mentions that the structure of the leaf itself is complex. Leaf veins, thickness, surface roughness, and light scattering all generate massive spectral interference, forming a strong global baseline shift. Taking apple scab-infected leaves as an example, the lesions are extremely small in the early stage of infection. The subtle spectral differences caused by minor moisture changes are completely covered up by the physical noise of the leaf itself.


Conventional processing methods rely on PCA dimension reduction, spectral indices, or supervised learning, and their problems are very obvious:

  • Supervised models require advanced labeling of a large number of diseased and healthy leaf samples, making it difficult to quickly reuse them in new disease scenarios;

  • PCA directly processes raw reflection spectra, so leaf veins and shadows are all recognized as anomalies, making it impossible to separate lesions from normal tissues;

  • Global multiplicative scattering effects cause serious interference, and slight changes in lighting can disrupt the entire data set.

Simply put: Traditional algorithms cannot distinguish between "natural leaf textures" and "lesions caused by pathogens," leading to many misjudgments and making it very difficult to highlight early micro-lesions.

Hyperspectral detection of leaf diseases 1.png


II. A Cross-Border New Approach: Time-Series Matrix Profile Algorithm Applies "Difference Filtering" to Spectra


The most ingenious innovation of this paper is transforming the Matrix Profile algorithm, which was originally used for time-series mining, into a hyperspectral data preprocessing tool. The entire process is unsupervised and requires no advanced sample labeling. The core logic is very easy to understand.


1.A layman's guide to what Matrix Profile is

In time-series analysis, the Matrix Profile compares sequence segments one by one to calculate the distance between each short segment and its most similar segment globally. A higher distance indicates that this segment of data is more unique and anomalous. The research team converted the two-dimensional leaf spectral pixel matrix into a one-dimensional long sequence, treated continuous bands as "time-series segments," and set a sliding window of 50 bands as a group.


Each spectral window calculates its minimum Euclidean distance to other windows, generating a brand-new "distance spectrum," which is the MP distance spectrum in the paper. This is equivalent to adding a layer of filter to the raw spectra: it retains only local spectral differences and weakens the global interference brought by the overall scattering of the leaf.


2.A minimalist breakdown of the entire detection workflow

  • Collect SWIR (Short-Wave Infrared) hyperspectral data of apple leaves and select the region of interest containing early lesions;

  • Stretch the three-dimensional spectral cube into a one-dimensional sequence, use a sliding window to intercept band subsequences, and calculate the Matrix Profile distance;

  • Generate a pixel-band distance matrix and intercept effective bands for a secondary PCA analysis;

  • Calculate the score distance (SD) to generate a visualization heatmap, highlighting and marking abnormal lesion pixels.

This complete workflow does not require manual labeling of disease samples. The computation can be performed directly upon obtaining the raw hyperspectral image, which is extremely friendly for rapid field screening scenarios.

Hyperspectral detection of leaf diseases 2.png


III. Measured Data Speaks: Lesion Contrast Substantially Enhanced, Interference Information Sharply Reduced


The study selected two groups of leaf samples on the 4th and 5th days after inoculation for comparison. PCA analysis was performed using the raw reflection spectra and the distance spectra transformed by the Matrix Profile, respectively. The gap between the two sets of data is clear at a glance.

Hyperspectral detection of leaf diseases 3.png


1.Heatmap comparison: Leaf veins "disappear," while lesions are clearly highlighted

Directly performing PCA score distance imaging on the raw spectra results in the entire leaf being covered with highlighted noise points. Leaf veins, leaf edges, and slight shadows are all judged as anomalies. Small lesions are submerged in the noise, making it hard for humans to locate the disease focus.


After being transformed by the Matrix Profile and then imaged, the interference signals brought by leaf veins and leaf textures are heavily suppressed. The only highlighted area across the entire image is the apple scab lesion region, while irrelevant noise dots almost completely disappear, leaving clear and distinguishable lesion boundaries. According to the paper's statistics, the Wilks' lambda values for both sample groups showed a significant decline, the intra-class variance proportion was reduced by nearly half, and the degree of differentiation between healthy leaf pixels and lesion pixels was remarkably improved.


2.Spectral mechanism: Diseases are hidden on both sides of the water absorption bands

Through loading curve analysis, the paper reached a key conclusion: pathogen infection changes the internal moisture status of the leaf. The spectral slope changes on both sides of the two water absorption peaks at 1400–1450nm and 1900–2000nm serve as the core characteristic bands for distinguishing healthy leaves from infected ones.


The raw spectra obscure these subtle slope changes behind the overall reflection intensity. The Matrix Profile transformation amplifies the local differences between bands, converting the subtle deformations of the water absorption bands into high distance values. Consequently, even for early leaves infected for only 2–5 days, weak disease signals can still be captured.

Hyperspectral detection of leaf diseases 4.png

Meanwhile, the paper verifies that this algorithm has good compatibility with abnormal regions of different spectral characteristics. Pseudo-anomalies caused by image registration errors and real lesions can be identified synchronously without missing different types of spectral anomalies.


IV. Implementation Inspiration: What Changes Can This Algorithm Bring to Spectral Detection?


Putting aside the laboratory scenario of the paper, this Matrix Profile preprocessing concept offers considerable reference value for practitioners working on non-destructive hyperspectral detection of fruits, vegetables, and crops:

  • Reduce sample labeling costs: As an unsupervised algorithm, when facing new crop diseases or unknown defects, there is no need to collect a large number of labeled samples in advance, shortening the equipment debugging cycle;

  • Adapt to complex field samples: Leaves and fruit peels naturally possess differences in texture and thickness. The algorithm can weaken physical structure interference, improving detection stability in the wild and in greenhouses;

  • Lightweight adaptation for imaging equipment: The calculation logic of the Matrix Profile is concise and can be integrated into small hyperspectral imaging equipment and online sorting production lines to achieve real-time preprocessing imaging;

  • Expand to multi-category detection scenarios: In addition to fruit tree leaf diseases, the same logic can be applied to internal moldiness of fruits, hidden damage in agricultural products, and micro-defect screening in industrial materials.

Currently, this study only uses apple scab as a proof of concept. There is still research space for parameter sensitivity and dataset expansion to multiple crops in the follow-up, but it is sufficient to prove that the Matrix Profile is a preprocessing solution that adapts well to hyperspectral data and is worth trying out in practice.


Disclaimer


This content is compiled and edited from the public academic literature link:https://www.sciencedirect.com/science/article/pii/S0169743926001292 . It is intended solely for industry technical discussion and popular science learning, does not serve as any commercial commitment, and cannot be used as a basis for investment reference. The various experimental data and conclusions listed in the article can be interfered with by multiple variables such as the test environment, individual differences in samples, and model construction schemes. If applied to actual scenarios, the relevant effects need to be verified through separate actual testing based on one's own scenario.