ICPR 2026

๐ŸŒฟ WeedDiffusion
A Dual-Branch Synthetic Augmentation Framework for Weed Mapping

1Department of Computer Science, University of Bari Aldo Moro, Italy
WeedDiffusion pipeline overview
Overview of the WeedDiffusion pipeline. The top branch augments crops by inpainting masked border regions of real field images with a DreamBooth-tuned Stable Diffusion model (25 full-field crop images). The bottom branch generates synthetic weeds with a second DreamBooth model (12 cropped weed images), extracts them with SAM, and pastes them into background regions โ€” automatically reconstructing the semantic mask at every step.

Abstract

Precision agriculture depends on accurate cropโ€“weed discrimination to enable efficient weed control and sustainable crop production. However, building large-scale annotated datasets is time-consuming and costly. We introduce WeedDiffusion, a data-augmentation framework that leverages DreamBooth-tuned diffusion models to generate training data for crop and weed segmentation. Our approach combines two complementary strategies: (i) inpainting crop regions using a DreamBooth model trained on in-distribution crop imagery, and (ii) cut-and-paste generation of weed instances, created by a second fine-tuned DreamBooth model and segmented with the Segment Anything Model. The augmented images are paired with automatically reconstructed masks for training semantic segmentation models.

Experiments show that WeedDiffusion produces morphologically realistic samples and consistently improves the mean Intersection-over-Union across different segmentation architectures, with the largest gains on the underrepresented weed class. Ablation studies vary the size of both the synthetic set and the real data used to train the generator, confirming the approach's data efficiency and scalability. WeedDiffusion offers a scalable, model-agnostic solution for enhancing agricultural datasets through targeted, high-fidelity synthetic augmentation.


Two Complementary Branches

๐Ÿ–Œ๏ธ Crop Generation Branch

A Stable Diffusion v1.5 model, fine-tuned via DreamBooth on full-field crop scenes, inpaints field border regions with morphologically accurate crops. Inpainting preserves spatial continuity with the original image while the semantic mask is updated accordingly, guaranteeing pixel-level label consistency.

๐ŸŒฑ Weed Generation Branch

A separate DreamBooth model generates individual synthetic weeds, which are segmented with SAM and composited into background-only regions of the crop-augmented images under biologically-informed constraints (no overlap with crops or image borders). Masks are merged into the ground truth.


Crop Inpainting Examples

Crop inpainting qualitative examples
Two examples of the inpainting-based crop augmentation. Top row: original field image, the masked region (red overlay) to be inpainted, and the inpainted result. Bottom row: the corresponding ground truths, with cyan = crop and red = weed. The inpainted crops blend seamlessly into the scene while the semantic mask is updated to stay label-consistent.

Results

Semantic-segmentation IoU (%) on the PhenoBench validation set (772 images). All models start from the same 37 real images; WeedDiffusion adds 120 synthetic samples. Best row per architecture highlighted.

Architecture Online aug. Offline aug. BGCropWeedMean
ERFNetgeo+colornone98.3887.0114.7566.72
geo+colorcGAN98.5187.0421.3468.96
geo+colorLSB98.7487.8922.5769.73
geo+colorWeedDiffusion98.9590.8940.0276.62
DeepLabV3+geo+colornone98.5286.1810.1464.95
geo+colorcGAN98.9987.3517.6868.00
geo+colorLSB99.0287.8519.4368.77
geo+colorWeedDiffusion99.0491.1035.1675.10
UNetgeo+colornone99.0591.0229.9873.35
geo+colorcGAN99.1391.4530.8773.82
geo+colorLSB99.1791.8331.5474.18
geo+colorWeedDiffusion99.2692.9045.5579.23

Adding WeedDiffusion samples improves mean IoU by +5.9 to +10.1 points, with the weed IoU more than doubling for every architecture (ERFNet 14.8→40.0, DeepLabV3+ 10.1→35.2, UNet 30.0→45.6).

Qualitative segmentation predictions
Qualitative comparison (ERFNet). From left: original image, ground truth, and predictions from models trained with the baseline (37 real images), cGAN, LSB, and WeedDiffusion (37 real + 120 synthetic). Cyan = crop, red = weed. WeedDiffusion yields sharper boundaries and recovers small weed patches missed by the other methods.

Data Efficiency

Ablation on number of training samples
Effect of the number of real images used to fine-tune the DreamBooth generators (crop + weed). Segmentation quality rises sharply once a lower bound is crossed (โ‰ˆ25+12 samples) and then saturates โ€” underlining the method's data efficiency in low-data regimes.

BibTeX

@inproceedings{demarinisWeedDiffusionDualBranchSynthetic2027,
  title     = {WeedDiffusion: A Dual-Branch Synthetic Augmentation Framework for Weed Mapping},
  author    = {De Marinis, Pasquale and Iammarino, Antonio and Vessio, Gennaro and Castellano, Giovanna},
  booktitle = {Pattern Recognition},
  publisher = {Springer Nature Switzerland},
  year      = {2027},
  pages     = {545--559},
  doi       = {10.1007/978-3-032-31583-0_36}
}