7 min read · Machine vision

A handful of milled rice contains whole kernels, broken kernels, chalky kernels, yellow kernels and other debris mixed together. A person can count them by eye, but slowly, and each person counts differently. A camera can count what it sees using the same rules every time, but rice quality does not lie in what can be seen alone.
The examples in this article are hypothetical. All figures are made up to explain the reasoning. They are not results from a real rice mill or a customer project.
What a camera can check and what must go to the lab
Thai agricultural commodity standards separate the inspection items clearly into two groups. One example is the Thai Hom Mali Rice standard (TAS 4000-2560), issued by the National Bureau of Agricultural Commodity and Food Standards (ACFS). The first group is kernel characteristics that can be seen by eye, such as whole kernels, broken kernels, discoloured kernels, damaged kernels, chalky kernels and foreign matter. The second group is properties that need analytical methods, such as moisture, amylose content and aroma.
| Item | Checked with | Note |
|---|---|---|
| Whole and broken kernels | Camera | Count kernels or measure kernel length from the image. Kernels must not overlap |
| Chalky kernels | Camera | In the standard above, this means kernels with a chalky white area as defined. Needs lighting that separates the chalky area |
| Discoloured or yellow kernels | Colour camera | Needs reference colour samples and controlled lighting |
| Visible foreign matter | Camera (partly) | Debris with a colour and shape similar to a kernel may be missed |
| Moisture | Moisture meter or lab | An ordinary camera cannot see it |
| Amylose content | Lab | Needs a chemical analysis method |
| Cooking quality | Lab or a cooking test | Needs actual cooking and evaluation |
| Aroma | Sensory test by trained panellists, or the lab | A camera cannot tell aroma |
The example above refers only to the Hom Mali rice standard. Other rice types have their own criteria and test methods, and standards may be revised. Check the latest version from ACFS or your buyer's specification before real use. This article does not state any figure as a mandatory criterion.
How to use a camera in a mill or test room
- Agree with the buyer what criteria and counting method apply to the visual items (broken kernels, chalky kernels, colour, foreign matter).
- Set up the imaging point so kernels are spread out and do not overlap, for example with a dark tray or a thin layer on a belt.
- Use a light box so the lighting is the same every time, and take several images per sample if there are many kernels.
- Have the system count kernels by type and show an image with coloured boxes marking each type, so an inspector can look back over it.
- Send samples from the same lot for moisture measurement and lab tests, for the items you need.
- Record the camera results and the lab results against the same lot number.
The camera counts kernels, but the standard may count weight
One thing to watch: a camera usually counts kernels, but the standard or the buyer's criteria may be percentages by weight. A broken kernel is lighter than a whole one, so a percentage by count is not the same as a percentage by weight. Agree the counting method with the buyer, and run a trial comparing camera results against kernels that people have sorted and actually weighed, to see how large the difference is.
Hypothetical example: a 500-kernel sample
Suppose the camera counts kernels from one sample of 500 and finds 430 whole kernels, 50 broken kernels, 12 chalky kernels, 5 discoloured kernels and 3 foreign kernels or pieces. Check the total: 430 + 50 + 12 + 5 + 3 = 500, which matches the sample size.
- Whole kernels 430 ÷ 500 = 86%
- Broken kernels 50 ÷ 500 = 10%
- Chalky kernels 12 ÷ 500 = 2.4%
- Discoloured kernels 5 ÷ 500 = 1%
- Foreign matter 3 ÷ 500 = 0.6%
The percentages add up to 86 + 10 + 2.4 + 1 + 0.6 = 100, covering the whole sample by kernel count. The moisture and amylose of this lot are still unknown from the camera and must wait for the meter and lab results. Suppose the moisture meter reads 13.8% and the lab reports amylose of 16.2%. These values must be kept with the same lot, and the grade decided by the criteria agreed with the buyer, not by the camera result alone.
Common mistakes
- Using the camera result to describe overall rice quality, when the camera cannot see moisture or aroma
- Applying Hom Mali criteria to other rice varieties without checking that variety's standard
- Letting kernels overlap while imaging, which causes miscounts
- Comparing a percentage by count with a criterion that is a percentage by weight, without checking
- Keeping camera results and lab results separately, so they cannot be matched back to a lot afterwards
- Not reviewing the system when the rice variety or harvest season changes
Keeping results paired with the lot number relates to lot traceability. See the article on Lot Traceability.
Limitations and cautions
A camera can check only the visible characteristics of rice kernels. It does not know moisture, amylose, cooking quality or aroma, which need instruments or a lab. For grading and certification against a standard, consult the relevant agency or your auditor. All figures in this article, such as the 500-kernel sample, the counts of 430, 50, 12, 5 and 3 kernels, the calculated percentages, the moisture of 13.8% and the amylose of 16.2%, are hypothetical examples to explain the reasoning. They are not results from a real BT San project, not criteria of any standard, and not values you should expect.
Starting references
- TAS 4000-2560 Thai Hom Mali Rice (copy of the document on alro.go.th)
- Wikipedia — Amylose
- Wikipedia — Moisture analysis




