At the edge of a microscope image, two round structures on a cannabis flower overlap. A person tracing them has to decide where the first outline ends and whether enough of the second remains visible to count. A machine trained to recognize these structures inherits that decision. Before anyone writes down a count for the flower, somebody has already made hundreds of small judgments about what qualifies as one gland.
Drawing the objects a computer will learn
The glands are called glandular trichomes. On the bracts, the small leaflike structures associated with a female flower, some have conspicuous heads on stalks. Others sit closer to the surface or are small enough to be easily overlooked. Their shapes matter to botanists. Microscopy of developing cannabis flowers has connected differences in trichome form with differences in their secretions. Combining every visible dot into a single tally would throw away some of the information the microscope provides.
In a study published in The Plant Journal, researchers built a detector using manually labeled scanning electron microscope images. The input dataset contained 1,749 images annotated for three forms: bulbous, sessile and stalked glands. On each image, tracing a boundary supplied more information than placing a dot in the middle of a round head. It gave the computer examples of both the object and the surface immediately beyond it.
The team adapted Mask R-CNN, an image-analysis method that can locate an object and outline the pixels belonging to it. Its output can distinguish two neighboring glands of the same kind, as long as the image contains enough evidence to separate them. A colored overlay lets a researcher compare the proposed boundaries directly with the underlying micrograph. A total at the bottom of a spreadsheet cannot show why a count came out wrong.
Two wrong marks can make a right total
Imagine a human annotator has marked twenty glands. The computer marks twenty too. On inspection it has missed a small gland tucked against a larger one and mistaken an unrelated bump elsewhere for a gland. The totals agree perfectly. The two mistakes only become apparent when someone asks whether the marks coincide in space and whether the names assigned to the objects agree.
Researchers call the fraction of a detector’s marks that are genuine its precision. Recall asks what fraction of the genuine objects it managed to find. A detector that marks only the clearest circles might have excellent precision while overlooking many glands. Average precision summarizes how precision and recall relate as the threshold for accepting a prediction changes. A value expressed as a percentage on this scale should not be read as the percentage of flower samples that received exactly the right count.
What happened on fresh images
The team reserved 170 scanning electron microscope images for an independent test. For the boxes locating each object, average precision reached 81 percent for sessile glands, 64 percent for stalked glands and 45 percent for bulbous glands. A single score for the whole system would have concealed how much harder one class was to identify. The authors also described overlapping glands in dense groups as a continuing difficulty.
For a study of flower development, that unevenness has a biological consequence. If later images are more crowded, the fraction of glands the detector misses could grow as the flower matures. A flat stretch on a graph of gland counts would then deserve a second look under the microscope. Examining errors by gland type and by the density of the surrounding tissue would help a researcher decide whether a plateau belongs to the plant or to the detector. Independent images also need careful interpretation when the question shifts to differences between plants. Ten pictures of a single bract offer ten views of one specimen. A comparison of plant populations needs independently sampled plants as well.
The most informative picture in such a test may be the awkward one with two overlapping heads at the margin. A perfectly isolated gland tells us what the system recognizes easily. The crowded image shows exactly where a count still depends on an observer willing to look twice.