How AgriVision works
AgriVision is a direct farmer-to-buyer marketplace. Four AI modules sit behind the screens and do the work an agent or commission agent would otherwise do — grading the produce, fixing a fair price, judging demand and checking the paperwork.
1 · Crop quality grading (computer vision)
When a farmer uploads photos of a lot, OpenCV separates the produce from the background and measures four independent attributes:
- Colour — how much of the produce falls inside the healthy hue range for that crop, and how vivid it is.
- Uniformity — circular standard deviation of hue; a consistent lot grades higher because buyers pay for consistency.
- Defects — dark-spot and bruise ratio found by adaptive thresholding inside the produce mask.
- Size — contour analysis of individual units and how consistent they are.
These are fused into a 0–100 score and a Grade A / B / C verdict. A blurred or badly lit photo caps the score instead of inflating it, and the farmer is told to re-shoot.
2 · Price recommendation
The suggested price starts from the median modal price of the last 45 days in the farmer's own district and is then adjusted by four multiplicative factors:
price = district_base_price
× grade_factor (A +18%, B 0%, C −18%)
× season_factor (lean-supply month +12%, harvest glut −12%)
× demand_factor (from the demand index)
× premium_factor (organic +15%, verified certificate +8%)
Every factor is shown to the farmer with its reason, so the number is never a black box. The band width comes from that crop's historical volatility — wide for tomato, narrow for wheat.
3 · Demand prediction
A 0–100 demand index fuses four independent signals:
- Price momentum — last 30 days against the 90 days before.
- Supply pressure — falling mandi arrivals with firm prices means tight supply.
- Season — the crop's own lean/glut calendar.
- Marketplace pull — open buyer requirements against available listings on AgriVision itself.
A least-squares trend over the weekly means, modulated by seasonality, gives a six-week price forecast with a widening confidence band.
4 · OCMR certificate verification
OCMR — Optical Certificate & Mark Recognition — is the six-stage pipeline that reads a quality certificate and decides whether to trust it:
- Image preparation: denoise, deskew, adaptive binarisation.
- Tesseract OCR with per-word confidence.
- Field extraction by regular expression — number, issuer, dates, holder, crop, grade.
- QR / barcode detection and cross-check against the printed number.
- Error Level Analysis to flag digitally edited documents.
- A ten-check rule engine producing a confidence score.
Expired certificates, wrong-crop certificates and unreadable scans are rejected outright; borderline cases are queued for manual review rather than silently passed.