Deciding what constitutes a class is the first operation of a weed detection project, and it is the one that determines everything after. A badly divided corpus is not corrected by a better model.
This article sets out how to build a nomenclature of weeds and crops, the traps in that construction and the decisions that must be written down. It extends the guide to weed detection.
What a class actually denotes
A founding confusion weighs on weed detection projects. It deserves clearing before any construction. An annotation class is not a botanical category. It is a category of decision: it groups what the downstream system will treat in the same way. Three consequences follow. Two botanically distant species belong to the same class if the weeder treats them identically. One species can belong to two classes if its development stage changes the treatment to apply. And a legitimate botanical category may have no existence in the nomenclature if no decision depends on it. One important practical consequence follows. The nomenclature is built starting from downstream, from what the machine will do with the information, and not from a local flora transposed into a list of classes.The four levels of granularity
This gradation structures the choice of a weed detection nomenclature. Each level carries its own cost and use. The binary level sets the crop against everything else. Two classes, an economical corpus, no botanical competence required to annotate as soon as the crop is recognisable. The functional level separates weeds by their response to treatment, typically grasses and broadleaves. Three classes, elementary botanical competence, information usable for a product choice. The generic level identifies the main problem genera of a given crop. Five to ten classes, real botanical competence, information sufficient for most selective treatment programmes. And the specific level names each species. A variable count, often above fifteen, expert competence, information finer than most treatment systems can exploit. One important observation follows. Cost does not grow linearly with the number of classes: it grows with the difficulty of distinction, and moving from the functional to the generic level costs more than adding several easy classes at that generic level.The minimum level rule
One design principle applies and it is regularly breached. Adopt the coarsest level of granularity that still permits the intended decision. Three reasons justify it. Each additional class costs at annotation, at checking and in degraded performance on neighbouring classes, a fine distinction consuming part of the model’s capacity. Each additional class multiplies the edge cases, two neighbouring classes creating a boundary annotators will have to settle thousands of times. And a rare class is poorly learned, a low count in the corpus producing unusable performance on precisely that class. One practical consequence follows for a weed detection project. A nomenclature carrying classes no decision uses is not a rich nomenclature, it is one that costs more and performs worse.The count threshold
A statistical constraint bounds the achievable fineness. It is often discovered too late. A class must appear often enough in the corpus to be learned, failing which it exists in the nomenclature and not in the model. Three situations produce underrepresented classes. The species is genuinely rare in the area covered, which questions its interest in the nomenclature. The species is frequent but the image sampling did not encounter it, a coverage defect rather than a nomenclature one. And the species is frequent at one stage and absent at another, which produces a partially learned class. One practical answer follows. Count the numbers per class on a first batch before fixing the nomenclature, then merge classes that are too rare rather than keeping them out of a concern for exhaustiveness, an operation costing hours and avoiding a corpus part of which is unusable.The boundaries that cause trouble
Five boundaries produce most of the disagreement between annotators in weed detection. They must be settled in writing. The boundary between the crop and a volunteer from the previous crop, botanically identical to a crop plant and agronomically undesirable. The boundary between two close weed species at the cotyledon stage, where the morphological distinction is not yet established. The boundary between a weed and a cover or margin plant, present deliberately and not to be destroyed. The boundary between a plant and a plant fragment, an isolated leaf visible in the image belonging or not to the object to annotate. And the boundary between a living plant and plant residue, stubble or a desiccated plant potentially presenting a misleading colour and shape. One important observation runs across those five boundaries. The first is the most expensive and the most neglected: an oilseed rape volunteer in a cereal is visually an oilseed rape plant, its qualification depends entirely on the cropping context, and no convention follows from the image alone.The case of development stages
This dimension doubles a nomenclature’s complexity and it is frequently omitted. One plant changes appearance to the point that an annotator may not recognise it as the same species at two stages. Three treatments are possible. Ignoring the stage, one class per species whatever the size of the plant, which produces a class with very high internal variability. Separating by stage, one class per species and stage pair, which multiplies the counts to cover and yields information usable for choosing the intervention window. And bounding the corpus to a window of stages, which simplifies annotation and restricts the system’s domain of use. One practical consequence follows. The third treatment is most often the right one, the agronomic intervention window being itself bounded, and it simply requires that this bound be documented rather than suffered.The technical classes
Four classes have no botanical existence. They are nonetheless indispensable to a weed detection corpus. The undetermined object class, for plants the annotator cannot qualify with certainty, which prevents them settling at random. The unusable zone class, for image portions that are blurred, overexposed or obstructed. The dense zone class, where the convention adopted handles weed mats separately. And the non-plant element class, stones, debris and equipment, which appear in the field and which the model must learn to ignore. One observation follows. The first of these classes is the most useful and the most counterintuitive: offering an annotator the possibility of declaring uncertainty produces a cleaner corpus than requiring a decision on every object, and the volume of that class is moreover a quality indicator for the reference itself.Nomenclatures by crop type
Three crop families call for different constructions and they are worth distinguishing. Wide-spaced row crops, maize, beet and sunflower notably, permit a simple nomenclature because row information does part of the work and because the crop is morphologically distant from most weeds. Small-grain cereals pose the inverse difficulty, grass weeds sharing the crop’s morphology to the point that the distinction rests on details few annotators perceive without dedicated training. And dense or spreading crops, whose canopy closes rapidly, impose a narrow stage window beyond which weeds become invisible. One practical consequence follows for a weed detection project. The second family is where the achievable level of granularity is lowest, and where the temptation of a fine nomenclature most reliably produces an incoherent corpus.Documenting a nomenclature
Six elements compose a usable nomenclature document and the absence of the last three makes it inoperative. The list of classes with a one-sentence definition each. The visual recognition criteria for each class, stated in observable terms. The stages covered and the stages excluded. The reference images, several per class and covering the variability encountered. The settled edge cases, with the image, the decision and its reason. And the counter-examples, a neighbouring configuration receiving a different decision and whose comparison sharpens the rule. One practical consequence follows for a weed detection project. This document is built with an agronomist on a real first batch, it is not drafted in advance in a meeting room, and its initial version is always incomplete, which makes updating it during production normal rather than exceptional.Measuring whether the nomenclature holds
Four verifications establish in a day whether it is workable. Disagreement between two annotators on the same sample, measured class by class, which locates the badly defined boundaries. The volume of the undetermined class, a high value signalling an insufficient reference rather than a lack of competence. The counts per class, which reveal the classes condemned to be poorly learned. And the matrix of confusions observed between annotators, more informative than a global agreement rate since it indicates which pairs of classes cause trouble. One important observation follows. This verification is conducted on a sample before production starts, and its cost bears no relation to that of a re-annotation discovered halfway, which matches the finding the preceding series established on the asymmetry between prevention and correction.What the nomenclature determines downstream
Three things depend on this choice in a weed detection project. They are not recoverable afterwards. The corpus cost, which varies by a substantial ratio between a binary and a species nomenclature. The system’s domain of use, a nomenclature bounded to certain crops and stages producing a system bounded the same way. And corpus reusability, a fine nomenclature being aggregable to a coarse one where the reverse is impossible. That third dependency deserves emphasis because it qualifies the minimum level rule. A finely annotated corpus can serve a coarse use by simply merging classes, where a binary corpus is only refined by complete re-annotation. One practical consequence follows. Where several uses are anticipated in the medium term and the budget permits, annotating one level finer than the immediate need is a defensible investment, provided that additional level concerns distinctions annotators can make reliably.Changing a nomenclature mid-project
One frequent situation deserves treating, an initial nomenclature regularly proving incomplete after a few batches. Four modifications are possible and they do not carry the same cost. Adding a technical class, undetermined or unusable zone, an operation with no retroactive cost since it does not question existing annotations. Merging two classes, an inexpensive and retroactive operation, the aggregation being done by automatic processing on batches already produced. Splitting a class, an expensive operation imposing a review of every object of the original class in earlier batches. And modifying a boundary between two existing classes, the most expensive operation since it imposes reviewing objects of both classes across the whole corpus. One important observation follows. That asymmetry argues for an initial nomenclature that is rather fine on reliable distinctions and rather coarse on doubtful ones, since merging is cheap and splitting is not.The case of the plant to protect
One category escapes the binary logic and its omission produces irreversible damage. Some plants present in the field are neither the crop nor a weed: they are there deliberately and must survive the implement’s pass. Four situations bring it up. Cover crops sown between rows, whose destruction cancels the service sought. Flower strips and margins, protected by agri-environmental commitments. Intercropping, two species sown together one of which could be taken for a weed. And companion plants deliberately maintained, whose presence belongs to an agronomic choice documented at field level and not visible in the image. One practical consequence follows for a weed detection project. Those four situations require a dedicated class rather than attachment to the crop, since the treatment applicable to them differs, and their omission produces exactly the kind of error that discredits a system with a grower.What the nomenclature will not settle
Three difficulties persist whatever the quality of the division adopted. The physical ambiguity of some images, a plant too small or too blurred remaining undecidable for an expert as for a model, which the undetermined object class acknowledges without resolving. Dependence on the cropping context, one plant being a weed or not according to the field, information that is not in the image and that no class can carry. And regional variability of the flora, a nomenclature suited to one region producing empty classes and gaps elsewhere. One observation follows. Those three limits are not addressed by further refinement, they are addressed by documenting the domain of use, which matches the finding this series on weed detection stated in the pillar article about the absence of transfer between contexts.A defensible starting nomenclature
A concrete starting point is worth more than a principle, and this one suits the majority of first projects. Five classes compose it. The crop, the target class whose recognition is most reliable and which carries most of the volume. The weed, a single class grouping everything to be treated in the same way. The plant to protect, where covers, margins or intercrops are present. The undetermined object, for what the annotator cannot qualify. And the unusable zone, for image portions the acquisition conditions rendered illegible. One observation follows for a weed detection project. This nomenclature is annotated without advanced botanical competence, it produces a coherent corpus from the first batch, and it is then refined where the disagreement measurement has shown the distinction to be reliable, which is the reverse of the order most projects adopt.Approaching the construction of a nomenclature
Five questions produce a defensible nomenclature and they are asked with the end user. Which distinct decisions will the system trigger. The number of distinct decisions bounds the useful number of classes. Which species are actually present in the area and crop targeted. A theoretical flora produces empty classes. Which window of stages is concerned. That answer bounds the variability to cover. Which plants must on no account be destroyed. That question surfaces the covers, margins and intercrops the nomenclature must protect. And what competence is available to settle doubtful cases. Its nature determines the level of granularity achievable. Those five answers produce a list of classes rather than a range. Asking them before annotating avoids this field’s commonest error, building the nomenclature from an available botanical reference rather than from the use.What this chapter teaches
One cross-cutting observation deserves closing this examination because it holds beyond this field. Building a nomenclature is an operation of design and not of description. Three findings compose it. It starts from the downstream decision, not from observable biological reality. It trades fineness against reliability, each additional distinction costing in consistency what it brings in information. And it is validated by measuring disagreement between annotators, the only proof that a boundary is operational rather than theoretical. That finding matches exactly the one the series on satellite image segmentation established about land cover nomenclatures, in a thematically unrelated domain, which suggests a general property of any supervised classification task.Who should own the nomenclature
One organisational question decides more than the technical choices above, and it is rarely asked explicitly. A weed detection nomenclature sits between three parties who each have a legitimate claim to it. The agronomist knows what is botanically distinguishable and what the plants do in the field. The engineer knows what the model can learn and what the treatment system can act on. And the annotation provider knows what can be applied consistently across thousands of images by people who are not botanists. Three failure patterns follow from letting any one of them decide alone. An agronomist-owned nomenclature tends to be botanically correct and operationally unworkable, carrying distinctions no annotator applies consistently. An engineer-owned nomenclature tends to be convenient for the model and disconnected from what the grower needs distinguished. And a provider-owned nomenclature tends to be easy to annotate and to omit the distinction the whole project existed to make. One practical consequence follows. The nomenclature is settled in a meeting with all three present, it takes an afternoon, and skipping that meeting is the most reliable way to discover the problem after several batches have been annotated.Common mistakes
These failures recur often enough that naming them is usually enough to avoid them.- Building the nomenclature from a botanical reference rather than from the use.
- Adopting a level of granularity beyond what the decision requires.
- Fixing the nomenclature before counting the numbers per class on a first batch.
- Keeping a class that is too rare out of a concern for exhaustiveness.
- Omitting the boundary between crop and volunteer from the previous crop.
- Not documenting the stages covered and the stages excluded.
- Omitting the undetermined object class.
- Omitting the unusable zone class.
- Drafting the nomenclature in a meeting room rather than on a real batch with an agronomist.
- Measuring a global agreement rate with no confusion matrix between annotators.
- Neglecting the plants to protect, covers and margins notably.