In this guide
How Hyperspectral Fruit Scanning Works: Wavelengths, Reflectance and Ripeness
A packhouse scanner does not taste a fruit, weigh its sugar or squeeze it for firmness. It shines light on the skin and reads what comes back. Different wavelengths bounce back differently as the fruit ripens, and that changing pattern is enough to grade it — provided the measurement is calibrated, the light is controlled, and nobody claims more than the spectrum actually shows.
Why one photograph is not enough
An ordinary colour photograph mixes all visible wavelengths into three numbers: red, green and blue. Two fruits can share the same RGB values while differing underneath the skin, and one fruit photographed under warm indoor light looks different from the same fruit under daylight. A spectral scanner avoids both problems by measuring reflectance wavelength by wavelength. Reflectance is simply the fraction of incoming light at one wavelength that bounces back from the surface. Plotting reflectance against wavelength gives a spectrum curve, and ripening moves that curve in recognisable ways.
What ripening does to a spectrum
Three effects dominate in fruit, and each lives at a different part of the spectrum:
- Chlorophyll fades in the green-red region. Unripe fruit is rich in chlorophyll, which absorbs strongly in blue and red while reflecting green — that is why unripe fruit looks green. As chlorophyll breaks down, green reflectance falls and red reflectance rises.
- Carotenoids build up in the yellow-red region. The orange and yellow pigments that colour ripe fruit absorb blue light and reflect longer wavelengths, so the spectrum tilts toward red as ripening advances.
- Internal structure shifts the near-infrared. Wavelengths just beyond visible red, roughly 730 to 950 nanometres, penetrate a little deeper and scatter from cell structure and water content. Near-infrared reflectance therefore carries information about what lies just under the skin, which is why packhouse researchers use it when hunting for internal defects rather than surface colour alone.
The steep rise between red absorption and near-infrared reflectance is sometimes called the red edge. Ratios between bands — for example red divided by near-infrared — compress the whole curve into one number that moves steadily with ripeness. That is the quantity a student build usually thresholds.
From hyperspectral to multispectral: the honest step down
A true hyperspectral camera records a continuous spectrum with hundreds of narrow bands for every pixel, producing a three-dimensional data cube: two spatial dimensions plus wavelength. That is powerful and expensive, and far beyond a student budget. The honest student version is multispectral: a handful of discrete bands instead of a continuous cube. A ring of LEDs at, say, 450, 530, 590, 630, 730 and 850 nanometres, plus white light, gives seven illuminations. A camera photographs the fruit under each one, and a spectral sensor such as the AS7341 records eleven channels — eight visible bands from about 415 to 680 nanometres, plus a near-infrared, a clear and a flicker channel, with an overall response from roughly 350 to 1000 nanometres (ams datasheet values). Seven illuminations times eleven channels is a small spectrum, not a hyperspectral cube, and a good report says so. The physics is the same; only the resolution is coarser.
Why calibration comes before grading
A sensor reading is meaningless without a reference taken under the same light. LED brightness drifts with temperature and supply voltage, and a dimmer LED would otherwise masquerade as a less reflective fruit. The standard fix is a white reference tile: a surface that reflects almost all light at all measured wavelengths. Scan the tile first, then divide every fruit reading by the tile reading for the same channel. Now the numbers are reflectance, not raw counts, and a tired power supply shows up as a calibration shift instead of silently regrading every fruit.
Two more controls matter. First, a dark enclosure: room light leaking in adds an uncontrolled illumination that varies with time of day, and the clear channel of the sensor will reveal it if you look. Second, specular reflection: glossy fruit skins throw a bright highlight straight back at the camera, which reads as a false bright spot. Diffused LEDs and ignoring the brightest highlight pixels are the student-scale fixes, and both belong in the report as limitations, not hidden.
How a student build turns spectra into grades
A practical student pipeline has five steps:
- Collect a sample set. Scan known unripe, ripe and overripe fruit of one type, and record the red to near-infrared ratio and the green channel for each.
- Set thresholds between the groups. If the sample groups separate cleanly, a threshold halfway between their ratio ranges is a defensible rule. If they overlap, the honest conclusion is that one ratio is not enough, and a second band must join the rule.
- Check the rule on the same samples, then on fresh ones. Agreement on the training samples is the easy test; fresh fruit the rule has never seen is the real one. Report both, with the sample counts.
- Flag defects separately. Dark-spot share inside the fruit outline is a different measurement from ripeness: a ripe fruit with a large bruise should be rejected even though its ripeness grade is correct. Keep the two decisions separate in the dashboard and in the report.
- Sort physically. A servo flap sending fruit to Accept or Reject bins turns a screen result into a demonstration an examiner can watch, and it forces the builder to handle timing, flap travel and bin placement as real engineering.
A worked example from the companion project, the Hectre-Inspired Hyperspectral Fruit Scanner, shows the shape of the method, not laboratory data: thresholds on the red to near-infrared ratio below 0.75 for Unripe, 0.75 to 1.15 for Ripe, and above 1.15 for Overripe, with a defect flag when dark spots exceed 5 percent of the fruit outline. Those numbers are design targets for one fruit type and one rig; another fruit or another LED ring needs its own sample set.
Where the method stops working
Spectral grading has sharp, honest limits. Thresholds set on one fruit type do not transfer to another, because skin pigments, thickness and ripening chemistry differ. The method measures appearance-related ripeness, not sugar content or firmness directly, so it cannot certify eating quality. It cannot see pesticide residue, and a surface scan cannot guarantee the interior is sound. Throughput is a further limit: a hand-placed, one-fruit-at-a-time rig demonstrates the physics but does not compete with a packhouse line scanning fruit on moving trucks. Finally, every accuracy figure needs its sample count beside it — a grade that was right on twelve fruit is a promising demonstration, not a validated instrument.
The commercial context
The reason this topic is current is that packhouses are moving the same physics from surface colour toward internal quality. In late October 2026, Auckland ag-tech firm Hectre opened a new laboratory to add hyperspectral sensing to its Arc packhouse scanner, which already scans fruit on open-top trucks as loads arrive for colour, size and external defects; the reported aim of the new work is internal defects, starch content and firmness. Those are reported commercial goals, not results a student build can claim. The student version of the same idea is the tabletop scanner in the companion project: Hectre-Inspired Hyperspectral Fruit Scanner — a Raspberry Pi, a NoIR camera, an AS7341 sensor, an LED ring and a servo sorting flap, grading one fruit at a time from builder-calibrated thresholds. Reading the guide and the project together shows exactly which parts of the headline survive at student scale.
Frequently asked questions
Is a multispectral scanner just a worse hyperspectral camera?
In resolution, yes; in method, no. Both measure reflectance against wavelength and both need calibration, controlled light and a decision rule. The student build trades hundreds of bands for a handful, which loses fine spectral detail but keeps the whole chain — illumination, sensing, calibration, grading, sorting — buildable and explainable. Naming the trade-off is stronger in a viva than pretending the two are equal.
Why use a NoIR camera instead of an ordinary camera?
An ordinary camera module has an infrared cut filter that blocks the near-infrared bands the scanner needs. A NoIR variant leaves that filter out, so the same camera can photograph the fruit under near-infrared LEDs. The trade-off is that ordinary colour photographs from a NoIR camera look washed out and pink, which is why the build keeps a separate white-light photograph for display and uses the band images for measurement.
Can machine learning replace the threshold rules?
It can, and it often should — a small classifier trained on the sample set can use all eleven channels instead of one ratio. But it also hides the decision: when a fruit is misgraded, a threshold rule tells you which band crossed which line, while a classifier gives a probability. A strong student approach is to ship the threshold version first, because it is debuggable, and then compare a classifier against it on fresh fruit, reporting whether it actually helped.
How many fruit make a credible sample set?
There is no magic number, but the report must state the count and the result together. A dozen fruit per grade demonstrates the method; several dozen per grade start to support a claim about reliability. What destroys credibility is an accuracy percentage with no sample count, no fruit type and no mention of fresh-fruit testing.
Limitations
This guide explains the physics and the student-scale method; it is not a manual for building a commercial grader. Spectral bands, sensor channels and camera figures quoted here are datasheet or reported values for the named parts, not measurements from a laboratory. Commercial packhouse results are reported references, not promises for any student build. Any scanner built from this guide grades appearance-related ripeness and surface defects only, and must not be presented as a food-safety or quality-certification instrument.