Proposal · October 2026

FlakeGrade

On-premise computer-vision grading & sizing for corn flakes

Prepared for Sri Bhagyalakshmi Agro Foods by Svayou

● 660 flakes graded on your sample● Runs inside your plant
Every flake outlined and gradedYour 19 Oct sample — every flake detected, measured and graded
The objective

Make grading objective, repeatable and fast

Today a batch is accepted or rejected on a manual, subjective judgement. FlakeGrade replaces the human estimate with measurement — every flake, every time.

Classify

Every flake, one of 7 grades

Each individual flake is assigned a grade from your master standard — no sampling by eye.

Size

Real dimensions in mm

Length, width and equivalent diameter for every flake, from a calibrated camera.

Decide

Accept / reject, with evidence

Batch grade mix vs your master, run through your rule — with a full per-flake audit trail.

FlakeGrade · Svayou
Your standard

The master reference: 7 grades

GradeDefinitionTarget
PureWell-formed, uniform golden flake61.1%
JointTwo or more flakes fused11.9%
SmallUndersized flake11.0%
UnpolishedDull / incompletely polished surface5.5%
HardOver-processed, deep-coloured5.4%
EmbryoPale germ tissue attached3.1%
BrokenFragmented / broken piece2.0%
Pure
Joint
Small
Unpolished
Hard
Embryo
Grade photos: your labelled reference piles
Already working on your sample

660 flakes, each one graded

Graded full sample
GradeSampleMaster
Pure68.0%61.1%
Joint5.2%11.9%
Small9.7%11.0%
Unpolished7.9%5.5%
Hard8.5%5.4%
Embryo0.2%3.1%
Broken0.6%2.0%

From a 1280×720 phone photo with no reference object. Full interactive report with every flake's measurements: flakegrade-bhagyalakshmi.pages.dev/report

FlakeGrade CV engine v0.3
Part 2

Under the hood

The imaging, geometry, colour science, statistics and edge-deployment engineering behind every number in the report.

● In the POC today● Production build
System architecture

An eight-stage vision pipeline

Each frame flows through deterministic, versioned stages. Every intermediate result is inspectable — nothing is a black box.

01

Acquisition

Fixed-geometry camera, diffuse LED, locked exposure & white balance

›
02

Calibration

Lens undistortion, flat-field, colour card, mm-per-pixel scale

›
03

Colour space

sRGB → linear → CIE XYZ (D65) → CIELAB / LCh

›
04

Segmentation

LCh gating, morphology, chroma-aware hole filling

›
05

Instances

Distance transform, seed detection, geodesic split

›
06

Features

~20-dimensional geometric + colorimetric descriptor per flake

›
07

Classifier

Rule cascade + trained model, batch-relative

›
08

Inference

Proportions, confidence intervals, accept / reject

Determinism layer — SHA-256 image fingerprint + pipeline version → identical input always yields identical output
Audit layer — per-flake record: geometry, colour, grade, rule that fired, model version
Edge runtime — all stages execute locally on the station; zero network egress
Stages 03–08 running in POC · 01–02 + edge runtime in production station
Stages 01–02 · Image formation & calibration Production station

Turning pixels into millimetres

Pinhole projection & scale

s·[u, v, 1]ᵀ = K [R | t] [X, Y, Z, 1]ᵀ

With the camera fixed square above the tray, scale is constant across the field:

mm/px = Wref / wpx  ·  e.g. 50 mm marker / 148 px = 0.338 mm/px

Lens distortion (Brown–Conrady)

xd = x(1 + k₁r² + k₂r⁴ + k₃r⁶) + 2p₁xy + p₂(r² + 2x²)

Coefficients estimated once at install from a checkerboard (Zhang's method), then every frame is undistorted so edge flakes measure as accurately as centre flakes.

Flat-field correction

Icorr = (Iraw − D) · mean(F − D) / (F − D)

A dark frame D and a flat white frame F remove lighting fall-off and vignetting — essential for colour grades like Hard and Unpolished.

Colour constancy

A reference colour card in frame fixes white balance and exposure per session, so a "deep-coloured" flake means the same thing on every shift, under any factory lighting.

POC today: scale assumed from the sheet width (A1, 841 mm → 0.674 mm/px on the 1280-px photo).

Calibration is performed once at installation
Stage 03 · Colour science In POC

Measuring colour the way the eye does

RGB is device-dependent and perceptually uneven. Every pixel is converted to CIELAB, where equal numeric distances are equal visible differences.

sRGB → linear:  c = ((c′ + 0.055) / 1.055)2.4 linear → XYZ:  [X Y Z]ᵀ = MD65 · [R G B]ᵀ L* = 116 f(Y/Yₙ) − 16   a* = 500[f(X/Xₙ) − f(Y/Yₙ)]   b* = 200[…] Chroma C* = √(a*² + b*²)    Hue h = atan2(b*, a*)
  • L* separates deep (Hard) from pale (Embryo germ)
  • C* separates golden flake from white sheet — and dull (Unpolished) from glossy
  • h constrains to the yellow–orange band (40°–105°)
1Input region (sRGB)
2Computed chroma field C* — flakes glow, sheet goes dark
Real outputs from your 19 Oct sample
Stage 04 · Segmentation In POC

Separating flake from surface

Region of interest

The sample surface is found as the largest low-saturation connected component; morphological closing and hole-filling define the tray. Hands, table and labels outside it are excluded.

LCh gating

M(x) = [C* > 30] ∧ [40° < h < 105°] ∧ [25 < L* < 92] ∧ ROI

Followed by morphological opening (3×3, 2 iterations) to cut thin bridges between touching flakes.

Chroma-aware hole filling

Interior holes are filled only if small and cream-coloured (C* > 11 — germ tissue). White gaps enclosed by a ring of flakes stay open, so empty space is never counted as a fused "joint".

2Chroma field
3Binary flake mask M(x)
Real outputs from your 19 Oct sample
Stage 05 · Instance separation In POC

Counting touching flakes exactly once

The hardest problem in flake counting: piles touch. A connected blob may contain several flakes. We split them geometrically.

1 · Which blobs need splitting?

split ⟺ A > 1.6·Â  ∨  A / Ahull < 0.86

 = robust single-flake area (45th percentile); low solidity reveals the "waist" where two flakes meet.

2 · Euclidean distance transform

D(p) = minq ∉ M ‖p − q‖₂

Each flake body becomes a peak; necks become valleys. Local maxima with D > 0.42·r̂ become seeds.

3 · Geodesic seeded growth

Seeds grow simultaneously inside the blob until they meet, partitioning it along the necks — every pixel assigned, none lost.

3Mask
4Distance transform + seeds
5Instance labels
6Graded output
Real outputs from your 19 Oct sample · 571,085 mask pixels → 660 instances, 0 pixels lost
Stage 06 · Per-flake geometry In POC

Measuring a single flake

Flake 456 with hull and calipers Flake #456 · — max Feret · — min Feret · — convex hull
DescriptorDefinition#456
Lengthmax Feret (rotating calipers on hull)21.8 mm
Widthmin Feret over hull edges10.4 mm
Eq. diameter√(4A / π)14.8 mm
Areapixel count × (mm/px)²170.9 mm²
SolidityA / Ahull1.00
Circularity4πA / P² (Crofton perimeter)0.77
Aspect ratioFeretmax / Feretmin2.10

Solidity flags fused pairs and ragged fragments; circularity separates broken pieces from whole flakes; Feret length drives the Small grade and is printed on each flake.

Computed by the FlakeGrade engine for one flake in your sample
Stage 06 · Colorimetric & texture descriptors In POC

A ~20-dimensional fingerprint per flake

FeatureComputed over flake interior Ω#456
Lightnessμ(L*)59.1
a*, b*μ(a*), μ(b*)9.0, 60.4
Chroma / hueμ(C*), atan2(b*, a*)61.3 · 81.5°
Surface roughnessσ(L*) over Ω ⊖ B₂4.65
Germ fractionP(L* > L̃+10 ∧ C* < 0.72C̃)0.7%
Dark fractionP(L* < L̃ − 14)0.6%

Ω ⊖ B₂ = interior eroded by 2 px, so edge halos don't pollute colour statistics. L̃, C̃ = batch medians.

Batch-relative normalisation

Factory light shifts absolute colour. So every colour feature is scored against the batch itself with a robust z-score:

z = (x − median(x)) / (1.4826 · MAD(x))

MAD — median absolute deviation — ignores outliers, so a handful of dark flakes can't drag the baseline.

Why it matters

"Hard" becomes z(L*) < −1.5: a flake markedly deeper than its own batch — stable across shifts, cameras and lighting.

Values are the engine's measurements for flake #456
Stage 07 · Classification

A hybrid classifier: rules + learned model

In POC · deterministic cascade

Interpretable decision path

if A < 0.55Â ∧ (solidity < 0.80 ∨ circ < 0.52) → Broken elif A > 2.3Â ∨ (A > 1.7Â ∧ solidity < 0.80) → Joint elif Øeq < 0.70·median(Ø) → Small elif germ > 16% → Embryo elif z(L*) < −1.5 ∨ dark > 40% → Hard elif z(σ) > 1.6 ∨ z(C*) < −1.6 → Unpolished else → Pure

Every threshold is a parameter in a versioned config — tunable per line.

Production · trained on your labels

Learned colour-grade model

  • Gradient-boosted trees over the 20-D feature vector for the fine colour grades (Embryo, Hard, Unpolished)
  • Instance-segmentation CNN (Mask R-CNN / YOLO-seg family) for dense, overlapping piles
  • Trained on QA-labelled flakes from your plant; stratified k-fold cross-validation
  • Per-class precision / recall and confusion matrix reported before go-live
  • Calibrated probabilities (isotonic regression) → each flake carries a confidence score

Rules stay as guard-rails: the model can never call a 40 mm fused cluster "Small".

The same design accepts the trained model as a drop-in upgrade
Stage 08 · Statistical inference In POC

How confident is a batch number?

A grade share is an estimate from a sample. We report it with a Wilson score 95% interval — correct even for rare grades near 0%.

p̂ ± … = [p̂ + z²/2n ± z√(p̂(1−p̂)/n + z²/4n²)] / (1 + z²/n)
Grade (n = 660)Estimate95% interval
Pure68.0%64.4 – 71.5%
Small9.7%7.7 – 12.2%
Hard8.5%6.6 – 10.9%
Unpolished7.9%6.1 – 10.2%
Joint5.2%3.7 – 7.1%

Sample-size planning

n = z² · p(1 − p) / E²

To know Pure (≈61%) within ±3 points at 95% confidence: n ≈ 1,015 flakes → about two trays per batch. Within ±4 points: ≈ 571.

Count → weight

Lab grading is by weight. Per-grade mean flake mass (from your weigh-method calibration) converts count shares into weight shares.

Accept / reject as a test

Reject only when the interval — not just the point estimate — crosses your limit. Fewer false rejections of good batches.

Intervals computed from the 660-flake sample
Reliability engineering

Deterministic, auditable, and on-site

In POC

Determinism

key = SHA-256(image) ∥ pipeline_version

The same image always returns the identical result — verified by repeat uploads. Results only change on a deliberate, versioned upgrade.

In POC

Full audit trail

Every flake is logged: id, coordinates, length, width, solidity, circularity, L*a*b*, the rule that fired and the engine version — exportable as CSV / JSON for QA records.

Production

Edge inference

  • Model exported to ONNX, accelerated with TensorRT on the station GPU
  • FP16 / INT8 quantisation for low latency
  • Target: full tray graded in seconds
  • Zero network egress — no cloud, no internet
Continuous improvement loop

Low-confidence flakes are queued for QA review → confirmed labels feed periodic retraining → each new model is validated against a held-out set and released as a new pipeline version, with drift monitoring on the grade mix.

FlakeGrade · Svayou
Part 3

Delivering it on-site

The capture station, the honest state of play, and the path to production.

On-premise architecture

Your data never leaves the plant

Inside your plant

Camera + lighting

Fixed above the sample tray

›

Edge PC (GPU)

FlakeGrade model & app

›

Touchscreen

One-click Scan → report

Local quality log

Every report stored on site

No cloud

  • No internet needed to grade
  • Images never leave site
  • Your data never trains outside models
  • No per-scan fees
FlakeGrade · Svayou
Capture station · for your procurement

What to buy

ComponentSuggested specificationIndicative ₹
Edge PCIntel i5/i7, 16–32 GB RAM, 512 GB SSD, NVIDIA RTX 4060 (8 GB) — or Jetson Orin NX 16 GB85,000
CameraIndustrial USB3 machine-vision camera, ~12 MP colour35,000
LensFixed focal-length C-mount, matched to working distance10,000
LightingDiffused LED ring / bar rig, shadow-free12,000
StandAdjustable overhead copy stand — fixed camera height10,000
Touchscreen21–24″ (or an existing PC + monitor)16,000
Tray, colour card & UPSMatte uniform tray, reference colour/scale card, small UPS7,000
Indicative total — procured directly by you~1,75,000

Indicative retail estimates, not billed by Svayou. We confirm exact models before purchase, then install and calibrate the station.

FlakeGrade · Svayou
An honest read

Where it stands today

Working now
  • Every flake detected, split and counted once
  • Per-flake size, shape and colour measurement
  • Robust on shape/size grades: Pure, Joint, Small
  • Grade-coloured overlay + per-flake report & CSV
  • Identical result for identical image
To reach full accuracy
  • Fine colour grades (Embryo, Unpolished, Broken) need the station's resolution, fixed light and colour card
  • Exact mm needs a reference of known size in frame
  • A short QA labelling session trains the colour-grade model
  • Calibrate count → weight against your weigh-method

None of these are dead-ends — they are capture and data steps that the on-site station resolves.

FlakeGrade · Svayou
Phased, low-risk

Path to production — 8 to 10 weeks

Done

Proof of concept

Engine, per-flake report and overlay — validated on your samples.

Weeks 1–3

Install & calibrate

Station set up; lens, flat-field, colour and mm scale calibrated; QA labelling.

Weeks 3–7

Train & validate

Colour-grade model trained on your labels; thresholds tuned to your rule.

Weeks 7–10

Go live

On-site acceptance test against the weigh-method, staff training, go-live.

Later, optional: an in-line camera over the conveyor for continuous, real-time accept / reject — the same engine, applied to the moving belt.

FlakeGrade · Svayou
To move forward

What we need from Bhagyalakshmi

Your accept / reject rule

e.g. reject if Pure < X% or Broken > Y%.

QA labelling session

Your QA team confirms grades on a set of sample photos.

Weigh-method results

Physical weigh figures for a few batches, to calibrate count → weight.

Reference size

Tray dimensions or a calibration marker for exact millimetres.

Location & throughput

Where the station sits, and samples per shift.

Hardware procurement

Capture station to our spec — we install and calibrate.

FlakeGrade · Svayou
Investment & next steps

One-time build, no running cloud cost

₹3.5 L + GST

FlakeGrade software — on-prem model, capture-station app, calibration & deployment

~₹1.75 L

Capture-station hardware — procured directly by you (indicative)

₹0

Cloud hosting and per-scan fees — everything runs on site

Next steps

  1. Confirm scope and your accept / reject rule
  2. Schedule the QA labelling session
  3. Procure the station to spec — live in 8–10 weeks
Svayou · svayou.ai
Keys
→ / Space / PgDn — next
← / PgUp — previous
Home / End — first / last
F — fullscreen   N — speaker notes
Print (⌘P) — one slide per page → PDF