Research on Precise Segmentation and Center Localization of Weeds in Tea Gardens Based on an Improved U-Net Model and Skeleton Refinement Algorithm

Zhiyong Cao, Shuai Zhang, Chen Li, Wei Feng, Baijuan Wang, Hao Wang, Ling Luo, Hongbo ZhaoAgriculture 2025 · DOI

TL;DR

This paper introduces an improved U-Net model with attention mechanisms and spatial pyramid pooling for precise weed segmentation in tea gardens, achieving a significant boost in accuracy. It also presents a novel method for pinpointing weed centers by combining centroid and skeleton analysis, crucial for developing intelligent weeding machinery.

What Problem Does This Paper Address?

Weed competition is a major hurdle in tea production, leading to reduced yield and quality. Traditional weed control methods are often costly, environmentally damaging, and lead to weed resistance. The challenge is amplified in tea gardens due to the small size of weeds, their visual similarity to tea plants, and the complex growing environment. Existing automated weed detection methods often struggle with accurate segmentation and precise localization, especially in diverse real-world conditions. This paper aims to bridge this gap by developing a robust system for both identifying weed boundaries and pinpointing their exact centers, paving the way for more efficient and targeted weed management.

Methods

The core of this research lies in two main components: an enhanced segmentation model and a novel center localization algorithm.

Improved U-Net for Segmentation: The authors start with a standard U-Net architecture, a popular choice for image segmentation. To boost its performance, they integrate two key modules:

  • Double Attention Mechanism (CBAM): This module enhances feature extraction by allowing the network to focus on important regions in both the channel and spatial dimensions. This helps in highlighting weed features and suppressing irrelevant background information.
  • Atrous Spatial Pyramid Pooling (ASPP): This module captures multi-scale contextual information by using dilated convolutions. It helps the model understand the weed at different scales, which is crucial for segmenting complex shapes and overlapping structures.

Skeleton Refinement and Centroid-Based Localization: For precise weed center localization, the paper proposes a multi-step approach:

  1. Image Preprocessing: Binary weed images are denoised using connected component analysis to remove noise and small artifacts. Morphological operations (closing) are used to fill holes within the weed structure.
  2. Skeleton Extraction: Image thinning algorithms are employed to reduce the weed's structure to a single-pixel-wide skeleton. The Zhang-Suen algorithm is chosen over Hilditch for its efficiency and ability to produce smoother, more continuous skeletons, which are less prone to redundant branches that could interfere with localization.
  3. Centroid and Skeleton Intersection Analysis: The centroid (center of mass) of the weed is calculated. A Region of Interest (ROI) is defined around the centroid, with its size determined by a hyperparameter optimized through experimentation. Within this ROI, skeleton intersections are identified.
  4. Center Point Determination: The final center point is determined by selecting the point that has the shortest distance to both a skeleton intersection and the weed's centroid. This hybrid approach leverages the structural information from the skeleton and the overall mass distribution from the centroid.

Datasets

The study utilizes a newly created dataset specifically for tea garden weeds.

  • Tea Garden Weed Dataset: This dataset comprises 5366 high-definition images of common weeds found in tea gardens, including Digitaria sanguinalis, Setaria viridis, and Chenopodium album. The images were captured under various lighting conditions to simulate real-world scenarios. The dataset was augmented through cropping, scaling, contrast enhancement, brightness adjustment, and geometric transformations. The data was split into training, validation, and test sets in a 7:2:1 ratio.

Key Insights and Ideas

  • Attention is Key for Weed Detail: Integrating attention mechanisms (CBAM) significantly improves the model's ability to discern fine details and suppress noise, leading to more accurate weed segmentation, especially in complex environments.
  • Multi-Scale Context Matters: ASPP module's ability to capture features at various scales is crucial for handling the diverse shapes and overlapping structures of weeds, preventing the loss of high-level semantic information.
  • Skeleton + Centroid = Precise Location: Simply relying on a centroid can be inaccurate for irregularly shaped weeds. Combining it with skeleton analysis, particularly the intersection points, provides a more robust and accurate method for pinpointing the weed's center.
  • Hyperparameter Tuning for ROI is Critical: The size of the Region of Interest (ROI) used in the localization algorithm has a significant impact on accuracy. An overly large ROI can introduce background noise, while an appropriate size effectively isolates the weed and reduces interference.

Key Results

  • Segmentation Performance: The improved U-Net model (CBAM + ASPP + U-Net) achieved a significant improvement in segmentation accuracy. Compared to the original U-Net, it showed a 4.08% increase in Pixel Accuracy (PA) and a 5.22% increase in Mean Intersection over Union (MIoU). The final model achieved a PA of 90.65% and an MIoU of 75.85%.
  • Localization Accuracy: The proposed centroid-and-skeleton-based localization algorithm achieved an accuracy rate of up to 82%.
  • Model Size: The improved U-Net model is relatively lightweight, with a size of approximately 13 MB, making it suitable for deployment on embedded systems.

Limitations and Future Work

The authors acknowledge several areas for future improvement:

  • Dataset Generalization: The current segmentation model has only been validated on a specific set of co-occurring weeds (Digitaria sanguinalis, Setaria viridis, and chenopodium album). Future work should expand the dataset to include a wider variety of weed species and different growth stages to improve the model's generalization ability.
  • Depth Information for Localization: The current localization method can experience larger errors when weed leaves are significantly offset or mutually obscured. Incorporating depth information, potentially through monocular cameras, could optimize precision and achieve higher localization accuracy.
  • Model Lightweighting and Portability: The model's large parameters and high computational requirements necessitate further research into lightweighting techniques like model quantization and migration. This would enable its deployment on robotic intelligent vehicles, enhancing its practical applicability and portability.

Summary updated

Abstract

The primary objective of this research was to develop an efficient method for accurately identifying and localizing weeds in ecological tea garden environments, aiming to enhance the quality and yield of tea production. Weed competition poses a significant challenge to tea production, particularly due to the small size of weed plants, their color similarity to tea trees, and the complexity of their growth environment. A dataset comprising 5366 high-definition images of weeds in tea gardens has been compiled to address this challenge. An enhanced U-Net model, incorporating a Double Attention Mechanism and an Atrous Spatial Pyramid Pooling module, is proposed for weed recognition. The results of the ablation experiments show that the model significantly improves the recognition accuracy and the Mean Intersection over Union (MIoU), which are enhanced by 4.08% and 5.22%, respectively. In addition, to meet the demand for precise weed management, a method for determining the center of weed plants by integrating the center of mass and skeleton structure has been developed. The skeleton was extracted through a preprocessing step and a refinement algorithm, and the relative positional relationship between the intersection point of the skeleton and the center of mass was cleverly utilized to achieve up to 82% localization accuracy. These results provide technical support for the research and development of intelligent weeding equipment for tea gardens, which helps to maintain the ecology of tea gardens and improve production efficiency and also provides a reference for weed management in other natural ecological environments.
BibTeX
@inproceedings{cao2025research,
  author = {Zhiyong Cao and Shuai Zhang and Chen Li and Wei Feng and Baijuan Wang and Hao Wang and Ling Luo and Hongbo Zhao},
  title = {{Research on Precise Segmentation and Center Localization of Weeds in Tea Gardens Based on an Improved U-Net Model and Skeleton Refinement Algorithm}},
  booktitle = {Agriculture},
  year = {2025},
  doi = {10.3390/agriculture15050521},
}
Figure