/

In eight weeks, a team of Omdena contributors built a weed detection system that runs in under 12 milliseconds on an embedded processor — fast enough to identify and target individual weeds as a laser robot moves across a crop row at working speed. It operates fully offline, requires no cloud connection, and replaces an entire chemical spray pass with a precision mechanical operation.
This project demonstrates how edge based AI in agriculture can replace chemical herbicides with real time, vision driven weed control. By optimising deep learning models and the full inference pipeline for on board execution, the system achieves millisecond level latency on embedded hardware without cloud connectivity. The result is precise mechanical weed removal, reduced environmental impact and a practical blueprint for deploying low latency AI in autonomous agricultural robots.
This article describes how the team achieved millisecond-level inference on embedded hardware by optimising deep-learning models and the full edge-based inference pipeline within just eight weeks. The architecture and optimization strategy described here remain directly applicable in 2026, with newer hardware such as the Jetson AGX Orin now offering up to 8x more compute at comparable power budgets.
Modern agriculture still relies heavily on chemical herbicides, despite growing concerns about environmental impact, human health and herbicide resistance. To explore a sustainable alternative, Omdena organised the global WeedBot challenge, bringing together forty collaborators to develop a vision-based weed control system that runs entirely on edge devices.
U.S. Geological Survey (USGS) scientists have reported that glyphosate and its degradation product AMPA (aminomethylphosphonic acid) are transported from agricultural and urban sources and are now widely present in the environment. Although chemical herbicides remain popular because they are inexpensive and easy to apply, up to 55 percent of their toxic residues persist in soil, water and air.
These residues accumulate in water bodies, harm surrounding plants and algae, and reduce overall biodiversity. Farm workers are also exposed, as chemicals can remain on crops and enter the body during harvesting. Over time, repeated herbicide use encourages the development of resistant weed species, forcing farmers to apply increasing amounts of chemicals and creating a self-reinforcing cycle of dependency.

Given these environmental and health costs, sustainable alternatives are urgently needed. Technology‑enabled weed control supports organic farmers by replacing repetitive manual labour with automated precision. Removing chemicals from the process yields pesticide‑free produce and helps make healthy food more affordable. The WeedBot challenge aimed to demonstrate that vision‑based systems can meet this need.
The urgency has grown since. The EU Farm to Fork strategy mandates a 50 percent reduction in chemical pesticide use by 2030, creating regulatory pressure that makes mechanical precision alternatives like this not just desirable but operationally necessary for farms operating in European markets.
Three structural constraints had to be addressed before the system could be deployed effectively. Each one sits at the intersection of computer vision and embedded systems, the combination is what makes precision weed control harder than a standard object detection task.
First, distinguishing crops from weeds in real field conditions is significantly harder than benchmark datasets suggest. Plants overlap, outdoor lighting changes constantly, and weeds at different growth stages can closely resemble the target crops. The model must classify at pixel level, not just detect bounding boxes, because a laser targeting error destroys the crop.
Second, the system had to perform inference at video speed on an embedded processor with no cloud fallback. A laser platform moving over a crop row cannot wait for a remote server: the targeting decision must be made in under 15 milliseconds or the window is missed. That constraint ruled out most standard deep learning deployments and required optimising every layer of the pipeline.
Third, the team had eight weeks to go from raw field data to a working prototype. That timeline forced an explicit trade-off between model exploration and pipeline engineering: the final system had to be deployable, not theoretically optimal.
The resulting proof of concept combines a camera, embedded computing and a laser on a mobile platform to enable computer vision crop detection and eliminate weeds autonomously. Because crops and weeds often look similar from above, and targets move as the vehicle advances, the system must deliver both high accuracy and extremely low latency without relying on cloud connectivity.

The WeedBot prototype is a laser weeding platform developed by WeedBot. For this task, the team used the technical characteristics of WeedBot’s second prototype: a high‑speed camera mounted above the crop row sends a constant video stream to an embedded computer. A laser module then targets weeds identified by the neural network. At the core of this system is fast and accurate visual understanding, building on advances in instance segmentation that allow autonomous machines to distinguish crops from weeds at pixel level in real time.
This interplay between rapid sensing and immediate actuation is what enables precise weed removal without damaging crops. The hardware must operate autonomously in the field, so all computation happens on the on‑board processor without reliance on remote servers or expensive connectivity.
At the heart of the system is the Nvidia Jetson AGX Xavier, a compact module that delivers workstation‑class performance at the edge. Thanks to its carefully balanced architecture of CPUs, GPUs and memory, it can process high‑resolution images and run complex neural networks in real time. Key features include:
These capabilities make the Jetson AGX Xavier suitable for robots, drones and other autonomous machines where space and power are limited. For deployments in 2026, the Jetson AGX Orin — delivering up to 275 TOPS compared to the Xavier’s 32 TOPS — enables the same pipeline architecture at significantly higher throughput and with support for newer CUDA and TensorRT versions.
In this project the device ran Jetpack 4.4.1, which bundles several essential libraries:
The team built a real-time inference pipeline on top of segmentation models such as YolactEdge and Bonnetal, each paired with a lightweight backbone like MobileNet. These models provide a good balance between segmentation accuracy and speed, which is crucial when a vehicle is moving over uneven terrain. More recent architectures including YOLOv8 and RT-DETR now offer comparable or better speed-accuracy tradeoffs for instance segmentation at the edge and are worth evaluating for new deployments.
The system’s camera captures images at 3008 × 3008 px from above the crop row, similar to workflows used in drone-based crop monitoring. Each frame contains multiple overlapping plants at various stages of growth, so careful labelling is essential. The team used the CVAT annotation tool with the MS COCO format to mark every weed and crop in each image.
To improve robustness, the dataset was augmented with Albumentations to simulate variations in brightness, rotation and scale—conditions that a field‑deployed system will inevitably encounter. Additional annotation classes were introduced so the model could distinguish among different types of plants rather than simply grouping all weeds together; this more granular labelling improved the mean average precision (mAP) during inference.

Building a responsive weed control system required reducing both the size and the complexity of the neural networks and streamlining the surrounding code. In practice this meant examining not only the architecture of the model itself but also how data moved through the application from camera to laser. These optimizations are especially effective when paired with modern image segmentation techniques for weed or crop detection, which balance accuracy and speed for deployment on resource-constrained edge devices. The team investigated three broad areas:
Together, these techniques form a holistic strategy: a compact model running on a tuned inference engine will still fall short if it is surrounded by slow preprocessing steps, and an efficient pipeline will not succeed if the model is too large for the hardware. The following sections describe how each layer was optimized.
Pruning reduces the number of parameters in a neural network by removing connections or neurons that contribute little to the final prediction. This method lowers memory consumption, latency and power draw while retaining accuracy. Research such as the Lottery Ticket Hypothesis suggests that a large network contains smaller sub‑networks that, when trained in isolation, perform as well as the full model. By iteratively pruning weights and neurons—sometimes entire neurons, as illustrated below—the team produced compact networks that ran efficiently on the Jetson. Instead of randomly dropping parameters, they used heuristics based on weight magnitudes and activation patterns to decide which parts of the network were expendable.

Different pruning strategies exist, including iterative pruning, weight pruning, and neuron pruning. Regardless of the strategy, the goal is to remove redundant structure without harming performance. The team referenced a variety of neural network architectures to guide these choices.
By default, most deep‑learning frameworks store weights and activations with FP32 precision. Converting a model to INT8 reduces its size by a factor of four and lowers memory bandwidth requirements, which in turn lowers heat and power consumption on an embedded board. INT8 models typically deliver two to four times higher throughput on supported hardware. There are several ways to perform quantization:
The team evaluated these techniques and found that INT8 quantization provided the best trade‑off between latency and accuracy for their hardware.

This choice does come with engineering overhead: calibration routines must be prepared and, in the case of quantization‑aware training, the training pipeline itself must change. Nonetheless, when every millisecond counts, the extra effort pays dividends.

Distillation compresses a network by teaching a smaller student model to mimic a larger teacher model. Introduced in a paper titled “Distilling the Knowledge in a Neural Network” by Geoffrey Hinton, Oriol Vinyals and Jeff Dean, the method first trains a high‑capacity teacher on ground‑truth labels. The predictions from this teacher become soft targets for the student. By matching these soft targets rather than hard labels, the student learns generalised behaviour with far fewer parameters. In the WeedBot project, this strategy allowed the team to deploy models that were faster and more memory‑efficient without sacrificing much accuracy. Distillation is particularly appealing when a project must ship quickly: instead of redesigning a new architecture, engineers can compress an existing model and preserve its behaviour.
To make the most of the Jetson’s GPU, the models were converted to TensorRT, Nvidia’s high‑performance inference library. TensorRT accepts networks exported to ONNX, Caffe or UFF formats and compiles them into an optimized engine. During this build step, developers can set the batch size, workspace size, and choose between FP32, FP16 or INT8 precision. For INT8 engines, TensorRT requires a calibration dataset to compute appropriate scaling factors. These calibration samples should reflect real‑world inputs so that quantization errors are minimized. The resulting binary can be serialized and loaded directly at runtime.

The team benchmarked their models at two input resolutions, 1920 × 1200 px and 560 × 560 px, to study the trade‑off between latency and precision. Lower‑resolution inputs reduce computation and increase throughput, while higher resolutions preserve detail and maintain accuracy. Across the experiments, the INT8‑calibrated engine consistently achieved the lowest latency at 560 × 560 px, making it the preferred setting for real‑time operation.
These results illustrate a broader lesson: larger inputs and higher precision may improve accuracy, but they also raise memory use and computational cost. Selecting the optimal resolution and precision requires profiling different combinations and choosing the sweet spot for the task at hand.

One of the most promising candidate networks was the Bonnetal model, a lightweight semantic segmentation architecture. After applying INT8 quantization and TensorRT calibration, the Bonnetal engine delivered strong performance on the Xavier platform. The figure below summarises the benchmarking results, highlighting how pruning and quantization shift the balance between speed and accuracy. While absolute numbers vary with resolution and batch size, the relative trends were consistent across trials.
Optimizing the neural network is only part of the challenge. The WeedBot pipeline also includes image preprocessing, post‑processing and other tasks that run alongside inference. The team examined each component and rewrote critical code to squeeze out additional speed.
Several supporting tasks originally written in Python were moved to C++ for performance. Running on a separate CPU thread in parallel with inference, these tasks include data loading, image transformations and control logic. Because Python is interpreted and lacks compile‑time optimizations, its performance on heavy numeric workloads can lag, especially when tight loops and array manipulations are involved. In contrast, C++ is compiled to machine code and can leverage aggressive optimizations, vector instructions and cache management. Converting the support routines yielded a 3.25× speed‑up compared with their Python equivalents and simplified integration with other C++ libraries.
The team employed CUDA‑enabled libraries for preprocessing images before sending them to the neural network. C++ and Python bindings both exist, and some routines were rewritten as CUDA C++ kernels to offload operations to the GPU. However, not all steps benefitted from GPU acceleration. When an operation involves relatively few computations or small images, the overhead of copying data to and from GPU memory can outweigh the gains. Careful profiling is therefore necessary to decide whether a given function should run on the CPU or GPU; the fastest path may vary depending on image size and available memory bandwidth.
In order to integrate C++ code into the predominantly Python pipeline, the developers created a Pybind11 wrapper. Pybind11 is a lightweight header‑only library that exposes C++ types and functions as native Python objects. It supports overloaded functions, custom data structures and static methods, and makes use of C++11 features such as tuples and lambdas. By overloading the NumPy ndarray type, the wrapper allows seamless exchange of arrays between Python and C++ without data copying.
Post‑processing tasks in the pipeline originally relied on NumPy routines. To further reduce latency, the team experimented with replacing NumPy functions with Cupy, a GPU‑accelerated drop‑in replacement. Although Cupy can significantly speed up large array operations, the post‑processing in this pipeline involved relatively small computations and occasional branching. As a result, the overhead of launching CUDA kernels outweighed the benefits, and the Cupy conversion did not yield a measurable improvement. This finding underscores the importance of benchmarking even intuitive optimizations: not every GPU library automatically yields a faster program, and micro‑benchmarks are essential to avoid wasted effort.
By combining model compression, TensorRT optimization, and targeted code refactoring, the WeedBot team reduced end-to-end inference latency to about 12 ms while maintaining high precision. Techniques such as pruning, quantization, and distillation cut model size without accuracy loss, while TensorRT leveraged Jetson hardware for faster runtimes and C++ rewrites removed Python overhead. Together, these optimizations show how careful engineering can turn complex models into responsive, field-ready edge AI systems.
Three specific gains drove the overall result. Rewriting critical Python support routines in C++ delivered a 3.25 times speedup on those components. Applying INT8 quantization via TensorRT reduced model memory footprint by a factor of four and delivered two to four times higher throughput compared to FP32 inference. The 560 x 560 pixel configuration with INT8 calibration achieved the lowest latency across all configurations tested.
These results confirm that production-grade edge AI for precision agriculture is achievable on current embedded hardware without sacrificing segmentation accuracy to meet real-time constraints.
The WeedBot system replaces a chemical spray pass with a targeted laser operation run autonomously. Rather than applying herbicide across an entire field, the robot identifies each weed individually and destroys it mechanically. This eliminates chemical input costs from the weed control process, prevents herbicide residue in produce, and makes organic certification achievable without the labour cost of hand-weeding.
The system operates fully offline on the embedded processor, which means it runs in remote fields without connectivity infrastructure. Model updates can be loaded locally, adapting the system to new weed species or seasonal growth-stage changes as they are observed in the field.
For farm operators, the system requires no change to existing planting or harvesting workflows. The robot runs as a standalone pass between crop rows, integrating into field schedules without displacing other equipment or labour. Because it requires no specialist knowledge to operate, deployment is not limited to large or technology-forward farms — any operation with a need for herbicide-free weed control can adopt it.
The team replaced NumPy post-processing routines with CuPy, a GPU-accelerated drop-in replacement, expecting a latency improvement. The replacement produced no measurable gain: the computations were too small for GPU offload to pay off. The same pattern appeared with CUDA-accelerated preprocessing — some operations benefited, others did not, depending on image size and memory bandwidth. Profiling before optimising, not after, is what prevents wasted effort.
Gains from model compression were matched and sometimes exceeded by pipeline engineering. The C++ rewrite of support routines, CUDA-accelerated preprocessing, and careful resolution selection each contributed independently to the final 12 ms result. Treating inference latency as a system property rather than a model property is what allowed the team to reach the target within an eight-week timeline.
Testing both 1920 x 1200 and 560 x 560 pixel inputs across FP32, FP16 and INT8 precision modes showed that the fastest configuration was not the intuitive one. Without profiling across combinations, the team would have defaulted to higher resolution and higher precision and left significant performance on the table. Selecting the optimal resolution and precision requires empirical benchmarking, not architectural assumptions.
In 2026 this work is more relevant than ever. Regulatory pressure on herbicide use is accelerating, precision agriculture hardware has become dramatically more capable, and the optimization techniques described here — pruning, quantization, distillation, TensorRT conversion — are now standard practice for production edge AI deployments.
On the hardware side, the Jetson AGX Orin delivers up to 275 TOPS compared to the Xavier’s 32 TOPS, enabling the same pipeline architecture at substantially higher throughput and with support for newer CUDA and TensorRT versions. On the software side, building an active learning loop — where edge-captured images are flagged for annotation and fed back into retraining- would let the model improve continuously as it encounters new weed species and seasonal growth-stage variations in production.
The immediate next step is moving from a controlled field trial to a multi-crop, multi-weed-species production deployment. That requires expanding the training dataset to cover more plant varieties and growth stages, and validating performance across different soil types and lighting conditions where crops and weeds are hardest to distinguish visually.
This case study documents an Omdena AI Innovation Project: a structured collaboration between Omdena’s global network of engineers and agricultural technology company WeeBot, a developer of laser weeding machinery. The project ran as an eight-week collaborative challenge, bringing together experts in computer vision, embedded systems, and precision agriculture to advance the system from raw field data to a working prototype.
Omdena works with teams to turn research prototypes into field-ready systems. If you are building an edge AI solution for agriculture or robotics, reach out to explore how this blueprint applies to your use case.

From Orbit to Harvest: Inside TerraYield, a Multimodal Dataset for Smarter Crop Yield Forecasting

Weed and Crop Detection with Semantic vs Instance Segmentation

Detecting Weeds Using YOLACTEdge Instance Segmentation for Smart Farming

Revolutionizing Short-term Traffic Congestion Prediction with Machine Learning