# Weed Detection Method Based on Lightweight and Contextual Information Fusion
## 1 Introduction
[24] introduced the YOLO-sesame model, which outperformed mainstream models like Fast R-CNN, SSD, and YOLOv4, achieving a final mAP of 96.16% and a frame rate of 36.8%, effectively meeting the requirements of sesame weed detection. [PERSON] et al. [25] incorporated the Channel Attention (CA) mechanism into the backbone feature extraction network and replaced the Path Aggregation Network (PANet) with a Bi-directional Feature Pyramid Network (BiFPN) in the neck network. The enhanced YOLOv5 network demonstrates effective asparagus detection in various weather conditions. [PERSON] et al. [26], through improvements \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Method** & **Advantages** & **Disadvantages** \\ \hline Optical Detection & High accuracy, fast speed & High cost, not suitable for multi-target detection \\ \hline Digital Image Processing & Fast speed, low cost & Limited applicability, high environmental requirements \\ \hline Curvelet Transform Detection & Fast speed & Limited applicability, high detection environmental requirements \\ \hline Computer Vision & High accuracy, fast speed & Requires a large amount of dataset and computational resources \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Advantages and disadvantages of various detection algorithms. in the backbone network, attention mechanism, and loss functions, significantly reduced the parameter count and enhanced detection accuracy. To address the aforementioned challenges and develop a method that balances detection accuracy and speed for weed detection in sugar beet fields, we propose CCCS-YOLO, a lightweight weed detection method based on YOLOv5s. The primary contributions of this study are as follows:  
1. Improved the neck network by utilizing the lightweight FasterNet [27] architecture to create the new C3_faster module, which replaced the first three C3 modules in the neck. The objective was to reduce the model's parameter count, making it more lightweight. 2. Replaced the \(1\times 1\) convolution in the head with Contest Aggregation [28], adaptively fusing context information of different scales, improving the model's performance in detecting weeds in complex backgrounds. 3. Replaced the conventional upsampling modules in the neck network with the CARAFE [29] module, enhancing the fusion of contextual information and improving the model's performance in detecting small targets. 4. Proposed using EIoU [30] to replace the original CIoU in YOLOv5, enhancing regression accuracy. Additionally, we introduce Soft-NMS [31] to optimize overlapping bounding boxes in the regression task, reducing redundant boxes, and retaining potential target boxes, thus enhancing the model's robustness. 5. Conducted tests to evaluate performance under different IoU thresholds and using combinations of IoU and Soft-NMS. We also perform ablation experiments on different optimization modules. Lastly, we compare our model with classical object detection networks to validate its effectiveness. 6. To validate the robustness of the model, the performance of YOLOv5 was compared with the improved algorithm on the sesame weed dataset. These efforts aim to address the challenges posed by variations in the size, shape, weed diversity, night-time conditions, and different growth stages of weeds in practical detection tasks related to crops and weeds. The remaining sections of this paper are organized as follows: Section 2 introduces the innovations of this study, providing a detailed overview of the algorithmic structure of CCCS-YOLO. Section 3 outlines the experimental setup and parameters, followed by an analysis and comparison of the experimental results. Finally, Section 4 presents the conclusions of this paper and outlines avenues for future work.