AI Vision: Fruit & Vegetable Sorting Guide

By James Smith on July 20, 2026

ai-vision-fruit-vegetable-sorting-grading-color-size

A grade-one apple and a grade-two apple can differ by a bruise smaller than 8mm, a color patch covering less than 10% of the surface, or a shape deviation invisible at line speed to a human grader working a four-hour shift. Fresh produce is biologically variable in ways no template-based vision system can handle — every apple, tomato, and pepper is physically unique, and the acceptable range for each attribute shifts by season, supplier, cultivar, and retail channel spec. AI vision cameras trained on cultivar-specific defect libraries grade every unit against configurable grade standards at commercial line speeds without the fatigue drift that costs packhouses a full grade band by shift's end. Walk a working produce grading pipeline against your own line when you book a demo.

AI VISION · FRUIT & VEGETABLE SORTING · COLOR · SIZE · BRUISE · FOREIGN MATTER

Grade every apple, tomato, and pepper against your spec — not one in fifty, not by shift-three memory.

Manual grading drifts measurably by hour three under fine-discrimination fatigue. Rule-based optical sorters break on biological variability across cultivars, seasons, and lighting. AI vision trained on your cultivar and defect library holds one grade standard across every shift, every SKU.

GRADE A · PREMIUM
Color at target maturity, no visible defects, size within top band.
GRADE B · STANDARD
Minor cosmetic marks, mid-band size, retail acceptable at standard pricing.
GRADE C / REJECT
Bruise, foreign matter, or off-spec size — diverted to processing or discard.
8 mm
Bruise diameter that separates grade one from grade two on a typical apple spec.
10%
Surface color patch coverage that shifts a tomato between ripeness bands.
Hour 3
Point at which human grader accuracy on fine discrimination drifts measurably.
100%
Inline coverage replacing sample-based inspection at commercial line speeds.

The four dimensions of a produce grading decision

Every grading spec, no matter how complex the retail agreement, collapses into decisions on four independent dimensions. AI vision has to handle all four in parallel, at line speed, without the trade-offs a single-camera rule-based system forces.

01 · COLOR
Maturity and Color Distribution
Ripeness bands for tomatoes, mangoes, and avocados; color uniformity for peppers and citrus; surface coverage of red versus green on apples. Trained on cultivar-specific color envelopes rather than fixed thresholds, so a Honeycrisp isn't judged against a Gala baseline.
02 · SIZE
Diameter, Length, and Volume
Longest axis, minor axis, projected area, and estimated volume from multi-angle imaging. Weight-by-vision correlates volume with density for a given cultivar, so size grading works without a load cell touching every fruit.
03 · DEFECT
Bruise, Blemish, and Damage
Surface bruises, punctures, splits, rots, sunburn, russeting, and cultivar-specific blemishes. The model distinguishes cosmetic marks that don't affect eating quality from genuine quality defects that justify downgrade or rejection.
04 · FOREIGN MATTER
Non-Product Contamination
Stones, sticks, plastic, metal fragments, wrong varieties, and rogue produce from the previous SKU. Anomaly detection against the trained normal envelope flags anything that isn't the graded product itself.

Why manual grading loses a grade band by shift's end

Grader fatigue isn't a discipline problem. The human visual system fatigues on repetitive fine-discrimination tasks in ways that are physiologically measurable, and the drift is consistent across shifts, plants, and cultivars. The numbers below are why packhouses on retail contracts can no longer rely on human graders alone.

Under 60%
Small foreign object detection
Human detection rate for small foreign objects on fast-moving food lines under controlled conditions, dropping further with fatigue.
4–5x
Inter-grader variability
Difference in grade calls between graders on the same lot, before fatigue enters — biological variability plus subjective interpretation.
One band
Shift-end drift
Average grade band drift by hour three of a four-hour shift, translating directly into misgraded product reaching retail.
Zero
Audit trail from a manual call
Recorded evidence of why a specific fruit was called grade A versus grade B — impossible to reconstruct during a downgrade dispute.

The camera stack for a packhouse grading line

Not every produce grading problem needs the same camera. Line-scan RGB handles color and size cheaply; near-infrared reveals surface bruises before they show visibly; hyperspectral finds internal defects that no visible-light camera can see. The right stack depends on the produce category and the defects that matter to your buyer.

SensorBest atLimitsTypical use
Line-scan RGBColor, size, shape, surface defectsMisses internal bruises and subsurface rotBaseline for every produce line
Near-infrared (NIR)Surface bruises before visible browningCultivar-specific reflectance calibration neededApples, pears, stone fruit
HyperspectralInternal defects, moisture, chemistryHigher cost, slower processingBlueberries, avocados, premium lines
Thermal (7.5–13 μm)Internal bruises, temperature deviationsRequires controlled thermal environmentBlueberry internal bruise detection
Multi-angle RGB arrayFull-surround inspection, stem-end visibilityAlignment and cost complexityApples, citrus, tomatoes on rollers
3D structured lightVolume, shape, dimensional gradingSlower cadence per unitWeight-by-vision on mangoes, peppers
See a grading model tuned to your cultivar and defect library

iFactory trains the classifier on your fruit, your grade spec, and your lighting — so the grade standard holds across cultivars, suppliers, and shifts instead of drifting after each intake.

Book a Demo

Cosmetic marks versus quality defects

The hardest part of produce grading isn't finding the defect — it's deciding whether the defect matters. A grader that rejects every cosmetic mark loses saleable product; a grader that accepts every mark ships downgrade to retail. Deep learning trained on category-specific libraries makes this call consistently.

COSMETIC · KEEP
Russeting on Apples
Rough patch of tan skin on the apple surface, common on certain cultivars, no impact on eating quality — cosmetic downgrade at most.
COSMETIC · KEEP
Minor Scarring on Citrus
Healed surface scars from wind or thorn contact, common in the field, do not affect internal fruit quality or shelf life.
COSMETIC · KEEP
Stem Puncture on Stone Fruit
Small surface puncture from an adjacent fruit stem in the bin, cosmetic only when the puncture has healed and remains dry.
QUALITY · REJECT
Impact Bruise
Subsurface tissue damage from drops or roller contact, often invisible in RGB until 24 to 48 hours later — NIR catches it immediately.
QUALITY · REJECT
Rot or Decay Point
Active decay from a wound or storage disease, spreads within the bin, and is a direct downgrade or reject regardless of coverage area.
QUALITY · REJECT
Split or Crack
Skin breach exposing flesh to air and pathogens, compromising shelf life and food safety — rejected regardless of otherwise premium appearance.

Category-specific defect libraries

A model trained on apples doesn't grade citrus, and one trained on Roma tomatoes doesn't grade cherry. Every category needs its own defect library, its own cultivar coverage, and its own grade spec calibration. These are the six categories iFactory most commonly deploys against.

Apples and Pears
Cultivar color envelopes (Gala, Honeycrisp, Bartlett), russeting tolerance, bruise detection under NIR, stem-end and calyx-end recognition, and size grading by diameter or count-per-carton.
Citrus
Peel color and coverage, minor scarring tolerance, oleocellosis versus rot, size grading by count, and surface texture consistency across oranges, mandarins, lemons, and grapefruit.
Stone Fruit
Blush color and coverage on peaches and nectarines, stem-end punctures, hail damage, and bruising under NIR — critical for pack quality on softer cultivars with narrow shelf life.
Tomatoes and Peppers
Ripeness bands from breaker through light red to full red, color uniformity, shoulder green tolerance, blossom-end rot, and shape grading for beefsteak versus Roma versus cherry types.
Leafy Greens
Wilt and yellowing detection, foreign leaf identification, insect damage grading, and rogue variety detection where multiple SKUs run on the same wash and pack line.
Root and Tuber
Skin condition on potatoes and carrots, greening detection on potatoes, size grading, misshape rejection, and foreign matter (stones and clods) removal from the wash line output.

From infeed conveyor to grade lane divert

A working produce grading deployment is four stages that have to be aligned with the mechanical sorter. iFactory delivers all four as a turnkey stack, so the packhouse operator doesn't manage cameras, GPU drivers, or model retraining across cultivar seasons.

01
Infeed and Singulation
Fruit spread onto rollers or a belt so every unit is imaged individually and rotated for multi-angle capture. Bruising from the infeed itself is minimised by belt geometry and speed tuning.
02
Multi-Angle Imaging
Cameras arranged around the fruit capture stem, calyx, and side surfaces. Controlled LED lighting stabilises image conditions across the shift, and NIR channels are captured in parallel where needed.
03
Grade Classification
On-prem NVIDIA edge inference runs the trained model against every image, outputting a grade decision and confidence score in under 200 milliseconds per unit.
04
Divert and Record
Digital output to the mechanical sorter routes each unit to the correct grade lane. Every decision is logged with image, grade, confidence, and timestamp for downstream audit and dispute resolution.

Frequently asked questions

How much cultivar-specific training data does the model need?
A production-ready cultivar model typically needs several thousand graded images spanning the range of defects and normal variation you expect to see. iFactory bootstraps from a category-level defect library covering common failure modes, then fine-tunes on your cultivars, your grade spec, and your lighting during a shadow-mode training phase. Only once accuracy meets the agreed threshold does the model move into live grading. Book a demo to see the training and shadow-mode workflow.
What happens when a new cultivar or supplier comes in for the season?
Every cultivar or supplier change is a retraining trigger. The system captures images of the incoming fruit under the same camera and lighting setup during initial runs, adds those images to the training set, and pushes an updated model to the edge server. During the transition, the previous cultivar's model runs against the new fruit with a tightened confidence threshold so operators review borderline decisions rather than auto-diverting them. Contact our support team to walk through the changeover workflow.
Can AI vision replace our existing rule-based optical sorter?
In most packhouses, no — and it shouldn't try to. Existing optical sorters handle color and size grading reliably under stable conditions and remain the cost-effective baseline. Deep learning is added as a layer on top for the harder decisions: subtle bruising under NIR, cultivar-specific defect classification, foreign matter that isn't a fixed shape or color, and rogue variety detection. Book a demo to see the layered stack against your current sorter.
Does the AI need hyperspectral cameras, or is RGB enough?
RGB is enough for color, size, shape, and surface defect grading on most produce categories. NIR is added when subsurface bruises matter, which is the case for apples, pears, and stone fruit. Hyperspectral is reserved for high-value categories where internal quality or chemistry matters, like blueberries and avocados. iFactory picks the sensor stack based on the category and grade spec, not by defaulting to the most expensive option. Contact our support team for a sensor recommendation against your produce category.
How long does a packhouse deployment typically take?
A single-line packhouse deployment typically takes eight to fourteen weeks depending on the number of grade lanes, cultivar coverage required, and integration with the mechanical sorter. The first weeks cover physical camera and lighting installation and shadow-mode data capture; the middle weeks are model training and cultivar-specific tuning; the final weeks are live grading with confidence thresholds refined against real production. Book a demo to scope a timeline against your line configuration.
One grade standard, every shift, across every cultivar

iFactory ships cameras, on-prem NVIDIA edge inference, sorter integration, and per-unit audit records as one turnkey stack. Book a demo and walk it against your grading spec.

Book a Demo

Share This Story, Choose Your Platform!