Blog · What the machine sees
Soybean: from the pod to the class of each seed
Brazil's largest grain crop starts in a hairy pod with two or three seeds. What an image shows of soybean, from the hilum to size, with 12,687 seeds measured.
November 3, 2026 · 8 min read · by Enrico S. Ambrosio
Soybean is Brazil's largest grain crop. For the 2024/25 season, Conab estimated 171.5 million tonnes harvested from 47.4 million hectares. All of it starts in a small, hairy pod with two or three seeds inside.
The animation above is a simulation. The pod ripens, dries, opens along its seam and releases the seeds. In this post we look at soybean the way a camera does: from the pod to the size, hilum and class of each seed. And we measure 12,687 real seeds.
From China to the Cerrado
Soybean (Glycine max) comes from northeastern China, where its cultivation is recorded between 1100 and 841 BC. From there it went to Korea and Japan. The Japanese agricultural encyclopedia Seikei Zusetsu, from 1804, already drew the plant with its pods hanging from the stem, just as they appear in the field today.


In Brazil, the first record dates from 1882, with Gustavo D'Utra in Bahia, and it did not work out. The cultivars of the time came from temperate climates. Soybean took hold in Rio Grande do Sul, with the first commercial plantings in 1924. Later, Brazilian research bred cultivars with a long juvenile period, which flower later when days are short, and the crop moved north into the Cerrado. Today it is grown in practically every state.


The pod
The soybean flower is small, white or purple depending on the cultivar, and each flower that sets becomes a pod. The green pod is covered in hairs, which can be gray or brown. When the plant matures, the pod dries, turns straw-colored and opens along the seam, the line where its two halves meet.
Inside, there are usually two or three seeds. Pods with four exist, but they are rare. Each seed is attached to the pod by a thin cord, the funiculus. When it comes loose, it leaves a scar on the seed coat. That is the hilum.


What you can see on a seed
Seen from above, a soybean seed is almost round, a little longer than it is wide. The seed coat is usually yellow, but there are soybeans with green, brown and black seed coats. And there is the hilum, whose color changes from one cultivar to another.
Hilum color is one of the descriptors used to characterize soybean cultivars. It can be black, imperfect black, brown, light brown, gray or yellow. In purity analysis, the hilum helps find cultivar mixtures in a seed lot. An Embrapa document on the subject warns that heat and drought while the seed forms change the shade of the hilum, so color alone is not proof.

In a photo, the hilum only shows if the seed lands on its side. Lying flat, it hides the scar. To read the hilum of a seed lot, it is worth taking two photos and turning the seeds over in between.
12,687 real seeds
To measure size, we used a public dataset from Indonesia with three local varieties, Anjasmoro, Dega I and Grobogan (Syahraza et al., 2025, CC BY 4.0). There are 119 scans at 800 dpi, each with about a hundred seeds in a grid on a gray background. We outlined the seeds by color, as SeedCounter does, and measured the length and width of each one.
Anjasmoro is the smallest, with a mean length of 8.11 mm and a width of 6.50 mm. Dega I and Grobogan are almost tied, at 8.56 and 8.51 mm. In the histogram, the Anjasmoro curve stands apart, and the other two sit on top of each other. Size separates one variety, but not all three. To tell Dega I from Grobogan, the image would need another clue.
The scale came from the dpi the scanner writes into the file. On a flatbed scanner that number is usually right, as we checked in the post The DPI declares, the ruler measures. The width of the scan agrees too: 6,800 pixels at 800 dpi come to 21.6 cm, the bed width of a common scanner.
The shadow inside the mask
The dataset already comes with each seed cut out, with a ready-made mask. We compared the two measurements. The dataset mask includes the gray penumbra around the seed. With it, the mean length comes out 8 to 9% larger than with the color outline, and the area 18 to 20% larger. For Anjasmoro, that is 8.82 mm versus 8.11 mm.

Anyone who trains a model on these masks teaches it that the shadow is part of the seed. For counting, it makes no difference. For measuring, it makes a difference of about 0.7 mm in length. The post Light decides the outline shows where that shadow comes from.
Measuring isn't enough: what is each seed?
Counting says how many. Measuring says how big. The next question is the quality of each one. Another public dataset, by Lin et al. (2023), sorts soybean seeds into five quality classes. The figure brings together 23 of them, with the outlines and classes of the original annotation: 5 whole, 5 broken, 5 immature, 5 with a damaged seed coat and 3 stained.

- A whole seed has no visible defect.
- A broken one has lost a piece, usually from mechanical damage at harvest or processing.
- An immature one stayed greenish because it did not finish maturing.
- A seed with a damaged seed coat has a ruptured, cracked or wrinkled coat, and the embryo is more exposed.
- A stained one has spots on the seed coat. The cause can be fungus, insects or weather, and the image alone doesn't say which.
The Indonesian scans also show seeds with cracked seed coats, some of them in the animation above.
Where the image misleads
Look at the figure closely and some of the boundaries seem debatable. Some seeds marked as damaged seed coat look like a broken fragment. Whole and immature seeds have similar tones, and the color difference depends on the light and on the camera's white balance. A gray card in the scene helps compare photos.
Dataset classes and the categories of a standard don't always match either. In the purity analysis of the Brazilian Rules for Seed Testing, a piece larger than half a seed still counts as pure seed. In a quality dataset like this one, the same piece goes in as broken.
Annotation is a proposal too. Whoever annotated decided each boundary, and someone else could decide differently. A model trained on these labels learns those decisions along with the seeds, just as it learns the shadow in the mask.
In SeedCounter, the class is yours
In the app, you use viable and non-viable or define the classes of your protocol, and mark or change each seed's class. When the machine proposes a class, the proposal appears first and only becomes data once you've checked it. The count by class comes out with percentages, and each seed keeps the number that leads back to the image, along with its length and width. In the app, it looks like this.
Got a photographed or scanned plate of soybean? Open it in SeedCounter, measure the seeds and set up the classes of your protocol. For viability by tetrazolium, also read Red embryos breathe.
Sources
- Conab, 12th survey of the 2024/25 season, with 171.5 million tonnes of soybean on 47.4 million hectares. Safras & Mercado (in Portuguese)
- Soja: do nordeste da China ao grão dourado do Brasil, on the origin, the 1882 record and the plantings in Rio Grande do Sul. Agrolink (in Portuguese)
- Bonato, E. R. (2003). Cor do hilo em sementes de soja. Embrapa Trigo, Documentos 38. Embrapa (in Portuguese)
- Seeds per pod, two or three in most, four or five rare. Farm Progress
- Syahraza et al. (2025), soybean seeds of three Indonesian varieties, Mendeley Data, doi:10.17632/c733bjz4m3.3, CC BY 4.0. The 12,687 measurements are in soja-indonesia-medidas.csv, and the scripts in
_src/real/soja/. - Lin et al. (2023), Soybean Seeds, Mendeley Data, doi:10.17632/v6vzvfszj6.6, CC BY 4.0.
For the full math: When the line hides a class, on how to classify three or more classes.


