Hero image with a blue-green gradient and large white title: 'Synthetic-to-Real Perception Part 1 Generating Synthetic Crop and Weed Images with NVIDIA Isaac Sim'

Generating Synthetic Crop and Weed Images with NVIDIA Isaac Sim

From the series Synthetic-to-Real Perception on NVIDIA Jetson
by Konsulko Group Software Engineer Andjela Danilovic Nedic

Training a crop-and-weed detector requires labeled images that capture the variation a camera encounters in the field. Plants change shape as they grow, weeds appear at different sizes, and soil and shadows affect how clearly leaves can be distinguished from the background. Collecting and annotating examples across these conditions can become a substantial part of developing a perception system.

In this Konsulko project, we investigated synthetic data as part of an agricultural perception pipeline, from generating training images to deploying a detector on NVIDIA Jetson. Using NVIDIA Isaac Sim, we built a configurable scene containing sugar beet plants, weeds, and soil, and generated images together with their bounding-box annotations.

This first article explains how the scene was assembled, how variation was introduced, and how the generated outputs were checked. Part 2 will cover model training and evaluation on real images. Part 3 will follow the trained model onto Jetson using TensorRT, DeepStream, and ROS 2.

Defining the dataset requirements

The detection task has two classes: sugar beet plants, labeled crop, and unwanted plants, labeled weed. Although several weed types appear in the scene, they share one detection class. The objective is to distinguish crops from weeds rather than identify each weed species.

Real agricultural images from the CropAndWeed dataset provided a reference for scene design. Relevant characteristics included crop rows, irregular weed placement, exposed soil, and substantial differences in plant size. These observations informed the layout, assets, and camera configuration.

The generator needed to produce RGB images and corresponding object annotations in a format suitable for subsequent training. It also needed to expose the scene parameters through Python so that those parameters could be adjusted and new images generated without manually rebuilding each scene.

Generation environment

Generation ran on a GPU instance provisioned through NVIDIA Brev, using the NVIDIA Isaac Sim 6.0.0 container. The setup followed NVIDIA’s container installation instructions, with additional host-directory mounts for the project assets, generator script, and output dataset.

The generator runs as a standalone Python application, launched through Isaac Sim’s bundled python.sh environment. It initializes SimulationApp in headless mode, allowing the rendering process to run without an interactive desktop. NVIDIA documents this execution model in its Python environment guide.

Keeping generated files in a mounted output directory makes them available on the host after the container exits. Persistent cache directories are also retained between container sessions.

Building the agricultural scene

Sugar beet plants change considerably during their early development. The BBCH scale provides a standardized way to describe these growth stages. At BBCH 10, the cotyledons (seed leaves) are unfolded, while subsequent stages describe the development of additional leaves. These changes affect both plant appearance and size, making growth-stage variation important for crop and weed detection.

We used the BBCH scale as a reference when preparing the sugar beet assets, organizing them into four broader groups: cotyledon, early, mid, and late. These groups guided asset selection and scaling during synthetic image generation.

The asset collection contains 20 sugar beet representations. Fourteen were assembled in Blender from individual leaf models, varying the number, orientation, and arrangement of leaves around the plant’s center. This provides differences in plant structure as well as size.

Six additional plant representations were prepared for cotyledon and other very early growth stages using a partly scripted workflow. Background-removed plant images were applied as textures to flat surfaces, creating 2.5D assets. This provided an alternative to scaling down the available leaf models, which did not adequately capture the appearance of young seedlings. These assets were intended for the near-overhead camera views used in this project; their flat geometry makes them less suitable for more oblique viewpoints.

The prepared crop assets were exported to OpenUSD. During loading, the generator measures their bounds, accounts for coordinate orientation and units, and centers them using the plant crown where it is available. These steps matter because inconsistent origins or units can place a plant incorrectly or give it an unrealistic size.

(a) BBCH 11: seedling with two small bright green leaves while stem remains short and upright, set against a dark background.

Figure 1. Examples of sugar beet assets representing different stages of plant development

The weed collection contains 21 variants drawn from dandelion, nettle, grass, and a generic weed model. Each asset represents an individual plant so that it can be positioned, scaled, rotated, and labeled independently.

Top-left: dandelion rosette with jagged green leaves radiating from the center on a gray background (labeled a).","Top-right: nettle-like leaves with serrated margins forming a rosette from a central point (labeled b).","Bottom-left: tuft of long, thin grass blades spreading outward from a central node (labeled c).","Bottom-right: small weed plant with glossy green leaves and a thin stem, some leaves yellowing (labeled d: weed_plant_02).

Figure 2. Representative weed assets used in the scene

The ground is a textured plane with interchangeable soil materials. Sugar beet plants are placed in rows with a nominal spacing of 0.50 m between rows and 0.22 m between plants. Small position offsets disturb the regular pattern, and each candidate crop position has an 18% probability of being omitted.

Weeds are distributed both individually and in clusters, with up to 24 available positions per frame. Some plants can extend beyond the image boundary, introducing partially visible examples. Straw and stones provide additional background detail and receive no crop or weed label.

To manage the scene, the generator creates reusable plant slots containing asset variants. Between frames, it changes the active variants and their transforms rather than rebuilding the complete plant hierarchy.

Camera configuration and plant scale

Camera settings and plant dimensions determine how much information about each plant reaches the training image. A plant can look detailed when inspected as a 3D asset but occupy only a few pixels once viewed from above and resized.

The virtual camera looks down toward the ground. Its focal length is 24 mm, its horizontal aperture is 20.955 mm, and its height varies between 1.05 and 1.35 m. Small tilts of up to ±2° around the horizontal axes introduce viewpoint variation, while rotation around the vertical axis changes the orientation of the scene within the image.

For an approximately vertical view, these settings cover a ground width of about 0.92–1.18 m. At the saved image width of 960 pixels, that corresponds to approximately 0.96–1.23 mm of ground per pixel. This estimate connects physical plant dimensions to their expected image size.

Schematic of a camera setup: a centered camera above a ground baseline with lines to the baseline ends, showing height H and base B values and GSD notes.

Figure 3. Camera height, aperture, and focal length determine the ground area covered by the image and the approximate size of plants in pixels

Crop assets are organized by growth stage, with different target footprint ranges used to guide scaling. Scaling is constrained relative to each asset’s measured dimensions. For weeds, the generator samples a target pixel size and converts it into a physical footprint using the camera height, then applies size limits. This makes image scale an explicit part of scene generation.

Images are rendered at 1920 × 1088 pixels and saved at 960 × 544 pixels. Both dimensions are halved, preserving the aspect ratio. Bounding-box coordinates undergo the same transformation so that the annotations remain aligned with the saved images.

Introducing variation between images

The generator changes plant selection, position, scale, and orientation, as well as soil appearance, lighting, and camera pose. This process is commonly called domain randomization. NVIDIA’s discussion of the simulation-to-reality gap distinguishes differences in appearance from differences in scene content; both are relevant to this agricultural scene.

Variation is constrained by the task. Crops retain a row structure, while weeds can appear between rows or close to crop plants. Crop growth stages guide asset selection and size. Weed appearance is further varied through tilt, unequal scaling along the horizontal axes, and occasional changes associated with aging vegetation.

Lighting alternates between direct sunlight and an overcast configuration. The direct-light configuration uses a smaller angular light source for sharper shadows. The overcast configuration uses a larger angular source and different ambient illumination for softer shadows. Light intensity and direction vary within each configuration.

Soil materials vary in tint, texture scale, and texture offset. Camera placement accounts for the repeating texture pattern to reduce the chance of conspicuous seams entering the view. An initial material-calibration step also adjusts strong color casts toward a reference soil color.

Generating images and annotations

For each frame, the script selects a crop stage, soil material, lighting configuration, and camera pose. It then positions the plants and background objects, updates the scene, and requests rendered outputs from Replicator.

Rendering uses path tracing configured for 128 total samples per pixel. The generator requests both RGB data and tight two-dimensional bounding boxes. Semantic labels attached to the plant slots allow the returned boxes to be associated with the crop or weed class.

Before export, box coordinates are clipped to the image boundaries. Boxes narrower or shorter than 10 pixels at render resolution are excluded, corresponding to a minimum of 5 pixels along each axis in the saved image. The remaining coordinates are scaled to match the resized RGB image.

The annotation output is COCO JSON, where each object has an image identifier, category identifier, bounding box, and area. The two categories use IDs 1 and 2 for crop and weed. 

Two-panel image: left shows soil with young green plants; right shows same scene with green bounding boxes around detected plants and red boxes around uncertain detections.

Figure 4. A generated agricultural image without annotations (left) and with crop and weed bounding boxes (right)

The configuration targets 500 images, assigning 80% of frame indices to training and 20% to validation. A fixed split seed preserves that assignment between runs. Scene sampling uses a separate random generator, so the split seed alone does not reproduce the same images.

Checking the generated dataset

Automatic labels remove the need to draw every box manually, but the rendered images and exported annotations still require inspection. The script includes checks for problems that can otherwise pass unnoticed during a long generation run.

Before generation, soil materials are rendered to establish a texture-detail baseline. During generation, a brightness-normalized measure of local image variation is compared with the selected material’s baseline and a minimum threshold. Low-detail output triggers additional rendering steps or another attempt. This is a heuristic for detecting missing or insufficiently resolved texture detail.

Plant visibility is checked separately. When at least three plants are estimated to fall within the image, the script expects usable boxes for at least half of that estimated count. If too few boxes appear, it allows further scene updates and can reject the attempt. 

The first frame is also checked for extreme brightness or very low contrast. Diagnostic overlays show bounding boxes on saved images, and discarded attempts can be retained for inspection. COCO annotations are written periodically during generation; when pycocotools is available, a final check reports image and annotation counts and boxes with non-positive dimensions.

These checks address rendering and export integrity. Assessing whether the synthetic images contain the variation needed by a detector requires the next stage of the workflow: training and evaluation on real data.

Preparing for model training

The resulting workflow connects reusable plant assets, a configurable agricultural scene, and automatic annotation export. Its parameters make it possible to revisit specific aspects of the dataset-such as weed size, crop spacing, or lighting-and generate a new set of observations.

For this project, the next step is to examine how those observations contribute to crop-and-weed detection. Part 2 will cover RT-DETR training with synthetic data, real data, and synthetic pretraining followed by adaptation to real images, including evaluation of the resulting models on a held-out real test set.


Contact Konsulko to discuss bringing a perception application from training to a maintainable embedded product.

author avatar
Konsulko Group
Founded in 2012 by embedded Linux industry veterans, Konsulko Group is a unique services company. Unique in the experience provided by 20+ years of commercial development leveraging open source software. Unique in the decades of open source community work as active contributors and sometimes maintainers. Unique in the insight and precision we bring to every customer product.
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *