The journal

Useful computer vision starts with a better dataset

Why image preparation, annotation rules and validation deserve attention before the next model experiment.

A computer vision project can make the model feel like the main event. It has a name, a training process and results to inspect. The dataset is less visible, but it shapes what those results mean.

In freelance agricultural image annotation work, I worked with preparation, tiling, labeling and validation. The workflow involved Python, OpenCV, CVAT and COCO data, alongside assisted approaches using SAM, YOLO and PyTorch. Working across those stages gives you plenty of reasons to look closely at the data before changing the model.

Write the annotation rules down

An annotation is a decision about what matters in an image. That decision should be understandable to the next person who opens the dataset.

Define the classes and explain the boundaries between them. Include examples of partial objects, overlap, unclear edges and images where no target is present. For segmentation work, describe what a mask should include and what should stay outside it.

Keep uncertain cases somewhere reviewers can find them. A small collection of difficult examples can help expose a rule that needs more explanation. Resolving that rule once is more useful than asking every annotator to improvise.

Treat preparation as part of the dataset

Resizing, cropping and tiling change the view of an image. They also affect coordinates, masks and the context available to a model.

Keep track of how an output image relates to its source. If you create tiles, preserve the information needed to locate them in the original image. Check what happens to an annotation that crosses a tile boundary. A preparation script should make those choices deliberately, so the same inputs can be processed consistently later.

It also helps to keep original files separate from generated files. That gives you a clear starting point when a preparation decision needs to change.

Validate the structure and look at the images

A file can be valid JSON while still describing the wrong annotation. Both programmatic checks and visual review have a role.

For COCO data, inspect relationships between images, annotations and categories. Check for references to missing images, unexpected class identifiers and coordinates outside the image dimensions. Confirm that the exported files can be read by the next stage of the workflow.

Then overlay a sample of the annotations on their images. Look at different classes and difficult cases, rather than only the cleanest examples. Visual review can reveal an offset mask, an incorrect scale or a labeling convention that a structural check would miss.

Give assisted labels a review step

Tools such as SAM and YOLO can participate in an assisted annotation workflow. Their output still needs to be checked against the project’s rules.

Keep the distinction between a suggested annotation and an accepted annotation clear. Decide who reviews suggestions and how corrections are recorded. That makes it easier to understand where an annotation came from and whether it has passed the same checks as the rest of the dataset.

Make the handover understandable

A useful dataset includes more than images and labels. Add the class definitions, preparation steps, export format and known limitations. Keep versions identifiable so later experiments can be tied to the data they used.

These habits do not guarantee a particular model result. They make the inputs easier to inspect and the work easier to repeat. When an experiment behaves unexpectedly, a well-documented dataset gives you a firmer place to begin investigating.