Every growing season, farmers wage an invisible war against weeds that can quietly strip away more than half of a maize harvest before a single kernel forms. Weeds compete with young maize seedlings for water, nutrients, and sunlight, and they harbor pests and pathogens that further erode yield and quality. Global estimates attribute up to 43 percent of crop losses to weeds, and in maize production, poor weed control can push losses beyond 50 percent, occasionally resulting in total crop failure. Manual weeding is exhausting and slow, while blanket herbicide spraying pollutes soil and water and raises health concerns. The obvious solution is a machine that can see the difference between a crop and a weed in real time, and a new study published in Smart Agricultural Technology claims to have built exactly that.
Researchers at China Agricultural University have unveiled SFM-DETR, a real-time detection model designed to identify maize seedlings and seven common weed species in messy, unpredictable field conditions. The work, led by Qingkuan Meng and Chengyu Cai, tackles a problem that has long frustrated agricultural computer vision: young maize plants and weeds look strikingly similar in color, shape, and texture, especially when photographed under harsh sunlight, deep shadow, or against cluttered backgrounds of soil, plastic mulch, and straw residue. Existing detectors built on convolutional neural networks, including the popular YOLO family, excel at local pattern recognition but struggle to capture the global context needed to separate a slender seedling from a look-alike weed in a dense, occluded canopy.
The team’s answer combines two ideas that rarely appear together in agricultural hardware-friendly models. The first is Mamba, a state space model architecture that has recently shaken up machine learning by offering the global modeling power of Transformers at linear computational cost. Where self-attention scales quadratically with image size, making it prohibitively expensive for high-resolution field imagery on edge devices, Mamba’s selective scan mechanism compresses and propagates long-range context through a recursively updated hidden state, keeping complexity linear. SFM-DETR embeds a custom module called the Local-Global Mamba CSP Block into its main backbone, pairing depthwise separable convolutions that capture fine leaf edges and vein textures with a Mamba Vision Mixer that sweeps across the entire image to understand crop rows, occlusion relationships, and spatial context.
The second idea is more surprising: the model looks at the field in the frequency domain as well as the spatial domain. Small or partially hidden targets tend to carry distinctive high-frequency edge and texture signatures, while backgrounds are dominated by low-frequency components. SFM-DETR therefore includes an auxiliary backbone built around a Frequency Domain Enhancement Module, which applies a two-dimensional real fast Fourier transform to shallow features, modulates the spectrum with learnable complex-valued weights that act as a trainable frequency filter, and transforms the result back to the spatial domain. A Dual-Gated Adaptive Fusion Module then injects this high-frequency correction into the main features through channel and spatial gating, using a learnable scaling factor that starts near zero so the frequency stream stays silent early in training and gradually blends in as the model learns which spectral cues matter.
Further refinements target the plumbing between network stages. A Dynamic Hybrid Mamba Feature Fusion Network replaces the standard encoder of the underlying RT-DETR architecture, using the DySample dynamic upsampling operator to predict point-wise sampling offsets instead of relying on fixed interpolation, which preserves the fine boundaries of small targets during cross-scale propagation. In the opposite direction, Linear Deformable Convolution learns flexible, irregular sampling grids that adapt to the slender, contorted shapes of real weeds rather than the rigid square grids of standard convolutions. Finally, a new Inner-SD Loss reshapes bounding-box regression by dynamically reweighting overlap and position terms according to target size and adding an auxiliary inner-box constraint, sharpening localization for the tiny weed seedlings where slight box drift would otherwise wreck the intersection-over-union signal.
To train and test the system, the researchers built a demanding dataset at the Shangzhuang Experimental Station between April and June 2021, capturing 2,880 images with a Canon EOS 700D across soil, plastic mulch, and straw-residue backgrounds, and under sunny, cloudy, strong-light, weak-light, and shaded conditions. After environment-simulation augmentation including geometric, photometric, and occlusion transformations, the final dataset contained 11,990 images with 18,515 annotated instances spanning maize seedlings at the three-to-six leaf stage and seven weed species, from Chenopodium ambrosioides to Convolvulus arvensis.
The benchmark results are striking. SFM-DETR achieved 80.5 percent mean average precision at the 0.5 threshold and 66.2 percent at the stricter 0.5 to 0.95 range, beating the RT-DETR-R18 baseline by 10.6 and 7.6 percentage points respectively. It posted the highest recall of all compared models at 73.3 percent and the best small-target performance at 29.2 percent mAP for objects under 32 by 32 pixels, a 4-point gain over the baseline. Remarkably, it did so with only 20.62 million parameters and 60.3 gigaflops, roughly 36 percent fewer parameters and 42 percent less computation than the much larger RT-DETR-L, while running at 102.7 frames per second. Ablation experiments confirmed that each component contributes: the Mamba backbone alone lifted accuracy by 8.4 points, the frequency auxiliary backbone added further gains, the fusion network cut computation by nearly 40 percent without sacrificing performance, and the new loss function delivered the final boost.
Qualitative comparisons reinforced the numbers. In side-by-side visualizations across four challenging scenarios, small targets against complex soil, dense overlapping foliage, strong illumination with shadows and straw, and tiny weeds amid background clutter, competing YOLO and RT-DETR variants produced missed detections, false positives, and oversized bounding boxes, while SFM-DETR kept its boxes tight and its hit rate high. Grad-CAM heatmaps showed the model’s attention concentrating progressively on target bodies, leaf edges, and occluded regions as each module was added, with background activations fading away.
Deployment tests suggest the model is ready to leave the lab. Converting the network to a TensorRT FP16 inference engine on an NVIDIA RTX 3090 cut average end-to-end latency from 17.16 milliseconds to 6.10 milliseconds and boosted throughput to 169.3 frames per second, with only a modest accuracy dip to 79.1 percent mAP. In a robotic weeding or precision spraying system, such a perception module could translate camera frames into precise weed coordinates for nozzles or mechanical actuators, cutting herbicide use and repeated passes. The authors caution that their dataset comes from a single station over one season, that extremely small or heavily occluded targets still slip through, and that embedded-device validation remains future work. Still, by marrying Mamba’s linear-cost global vision with the subtle physics of frequency analysis, SFM-DETR points toward a future where fields are weeded not by chemical blanket bombing but by machines that genuinely understand what they are looking at.
Subject of Research: Deep learning-based maize seedling and weed detection in complex field environments using a spatial-frequency collaborative Mamba detector
Article Title: SFM-DETR: A spatial-frequency collaborative Mamba detector for maize seedling and weed detection in complex field environments
Article References: Meng, Q., Cai, C., Yan, H., Li, T., Zhang, M., & Yuan, H. (2026). SFM-DETR: A spatial-frequency collaborative Mamba detector for maize seedling and weed detection in complex field environments. Smart Agricultural Technology, 15, Article 102620. https://doi.org/10.1016/j.atech.2026.102620
Image Credits: AI Generated
DOI: Not provided
Keywords: SFM-DETR, weed detection, maize seedlings, Mamba, state space models, RT-DETR, frequency domain, precision agriculture, object detection, computer vision, smart farming, herbicide reduction
Cite Scienmag News
Alan Morgan. (October 14, 2026). Mamba-Powered AI Spots Maize Seedlings and Weeds With Unmatched Precision. Scienmag. https://scienmag.com/mamba-powered-ai-spots-maize-seedlings-and-weeds-with-unmatched-precision/
Alan Morgan. "Mamba-Powered AI Spots Maize Seedlings and Weeds With Unmatched Precision." Scienmag, 14 October 2026, https://scienmag.com/mamba-powered-ai-spots-maize-seedlings-and-weeds-with-unmatched-precision/. Accessed 14 October 2026.
Alan Morgan. "Mamba-Powered AI Spots Maize Seedlings and Weeds With Unmatched Precision." Scienmag. October 14, 2026. https://scienmag.com/mamba-powered-ai-spots-maize-seedlings-and-weeds-with-unmatched-precision/

