Next Article in Journal
Research Progress on Key Technologies, Restrictive Factors and Optimization Strategies of Detasseling for Maize Seed Production
Previous Article in Journal
Remediation Effects and Mechanisms of Biochar Derived from Agricultural Waste on Soils Contaminated with Cadmium (Cd) and Lead (Pb)
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research on Field Weed Detection Methods for Sweet Corn Seedlings and Laser Weed Control Experiments

1
College of Information and Technology, Jilin Agricultural University, Changchun 130118, China
2
College of Biological and Agricultural Engineering, Jilin University, Changchun 130022, China
*
Author to whom correspondence should be addressed.
Agriculture 2026, 16(11), 1237; https://doi.org/10.3390/agriculture16111237
Submission received: 1 May 2026 / Revised: 23 May 2026 / Accepted: 2 June 2026 / Published: 3 June 2026
(This article belongs to the Section Crop Protection, Diseases, Pests and Weeds)

Abstract

Sweet corn has high economic value and is consumed directly, requiring strict environmental and management conditions. However, weed infestation during growth seriously affects yield and quality, while conventional chemical weed control may compromise product safety. Laser weeding offers an effective alternative, with precise weed detection and localization as its core requirement. This study proposes YOLO-GFD, a lightweight weed detection algorithm for sweet corn fields. Compared with the original model, YOLO-GFD increased mAP@0.5 by 10.61 percentage points, reduced floating-point operations by 0.6 percentage points, and achieved an average precision of 95.77%. Field trials further showed a real-time weed detection rate of 93.1% and a corn seedling misdetection rate of 1.1%, indicating strong practical applicability. In addition, weed control experiments using 110 W near-infrared and blue lasers under different power levels and irradiation durations identified suitable laser parameters for field laser weeding. Overall, YOLO-GFD meets the real-time accuracy requirements of autonomous laser weeding and provides a reliable basis for visual recognition and laser parameter optimization in sweet corn production.

1. Introduction

Fresh sweet corn, prized for its tender texture and rich nutritional value, has become one of the premium foods on modern dining tables [1]. However, weed infestation in cornfields has become one of the key factors limiting stable and increased yields of sweet corn. The diverse and highly competitive weeds found in sweet corn fields severely impact crop growth, development, yield, and quality [2]. Currently, the primary challenges in weed control for fresh-market corn fields include: diverse weed species growing in mixed stands, inefficient manual weeding with high labor intensity, and the inability to meet the demands of large-scale agricultural production. This results in untimely weed removal, further impacting both the yield and quality of fresh-market corn [3]. While chemical weed control is suitable for large-scale farmland, it causes significant environmental pollution and directly impacts the quality and taste of sweet corn.
Due to the direct-consumption nature of sweet corn, the use of chemical pesticides for field weed control can adversely affect its quality and taste. There is an urgent need for a weed control method that does not harm the crop. As a high-energy, high-precision physical approach, laser technology has seen a growing research focus in agricultural applications and has gained widespread adoption. Laser weed control technology leverages the high energy and precise targeting capabilities of lasers to effectively disrupt the cellular structure of weeds, rendering them incapable of growth and thereby achieving weed elimination. Laser weeding avoids the use of chemical agents, reducing pollution to soil, water bodies, and air. It can precisely target specific parts of weeds, minimizing damage to surrounding crops. Accurate detection of weeds in sweet corn fields provides technical support for laser precision weeding operations, which is crucial for enhancing sweet corn yields. Precise identification and localization of weeds in the field are essential prerequisites for the successful implementation of laser weeding. Timely and accurate detection of weed locations not only enables precise weeding solutions for farmland management but also effectively reduces weed control costs while enhancing crop yield and quality [4,5,6]. In recent years, deep learning methods have been extensively studied for detecting weeds in crops [7,8,9,10]. Object detection, as one of the foundational deep learning technologies applied in agriculture, has found extensive use in the management of weeds in farmland [11,12,13]. Numerous researchers have conducted in-depth studies on the application of deep learning technology in field weed control and achieved some results. Cui et al. [14] proposed that the Faster R-CNN model with VGG16 as the backbone feature extraction network achieves optimal recognition accuracy. By analyzing the dataset’s inherent characteristics and optimizing anchor frame parameters, the refined model achieved an average recognition accuracy of 88.69% per data frame with an average recognition time of 310 ms, enabling accurate identification of soybean seedlings and weeds across varying densities. Zhao et al. [15] proposed the MC-YOLOv4 model, which replaces the backbone network in the YOLOv4 architecture with the lightweight MobileNetV3 network and introduces separable convolutions in the Path Aggregation Network (PANet). This model achieved a mAP of 98.52% in potato field weed detection, with an average detection time of 12.49 ms per image. These models, optimized over traditional CNNs, exhibit high parameter counts and computational demands, resulting in slow processing speeds and ineffective handling of issues like weed occlusion. With the continuous advancement of object detection technology and iterative model development, numerous new models tailored for weed detection have emerged. Jia et al. [16] proposed the ADL-YOLOv8 model, which integrates a lighter AKConv network to better handle specific features, particularly for detecting small objects. On the same weed dataset, it achieved a 2.2% improvement in accuracy and a 2.45% increase in recall. The model size was reduced by 15.77%, and computational complexity decreased by 10.98%. Jawadul Karim et al. [17] proposed the YOLOv8 nano weed detection model, which combines deep neural networks with lightweight attention mechanisms to efficiently identify various weed types in cotton fields. The improved model achieved an average detection accuracy of 97.6%. Shao et al. [18] proposed an enhanced deep learning model, GTCBS-YOLOv5s, for identifying six weed species in rice fields. This algorithm incorporates a spatial pyramid pooling structure and attention mechanism, achieving an accuracy of 91.1% and a detection speed of 85.7 FPS. Zheng et al. [19] proposed the YOLOv8-DMAS algorithm for detecting weeds in cotton fields under complex environments. To enhance the model’s ability to capture multi-scale features of different weeds, all BottleNecks were replaced with dilated residual modules (DWR) in the C2f network, and a multi-scale module (MSBlock) was added to the last layer of the backbone. Compared with the original model, the accuracy, recall rate, mAP@0.5, and mAP@0.5-0.95 of this algorithm increased by 1.7%, 3.8%, 2.1%, and 3.7%, respectively. The above research has achieved satisfactory results in weed detection precision and accuracy. However, practical challenges remain when applying these models to laser weeding, including the large number of model parameters and lengthy training times. Laser weeding demands rapid detection speeds, high recognition accuracy, and precise weed localization—particularly the accurate identification of weed center points. Enhancing laser targeting effectiveness while avoiding crop damage is crucial for improving overall operational efficiency. Therefore, designing an efficient, non-destructive method for detecting and locating weeds in sweet corn fields using lightweight convolutional neural networks is of significant importance.
Based on the aforementioned challenges, this study proposes an integrated weed detection, localization, and laser weeding framework for sweet corn fields at the seedling stage. The purpose of this work is not limited to improving weed detection accuracy, but also extends to developing a lightweight perception module capable of supporting real-time weed localization for laser weeding. Specifically, the objectives of this study were as follows:
(1) Was to create a real-world weed image dataset for sweet corn fields at the seedling stage. Field images were collected under natural conditions and expanded through data augmentation, providing a reliable data basis for model training and evaluation.
(2) To develop a lightweight weed detection model, YOLO-GFD, for real-time weed localization in sweet corn fields. In this model, a CAMB feature enhancement module was designed and embedded into the C2f-Faster structure to improve feature fusion and weed target representation under complex field backgrounds. Meanwhile, GAM-StarNet and Detect-GSC were introduced to reduce model complexity, and the original CIoU loss was replaced with WIoU to improve bounding box regression. This design enabled the model to balance detection accuracy, lightweight deployment, and real-time localization requirements for laser weeding.
(3) To conduct laser weeding experiments using near-infrared and blue light lasers under different power levels and irradiation durations. The experimental results were used to determine suitable laser operation parameters, providing technical support for subsequent weed center targeting and precision laser weeding in sweet corn fields.

2. Materials and Methods

2.1. Data Collection and Data Set Construction

During the training of deep learning models, the quality of the dataset often impacts the final detection results. This study utilizes field images of weeds during the seedling stage of sweet corn. At this stage, sweet corn leaves have not yet closed the field paths, and there is minimal overlap or shading between weeds and crops. The experiment used the self-made platform of the D435i depth camera (Intel Corporation, Santa Clara, CA, USA) to take RGB images of corn at the sweet corn planting base of Jilin Fuyu Agricultural Technology Co., Ltd., located in Antu County, Yanbian Korean Autonomous Prefecture, Jilin Province, China (128.97° E, 43.06° N; maize row spacing: 50 cm), to establish a maize image database. Jilin Province is one of China’s major producing regions for fresh-eating maize; consequently, this dataset provides a reasonable representation of the field conditions and weed community characteristics of local sweetcorn fields. Data collection spanned from 19 June to 10 July 2024, with imaging conducted between 8:00 AM and 10:00 AM. During this period, natural illumination was sufficient and relatively stable, which helped reduce the effects of overexposure, strong shadows, and leaf reflection on image quality. Meanwhile, the relatively low field temperature in the morning helped maintain stable leaf morphology of maize seedlings and weeds, allowing clearer and more consistent training samples to be obtained. Mount the camera on the platform’s top surface approximately 30 cm–50 cm above the ground, with a shooting angle range extending 30 degrees below the horizontal plane. The platform moves at a speed of approximately 0.8 m per second to generate stable video sequences. These sequences are captured at 5 frames per second, with each image having a resolution of 1920 × 1080 pixels and saved in JPG format. These images document varying levels of weed coverage in sweet corn seedling fields, totaling 3200 images. All 3200 original images were manually annotated using LabelImg (version 1.8.6) before data augmentation. In this study, weed targets were annotated as a single category rather than being classified by species. This annotation strategy was adopted because the main objective of the proposed system was to detect and localize non-crop plants for laser weeding, rather than to identify individual weed species. Therefore, all clearly visible plants other than sweet corn seedlings were regarded as weeds and annotated using bounding boxes. Severely blurred, heavily occluded, or incomplete weed targets located at image boundaries were excluded to avoid ambiguous annotations. Each weed target was labeled with the minimum bounding box to improve localization accuracy and reduce redundant background information. The annotations were first saved in .xml format and then converted into .txt files for YOLO training.
To increase the diversity of training data and enhance the model’s generalization capability, image augmentation techniques were applied. After augmentation, the dataset comprised 5350 images. This process ensured balanced experimental data, improved sample quality and quantity, and provided sufficient data for subsequent CNN training. To ensure a clear and consistent evaluation protocol, the dataset was randomly divided into training, validation, and test sets at a ratio of 7:2:1. Specifically, 3745 images were used for training, 1070 images were used for validation, and 535 images were used for testing. All images were resized uniformly to 640 × 640 pixels. The outcomes of data augmentation processing and image annotation are shown in Figure 1.

2.2. Model of Weed Detection in Fresh Maize Field

2.2.1. YOLO-GFD Weed Detection Model

YOLOv8 [20] is one of the achievements in Ultralytics’ YOLO series of object detection algorithms, comprising five model variants of different sizes: YOLOv8n [21], YOLOv8s [22], YOLOv8m [23], YOLOv8l [24], and YOLOv8x [25]. These models share the same fundamental architecture but differ in depth and width. Among them, YOLOv8n [26,27,28] offers the fastest detection speed with the fewest parameters. When detecting weeds in sweet corn fields, the YOLOv8n model performs feature extraction through feature weighting. However, the complex field backgrounds of sweet corn crops and the frequent occlusion of weeds lead to false positives and false negatives during target detection, thereby compromising the accuracy of information extraction. Furthermore, achieving model lightweighting while maintaining detection accuracy remains a critical challenge in practical applications. Therefore, to address weed detection challenges in sweet corn fields, we propose improvements based on the YOLOv8n algorithm. For mobile deployment issues, we suggest replacing the original backbone network with GAM-StarNet, enhancing feature capture capabilities without significantly increasing computational complexity. To prevent misdetection damage to seedlings due to morphological similarities between sweet corn seedlings and weeds, we introduce the C2f-Faster-CAMB module, which accelerates inference while ensuring efficient feature extraction by the backbone network. The final YOLO-GFD integrated model architecture is illustrated in Figure 2.

2.2.2. GAM-StarNet Network

To further enhance the model’s performance in object detection tasks, strengthen feature extraction capabilities, and reduce computational load and parameter complexity, this paper replaces the original backbone network with StarNet. By leveraging StarNet’s star operation, the model effectively captures complex, high-dimensional, and nonlinear feature spaces within a low-dimensional input space. These features are crucial for distinguishing key details between crops and weeds, thereby directly improving classification accuracy and significantly reducing misclassifications. In single-layer neural networks, StarNet merges the weight matrix and bias into a single entity. represented as ω = [ W b ] , where ω denotes the weight matrix and b denotes the bias term. The input vector X is expanded into a matrix containing a constant term (typically 1), x = [ X 1 ] . Following this operation, StarNet implements the star operation ω T 1 x × ω T 2 x . This approach simplifies linear transformation calculations by uniformly processing weight matrices and biases, eliminating the need for separate bias handling. Stacking multiple layers of star operations enables exponential expansion of the latent dimension. This model features a compact network architecture and efficient star-shaped operations, reducing redundant information. It is well-suited for the weed detection and mobile deployment problems proposed in this paper. Therefore, the C2f module in the YOLOv8n backbone is replaced with StarNet in this work.
To further enhance the model’s ability to extract weed features, this paper combines GAM with the StarNet network to form the GAM-StarNet module, whose structure is shown in Figure 3. This module incorporates GAM, whose architecture comprises two components: channel attention and spatial attention. The channel attention component preserves cross-dimensional information through 3D rearrangement. It employs a multilayer perceptron to perform feature dimension reduction and elevation, generating channel weight coefficients. Feature structural consistency is restored via inverse rearrangement and activation functions, followed by element-wise multiplication with the original features to enhance the expression of salient characteristics. The spatial attention component fuses spatial information through two 7 × 7 convolutions to generate spatial weight coefficients. After normalization via an activation function, these coefficients are multiplied element-wise with the channel-weighted feature map to further optimize spatial feature representation.
Table 1 presents the performance comparison results based on different module combinations of the YOLOv8n model. Compared to the baseline model, introducing either StarNet or GAM individually can enhance detection performance to a certain extent. Specifically, the parameter count of YOLOv8n + StarNet is only 2.9 M, with a computational cost of 8.2 G FLOPs. Its feature extraction capability is limited, and the mAP@0.5 only increases to 86.92%. Although YOLOv8n + GAM enhances the model’s feature expression ability, raising the mAP@0.5 to 89.34%, the model complexity significantly increases, with the parameter count rising to 4.7 M and the computational cost reaching 9.2 G FLOPs, making it unsuitable for deployment on mobile devices. Specifically, the parameter count of YOLOv8n + StarNet is only 2.9 M, with a computational cost of 8.2 G FLOPs. Its feature extraction capability is limited, and the mAP@0.5 only increases to 86.92%. Although YOLOv8n + GAM enhances the model’s feature expression ability, raising the mAP@0.5 to 89.34%, the model complexity significantly increases, with the parameter count rising to 4.7 M and the computational cost reaching 9.2 G FLOPs, making it unsuitable for deployment on mobile devices.

2.2.3. C2f-Faster-CAMB Module

Due to the striking morphological similarity between early-stage sweet corn seedlings and weeds, this study combined the MBConv module and CA attention mechanism from the Efficient network to design CAMB (CA + MBConv). This module was integrated with FasterBlock to replace the Bottleneck module in C2f, enhancing the backbone network’s feature extraction capabilities while balancing computational load and ensuring efficient feature extraction. The FasterBlock architecture is illustrated in Figure 4.
MBConv [29] incorporates a depthwise separable convolution layer and a linear transformation layer. The depthwise separable convolution layer performs convolution on each channel individually before merging all channels. This approach reduces network parameters and computational complexity, enhancing model efficiency. The CA (Coordinate Attention) mechanism [30] is an attention mechanism designed to enhance deep learning models’ understanding of the spatial structure within input data. The core idea of the CA attention mechanism is to incorporate coordinate information, enabling the model to better understand relationships between different positions. By integrating the MBConv module from the Efficient network with the CA attention mechanism module, we obtain the CAMB module. Combining this with the FasterBlock module yields the C2f-Faster-CAMB module. The specific structure of the CAMB module is shown in Figure 5. Replacing the Bottleneck in C2f with the FasterBlock-CAMB module yields the C2f-Faster-CAMB module. PConv enables FasterBlock to achieve faster speeds and reduced parameters while maintaining limited accuracy loss. The BN module in FasterBlock is integrated with adjacent Conv modules to accelerate inference speed. The improved module not only enhances the feature extraction capability of the backbone network but also ensures efficient feature extraction while balancing computational complexity.
Table 2 presents ablation results for the C2f module under different improvement strategies. Compared to the original C2f module, introducing CA, MBConv, or FasterBlock individually enhances model performance across various dimensions. However, each standalone strategy exhibits a significant trade-off between accuracy and efficiency. Specifically, C2f + MBConv achieves a significant reduction in parameter scale and computational cost, but only a marginal improvement in feature extraction capability (resulting in a mAP@0.5 of merely 89.47%), with a smaller gain margin than other enhancement schemes. Although C2f + CA realizes a notable increase in mAP@0.5, its improvement in precision and recall is lower than that of C2f + FasterBlock, accompanied by an increase in computational cost. C2f + FasterBlock demonstrates excellent performance in precision, recall and mean average precision, yet the growth in model parameters and computational demand hinders its lightweight deployment. In contrast, C2f-Faster-CAMB achieves an optimal balance between performance and efficiency by integrating the complementary advantages of multiple modules: this module not only delivers the best overall performance across the metrics of Precision, Recall, and mAP@0.5, but also optimizes the parameter count to 3.55 M and controls the computational complexity at 8.3 G FLOPs while maintaining high precision. Experimental results demonstrate that this strategy maximizes the feature representation capability and effectively addresses the limitations of a single module in terms of parameter redundancy or computational cost.

2.2.4. Detect-GSC Detection Head

To enhance object detection accuracy while reducing computational overhead, this paper proposes the Detect-GSC module by structurally modifying the original detection head of YOLOv8n. The original detection head consists of decoupled classification and regression branches, but its convolutional structure relies heavily on traditional convolution operations, resulting in high computational demands and low feature fusion efficiency. To address this issue, this paper introduces the GSConv (Ghost-Shuffle Convolution) module and employs a cascaded structure to achieve lightweight design for the detection head. In the Detect-GSC design, input features first undergo two stages of GSConv operations. The GSConv module generates lightweight features via Ghost convolution, then efficiently blends inter-channel features using a Shuffle mechanism, significantly reducing computational complexity while enhancing feature expressiveness. This operation not only replaces traditional convolutional layers but also optimizes the feature processing pipeline, enabling the detector head to maintain high accuracy while reducing parameter count and computational load. Subsequently, the optimized features are passed through two simple Conv2d layers to the classification and regression branches, respectively. This design preserves the decoupled architecture of the original YOLOv8n model, allowing independent optimization of classification and regression tasks.
Compared to the original YOLOv8n detector head, Detect-GSC achieves a significant reduction in model parameters and computational complexity through the introduction of the GSConv module, making it suitable for real-time detection and resource-constrained scenarios. Second, Detect-GSC employs a two-stage GSConv to enhance the coupling effect between spatial and channel features, thereby improving detection accuracy in complex scenarios. Furthermore, the lightweight feature processing accelerates model inference, further boosting real-time performance. By preserving the original decoupled detector head architecture, Detect-GSC ensures the independence of classification and regression tasks along with training stability, enabling the model to maintain strong robustness even in challenging environments.

2.2.5. Improvement of the W I o U Loss Function

The Wise-IoU loss function is a loss function designed for object detection tasks. In traditional object detection tasks, category imbalance is a common phenomenon [31,32]. The conventional Intersection over Union ( I o U ) loss function may cause models to favor learning more abundant categories when handling category imbalance, thereby compromising detection performance for low-frequency categories. The W I o U loss function addresses category imbalance by weighting the IoU value of each object bounding box, thereby enhancing overall object detection performance. In the original YOLOv8 network, the regression branch used to compute the coordinate loss for predicting weed locations in sweet corn fields employs a full I o U loss, as shown in Equation (1).
L C I o U = 1 I o U + p 2 b , b g t c 2 + α ν
In the equation, L C I o U denotes the complete intersection over union loss function; p 2 b , b g t   represents the Euclidean distance between the center point of the predicted bounding box and the center point of the ground truth bounding box; c is the diagonal length of the minimum bounding rectangle between the predicted and ground truth bounding boxes; α is the balance parameter; ν is the aspect ratio measurement parameter. When C I o U overlaps with the ground truth box, the aspect ratio penalty term becomes ineffective during model training and simultaneously impacts training performance. Therefore, improving the loss function calculation using W I o U , as shown in Equation (2), enhances the model’s ability to locate and detect the center points of sweet corn weeds in complex backgrounds, thereby further improving recognition accuracy.
L W I o U = β δ α β δ e x p ( x x g t ) 2 + ( y y g t ) 2 ( W g 2 + H g 2 ) L I o U
In the formula, L I o U denotes the Intersection over Union loss function; L I o U denotes the Weighted Intersection over Union loss function; x, x_gt, y, y_gt represent the center coordinates of the ground truth bounding box and the predicted bounding box, respectively; W ,   H denote the width and height of the minimum bounding rectangle for the ground truth bounding box and the predicted bounding box, respectively; α ,    δ are the model’s learning parameters; β is the quality parameter of the bounding box. The loss function x x g t 2 + y y g t 2 W g 2 + H g 2 constitutes the dynamic weighting. By scale-normalizing the variance of center point offsets, it transforms a purely geometric error metric into a dynamic metric scaled relative to the target’s dimensions. For large target weeds, since large targets tolerate greater center point errors, the penalty weight for the same center point offset is relatively smaller. For small or densely clustered weeds, the same offset is amplified, yielding larger gradients during training. This focuses the model on precisely locating small targets, directly enhancing detection accuracy for weed centers. Consequently, the model adaptively adjusts optimization priorities based on target size, significantly improving localization precision for small weeds.
The dynamic learning parameters α ,    δ introduced in the formula, together with the bounding box quality parameter δ , collectively form an adaptive adjustment mechanism for bounding boxes. Parameter δ is used to evaluate the quality of the current predicted box. High-quality predicted boxes undergo stable optimization, while low-quality predicted boxes receive enhanced refinement. Learning parameters α ,    δ enable the model to autonomously learn optimal weight allocation strategies for samples of varying difficulty during training, without relying on manually set fixed hyperparameters. This significantly enhances the model’s robustness and convergence capability in complex scenarios. By transforming static geometric metrics into dynamic, scale and quality-weighted losses through an improved loss function, the model’s training process in complex field environments is optimized. This enables the model to focus more precisely on hard-to-detect weeds, thereby enhancing overall localization accuracy and recognition rates.

3. Results and Discussion

3.1. Experimental Environment and Hyperparameter Settings

In order to ensure the impartiality of the field weed detection experiments in sweet corn, all experiments involved in this study were carried out with the same equipment. The hardware and software configurations of the experiments are shown in Table 3. Configuring Python 3.8 and CUDA Toolkit 11.8 under Windows 10 operating system environment, a convolutional neural network structure with Pytorch framework as the core is built.
In the model parameter setting, the initial learning rate is set to 0.001; the batch size is set to 16; the number of study rounds is set to 200; the momentum is set to 0.94; and the weight attenuation rate is set to 0.0005, as shown in Table 4.
Table 5 shows the experimental results using the SGD and AdamW optimizer in the same experimental environment. Under the same experimental environment, different optimizers are basically the same in terms of model accuracy, precision, and recall. Although AdamW needs to maintain additional momentum variables, its adaptive learning rate properties allow faster convergence, reducing overall training time overhead. Considering that the core goal of this study is to design a lightweight model suitable for edge device deployment with high accuracy and fast convergence speed, we finally chose AdamW as the optimizer for all experiments, and subsequent experiments are also based on the AdamW optimizer.

3.2. Evaluation Indicators

This paper employs precision (P), recall (R), mean average precision (mAP), frames per second (FPS), number of parameters, and floating-point operations per second (GFLOPs) as experimental evaluation metrics. Some calculation formulas are as follows. In object detection tasks, mAP@0.5 and mAP@0.5-0.95 are used to denote the mean average precision at the Intersection over Union (IoU) thresholds of 0.5 and 0.5 to 0.95, respectively.
P = T P T P + F P
R = T P T P + F N
A P = 0 1 P r d r  
m A P = 1 C i = 1 c A P i
P a r a m e t e r s = i × f × f × ο + ο
F 1 = 2 × P R P + R
In the formula, TP denotes the number of positive samples correctly predicted as true, FP represents the number of negative samples falsely detected as positive, and FN indicates the number of positive samples that were not detected. C represents the number of categories. i denotes the input size, f denotes the convolution kernel size, and ο denotes the output size.

3.3. Comparison Experiments of Replacing the Model’s Backbone Network

To evaluate the performance advantages of the network GAM-StarNet when replacing the YOLOv8 backbone, this paper selected the original YOLOv8n model and four lightweight models—ShuffleNetV2 [33], EfficientViT, MobileNetV4 [34], and FasterNet—to replace the backbone network for comparative experiments. All models were tested under a unified experimental environment to ensure fairness of results. Specific experimental results are shown in Table 6.
In this experiment, the proposed GAM-StarNet backbone network demonstrates significant advantages in both performance and efficiency. It outperforms other comparative models in terms of accuracy, recall, and mAP@0.5, achieving optimal precision with an extremely low number of parameters and computational resources. Compared to other models, ShuffleNetV2 slightly reduces computational complexity and parameter complexity, yet its performance remains marginally inferior to the YOLOv8n + GAM-StarNet model. While EfficientViT and MobileNetV4 models demonstrate acceptable performance, their parameter counts and computational complexity increase exponentially, yielding only limited performance gains. Consequently, they are unsuitable for mobile deployment due to their excessive parameter requirements and computational resource demands. The original YOLOv8n and ShuffleNetV2 models exhibit high efficiency, but their detection accuracy fails to meet requirements under the complex conditions of this task. Compared to YOLOv8n, GAM-StarNet exhibits superior performance, with a significant increase in detection accuracy compared to the original model, and a reduction in computational load. Specifically, it improves mAP@0.5 by 2.1 percentage points while reducing computational load by 4.6%.

3.4. Ablation Experiment

To evaluate the effectiveness of the introduced method in detecting weeds, this study conducted ablation experiments using YOLOv8n as the baseline model. To ensure a fair evaluation of the contribution of each model component, all compared models were trained and evaluated under the same experimental settings described in Section 3.1, including identical dataset splits, input image sizes, training parameters, hardware environments, and evaluation metrics. Table 7 presents data from six experimental groups. Notably, replacing each module individually reduced both computational complexity and the number of parameters.
As reported in Table 7, Model-1, Model-2, and Model-3 were designed to evaluate the independent contribution of GAM-StarNet, C2f-Faster-CAMB, and Detect-GSC, respectively. Models 4–6 were used to evaluate pairwise combinations of these modules. Model-4 combined GAM-StarNet and C2f-Faster-CAMB, Model-5 combined GAM-StarNet and Detect-GSC, and Model-6 combined C2f-Faster-CAMB and Detect-GSC. The final YOLO-GFD integrated all three structural modules and replaced the original CIoU loss with WIoU. Combining GAM-StarNet, C2f-Faster-CAMB, Detect-GSC, and the WIoU loss raises the model performance to 95.73% mAP@0.5 and 69.9% mAP@0.5–0.95, which are 10.61 and 8.10 percentage points higher than YOLOv8n, respectively. Meanwhile, the overall computation drops from 8.7 G to 8.1 G FLOPs, suggesting that the accuracy gain mainly comes from more effective feature utilization rather than simply increasing model capacity. The superior performance of YOLO-GFD is largely related to how it addresses the typical difficulties of field weed detection—dense background textures, small weeds, and frequent occlusion by crop leaves. GAM-StarNet helps the network concentrate on weed/crop cues and reduces distraction from soil and leaf textures. Importantly, this attention enhancement is achieved with improved efficiency, as parameters and FLOPs are reduced by 5.68% and 4.6%, respectively. In contrast, the C2f-Faster-CAMB block mainly strengthens feature extraction and fusion. This is consistent with the ablation result where adding it alone increases mAP@0.5 by 7.59 percentage points, indicating that the module is particularly effective at retaining discriminative details that tend to be lost for small or partially covered targets. Finally, introducing WIoU improves box regression by putting more emphasis on hard-to-localize samples, leading to tighter boxes and more stable localization; this effect is better captured by the improvement in the stricter mAP@0.5–0.95 metric. Overall, although YOLO-GFD slightly increases the number of parameters compared with YOLOv8n, it still keeps the computational burden low and delivers the most accurate detection among the tested configurations.
To verify whether the improved method introduced in this paper focuses more on the characteristics of weeds and sweet corn crops themselves, this study employs a saliency map visualization algorithm to compare the regions of interest between the original and improved networks. To visually demonstrate the effective information extracted by the improved model, multiple heatmap methods are used to visualize the sweet corn weed images. As shown in Figure 6, the visualization heatmaps reveal that the YOLOv8n model is affected by background information unrelated to the characteristics of weeds and sweet corn. Subsequent figures demonstrate varying degrees of color response in the network toward sweet corn and weed regions across different improvement methods. Notably, the YOLO-GFD model exhibits significantly higher and more stable attention toward sweet corn and weeds. The highlighted areas correlate strongly with the extraction level of target category information, reflecting the model’s focus on weeds and crops. These results demonstrate that the introduced GAM attention mechanism synergizes effectively with the StarNet backbone network. This collaboration significantly enhances the model’s ability to distinguish weeds from complex backgrounds, improving accuracy and robustness in practical applications and enabling more precise weed detection.

3.5. Comparative Experiments of Different Models

To further evaluate the detection performance of the improved network model on field weeds in sweet corn crops, comparative experiments were conducted between the proposed model and current mainstream detection networks under identical datasets, experimental environments, and network parameter configurations. These included YOLOv5s [35], YOLOv7-tiny [36], YOLOv8s, YOLOv8n, YOLOv9s, and the latest models YOLOv13 [37], as well as Faster-RCNN [38] and SSD [39] models. Model performance was evaluated using accuracy, recall, and mean average precision on the test set, while model complexity was assessed by parameter count and floating-point operations. Experimental results are presented in Table 8.
As summarized in Table 8, YOLO-GFD delivers the most balanced performance among the evaluated detectors in terms of recall, average precision, model size, computational cost, and inference speed. Compared with YOLOv13, the strongest baseline in our comparison, YOLO-GFD maintains a comparable recall with a slight increase of 0.02 percentage points, achieves an improvement of 3.6 percentage points in average precision, and reduces computational complexity by 55.42%. Although the model size increases modestly, the overall footprint remains sufficiently compact for real-time field operation, and the total computation cost reaches 8.1 GFLOPs, which remains compatible with edge deployment requirements. Overall, these results indicate that YOLO-GFD offers a practical trade-off between detection accuracy and computational efficiency for fresh-eating corn seedling weed detection.
These results are consistent with trends reported in the object-detection literature: one-stage YOLO-family detectors are typically favored in on-machine agricultural scenarios because they offer real-time inference, whereas two-stage frameworks such as Faster R-CNN, despite strong representation capacity, are often constrained by heavier parameters and lower throughput. In our experiments, Faster R-CNN and SSD exhibit much lower FPS due to their higher computational demand, which limits their suitability for time-critical tasks such as closed-loop actuation. By contrast, YOLO-GFD maintains high-speed inference and, at the same time, achieves higher accuracy than the YOLOv8 baseline, indicating that the proposed modifications improve feature utilization under field conditions rather than relying on brute-force model scaling. When compared with lightweight YOLO variants commonly used for embedded deployment, YOLO-GFD also shows a clear advantage. Relative to YOLOv5s, YOLO-GFD improves mAP@0.5 by 17.51 percentage points, increases speed by 45 FPS, and reduces parameters by 3.92 M. Relative to YOLOv7-tiny, it improves mAP@0.5 by 4.77 percentage points, increases speed by 29 FPS, and reduces parameters by 2.65 M. Overall, with only 3.51 M parameters and 8.1 G computation, YOLO-GFD strikes a practical balance between detection accuracy and latency, making it more aligned with mobile deployment requirements in agricultural machinery.
From the perspective of laser weeding, this balance is not merely an efficiency preference but a safety and effectiveness requirement. A laser weeding system must localize weeds accurately and respond quickly; false positives on crop tissues can lead to crop injury, while missed weeds reduce control efficacy. In this study, YOLO-GFD achieves 95.77% precision and 95.01% recall, suggesting more reliable identification of weeds under occlusion and cluttered backgrounds, which is critical for reducing the risk of erroneous laser activation near corn seedlings.
Figure 7 further indicates stable training behavior. The training loss decreases steadily and converges after approximately 100 epochs, reflecting an effective optimization process. Although the validation loss shows some fluctuation in the later training stage, this behavior is understandable given the complexity of the dataset, which contains many small and partially occluded weed targets under realistic field conditions. Compared with the baseline models in Table 8, YOLO-GFD achieved higher detection accuracy with fewer parameters and lower GFLOPs, indicating that the stable convergence shown in Figure 7 was accompanied by improved detection performance and lightweight characteristics. Overall, the training curves, together with the final detection metrics, support the effectiveness and robustness of the proposed YOLO-GFD model for sweet corn seedling weed detection.

3.6. Field Simulation Experiment of Weed Detection Model

In order to evaluate the performance of YOLO-GFD model in the actual working environment, a simulated field test platform was built under controllable laboratory conditions, and the real-time weed detection rate and false detection rate were quantitatively evaluated. The experimental environment is shown in Figure 8. Deploy the trained YOLO-GFD model on the NVIDIA Jetson TX2 edge computing device. The device is equipped with 256 NVIDIA Pascal ™ architecture CUDA cores, equipped with 8 GB LPDDR4 memory, and runs the Ubuntu 18.04-based JetPack SDK. The image acquisition system is an RGB camera with a resolution of 1920 × 1080, connected to a Jetson TX2 via a USB 3.0 interface. The whole system is installed on an electric four-wheel drive agricultural machinery soil tank test tractor. The simulation test was carried out in an artificially constructed soil tank. The test area was 20 m long and 1.8 m wide, and the row spacing of the simulated sweet corn field was 50 cm. Sweet corn seedlings and weeds were uniformly arranged in the soil trough according to the predetermined density. The speed of the algorithm is that the tractor can process 147 frames of images for every 1 s forward. The YOLO-GFD model performs weed detection and location on each frame of the image, and outputs the detection results with bounding boxes in real time.
In actual testing, the YOLOv8n model achieved an accuracy rate of 85.1% and a recall rate of 88.3% for detecting 200 weed test images, mAP@0.5, and it is 90.2%. Unlike the YOLOv8n model, the model proposed in this paper has an accuracy of 92.8% and a recall rate of 90.7% for weed detection, mAP@0.5. At 92.1%, compared to the original model, the accuracy, recall, and mAP of weed detection increased by 7.7, 2.4, and 1.9 percentage points, respectively. The model testing results are shown in Table 9 and Table 10. As shown in Figure 9, the yellow circles indicate missed detections, while the green circles represent false positives. The YOLOv8n model exhibits a certain degree of missed detections and false positives. In contrast, the YOLO-GFD model accurately identifies every target even under field testing conditions. Although missed detections occur under severe occlusion, given the high cost of sweet corn, weeds surrounding crops can be safely ignored to prevent accidental damage. This demonstrates that the YOLO-GFD model still delivers robust performance in practical applications.
Additionally, we conducted four trials in the experimental field, each involving 60 corn seedlings and 60 weed plants. The trials assessed real-time identification and localization of weeds across different varieties and densities to evaluate weed recognition rates and seedling damage rates. The weed center coordinate was obtained from the center point of the detection box corresponding to the actual weed area. Results shown in Figure 10 indicate a weed detection rate of 93.1% and a corn seedling misdetection rate of 1.1%. This demonstrates that the improved model maintains robust detection performance in practical applications, avoiding false positives and false negatives even under complex conditions with clustered targets. It accurately identifies and locates each target, meeting the demands of real-time field detection. The high precision weed localization capability provides reliable target coordinates for subsequent laser weeding systems, ensuring precise laser application to weeds while avoiding crop damage. This further validates the strategy’s effectiveness in weed detection for laser weeding applications, offering robust technical support for automated agricultural weed control.

3.7. Laser Weeding Experiment

3.7.1. Pre-Experiment Preparation

Although lasers can achieve rapid weed control, their eradication effectiveness is jointly constrained by laser output power and irradiation duration. To establish optimal laser parameters for single-plant weed elimination, this study conducted preliminary laser weeding trials. To quantify the mechanisms by which key parameters such as laser power and irradiation time influence weeding efficiency, experiments employed a 110 W near-infrared laser and a 110 W blue laser, both with adjustable power and irradiation duration. The near-infrared laser has a wavelength of 808 nm, whilst the blue laser has a wavelength of 450 nm. Both devices support continuous power adjustment of 0–110 W, and accurately control the output power and irradiation time through the RS232 interface through the host computer software. The laser beam forms a fixed spot with a diameter of 1 mm after collimation, and the laser adopts an air-cooled system to ensure working stability. The laser parameters used in the experiments are shown in Table 11.
The experimental site is illustrated in Figure 11, using the blue laser as an example. Weeds for the laser weeding experiments were sourced from the experimental fields of Jilin Agricultural University. Purslane (Portulaca oleracea L.) seedlings in sweet corn fields most closely resemble sweet corn seedlings in morphology and are the most common and densely occurring weed species in such fields. Therefore, purslane seedlings in the 2- to 4-leaf stage were uniformly used as weed samples. No strict restrictions were imposed on larger-stage weed species to facilitate laser removal of early-stage weeds and enhance the generalizability of the results. Weed samples were collected from the field 24 h prior to the experiment and uniformly transplanted into culture trays to maintain their viability during laser treatment.
The experiment was carried out on an indoor experimental bench, and the laser head was fixed vertically at 1 mm to ensure that the light spot accurately irradiated the base of the weed stalk. A two-factor experimental design was adopted to systematically evaluate the influence of power and time on weed growth. The power factors were set at four levels: 110 W, 75 W, 50 W, and 25 W. For each combination of power and irradiation time, three independent weed samples were tested as three replications under the same experimental conditions, and the treatment outcome was assessed immediately after irradiation. The success of laser weeding depends on whether the weeds suffer irreversible fatal damage, usually manifested as leaf drop or complete scorching of stems, as well as the survival of weeds within one week after laser treatment. That is, immediate weed control effect (1 day), short-term recovery ability (3 days), and medium-term regeneration potential (7 days). In order to eliminate experimental contingency and ensure the accuracy of experimental results, each combination of power-time parameters was performed 3 independent replications, that is, 3 independent weed samples were used for each combination, and a total of more than 150 weed samples were irradiated. Only when three treatments can kill weeds successfully can the laser parameter be judged to be valid.

3.7.2. Near-Infrared Laser Weeding Experiment

The experimental results of NIR laser irradiation on weeds are shown in Figure 12 and Table 12. At a power of 110 W, irradiation durations of 100 ms, 70 ms, and 50 ms were used in three experiments, all of which successfully removed weeds. When the irradiation duration was 30 ms, only one of the three laser experiments successfully removed weeds. Therefore, the optimal irradiation time for weed removal with the 110 W NIR laser ranges between 30 ms and 50 ms. At 75 W power, all three experiments with irradiation times of 100 ms, 70 ms, and 50 ms successfully removed weeds. At 40 ms irradiation time, one experiment failed. When irradiation time was reduced to 30 ms, the weed removal success rate dropped to zero. Thus, the minimum effective duration for 75 W NIR laser weed removal was determined to be between 40 ms and 50 ms.
For lower-power 50 W and 25 W lasers, weeding efficiency further decreased: only one successful removal occurred at 50 W with 100 ms irradiation, while both 50 W and 25 W required irradiation times exceeding 1500 ms to be effective. Given the stringent processing efficiency requirements of real-time weeding robot systems, these exposure durations are impractical for real-world applications. Consequently, no further experimental studies were conducted on these two lower-power configurations. Figure 12A shows partial experimental results of weed removal after 110 W NIR laser irradiation for 100 ms, 70 ms, and 50 ms, respectively. Figure 12B presents partial experimental results of weed removal after 75 W NIR laser irradiation for 100 ms, 70 ms, and 50 ms, respectively.

3.7.3. Experiment of Weeding with Blue Laser

The experimental results of blue laser irradiation on weeds are shown in Table 13. At a power of 110 W, weed removal was successfully achieved in all repeated experiments with irradiation durations of 100 ms, 70 ms, 50 ms, and 20 ms. When the irradiation time was reduced to 15 ms, the weed removal success rate dropped to 66%, with two out of three experimental groups achieving success. When irradiation time was reduced to 10 ms, the treatment became completely ineffective. Therefore, the minimum effective duration for 110 W blue laser weed removal ranges between 15 ms and 20 ms. At 75 W power, blue laser irradiation times of 100 ms, 70 ms, and 50 ms successfully removed weeds in all experiments. When irradiation time decreased to 30 ms, one out of three experiments succeeded. At 20 ms irradiation time, all experiments failed.
Thus, the minimum weed removal time for the 75 W blue laser ranges from 30 ms to 50 ms. A 50 W blue laser struggled to guarantee stable weed removal even at 100 ms irradiation, with its efficiency failing to meet rapid weed control demands. This indicates that power reduction significantly impacts efficiency: compared to higher power, lower power extends exposure time, compromising practical weed control. Figure 13A shows weed removal results after 70 ms, 50 ms, and 20 ms exposure to a 110 W blue laser. Figure 13B shows laser weed control experimental results after irradiating weeds with a 75 W blue laser for 100 ms, 70 ms, and 50 ms, respectively. Under the tested experimental conditions, the 110 W blue laser with an irradiation duration of 15–20 ms showed the best weed removal performance among the tested parameter combinations.
Comparative results from laser weeding experiments between NIR and blue lasers indicate that 110 W blue laser and 110 W NIR laser exhibit essentially equivalent weed control efficacy. However, the reliable weed removal time thresholds for 110 W near-infrared laser and 110 W blue laser are approximately 30–50 ms and 15–20 ms, respectively. Furthermore, during laser weed control, the effectiveness of weed control is influenced not only by laser power and exposure time, but is also closely related to the absorption characteristics of weeds with respect to lasers of specific wavelengths. Experimental results indicate that when the NIR laser has a power of 110 W, an energy density of approximately 7 J/mm2 is required to achieve stable and effective weed control; whereas when the blue laser has the same power of 110 W, an energy density of only approximately 2.8 J/mm2 is sufficient to achieve stable and effective weed control. The irradiation time range for both lasers was 0.2–0.5 ms. These results indicate that purslane absorbs 450 nm wavelength laser light significantly better than 808 nm wavelength laser light; Consequently, under identical power conditions, the 450 nm blue laser is capable of achieving effective weed control with lower energy input and shorter exposure times, demonstrating superior energy utilisation efficiency; it is therefore more suitable for laser weed control operations under the conditions of this experiment.
Having established the optimal laser treatment parameters, we then conducted experimental observations of the weed control efficacy, specifically the survival of weeds within one week of laser treatment. We irradiated the weeds with a 110 W blue laser for 20 ms, and observed weed regrowth at 0, 3 and 7 days post-treatment. To determine the survival status of the weeds, we made a comprehensive assessment based on indicators such as whether the plants remained green immediately after treatment, whether new leaves had emerged, and whether the growing points were still viable.
Using preliminary test parameters of 110 W and an irradiation duration of 20 ms, the weeds were subjected to laser irradiation, and their recovery capacity was observed during the immediate post-irradiation phase (0–1 day), the short-term recovery phase (3 days) and the mid-term regrowth phase (7 days). Repeat the experiment three times, as shown in Figure 14. The experimental results indicate that laser treatment has a significant weed-control effect. Following laser irradiation, the irradiated areas rapidly carbonized; three days after treatment, the scorched areas remained carbonized, with fallen leaves showing slight wilting and no signs of regaining their green colour; seven days after laser treatment, the weeds had completely withered, with no new leaves emerging or regrowth of the plants. The results indicate that the laser treatment parameters of 110 W and 20 ms not only effectively destroy the weeds’ above-ground tissues but also inflict fatal damage on their key growth sites. Furthermore, there were no instances where only the leaves were damaged whilst the growth points or root systems remained unaffected, which might otherwise have led to regrowth within a week. Consequently, this combination of parameters demonstrated excellent weed control efficacy and long-lasting suppression, thereby meeting the requirements for laser weed control in this experiment.

4. Conclusions

To guide the application of laser precision weed control, this study proposes a YOLO-GFD model for detecting weeds in sweet corn fields. This model addresses the limitations of the YOLOv8n model, including low detection accuracy, complex architecture, and slow processing speed. The specific improvements are as follows:
(1) A weed dataset was constructed for sweet corn field environments to enable the model to learn key weed features and enhance robustness in complex field backgrounds. The dataset comprises 3200 images, expanding to 5350 images after data augmentation.
(2) Build YOLO-GFD model, integrate GAM attention mechanism into StarNet to form GAM StarNet, replace YOLOv8n’s backbone network with GAM StarNet, and use star operation to capture high-dimensional and nonlinear feature space from low dimensional input. Replace the residual blocks in the neck C2f module with Faster CAMB, construct and use a Detect GSC detection head, and introduce an improved WIoU loss function to balance the training effect on different quality weed images, resulting in better convergence performance and reduced computational complexity of the model. The experimental results indicate that the YOLO-GFD model performs well in recognition on the test set mAP@0.5. Compared to the original model, it has improved by 10.61 percentage points, reduced floating-point computation by 0.6 percentage points, and achieved an average accuracy of 95.77%. The comprehensive experimental results show that the proposed method significantly enhances the feature perception of weeds in the model and improves the overall generalization ability of the model.
(3) Comparative experiments were conducted between the improved model and current mainstream detection networks. Results demonstrate that the improved model achieves higher accuracy, lower model complexity, and superior overall performance. It provides effective weed targeting points for laser weeding while minimizing collateral damage to crops.
(4) Deploying the model onto edge computing devices with limited computational resources, simulated field experiments demonstrated a weed recognition rate of 93.1% and a corn seedling misdetection rate of 1.1%, meeting agronomic requirements for field weeding.
(5) Weeding experiments were conducted using 110 W near-infrared and 110 W blue light lasers at varying power levels. The 110 W blue laser achieved reliable weed removal in approximately 15–20 milliseconds, operating at roughly twice the speed of the 110 W near-infrared laser. The 110 W blue laser better meets the speed requirements for real-time laser weeding machinery. It was determined that an irradiation duration of 15–20 milliseconds for the 110 W blue laser represents the optimal parameter for fulfilling real-time weeding demands.
The model proposed in this paper reduces complexity while balancing detection accuracy and speed for weeds in sweet corn fields, laying the foundation for autonomous laser weeding in sweet corn cultivation. Laser parameters obtained in the laboratory environment provide a foundation for field applications. Although field application results may exhibit variability, the laser parameters determined in this experiment can still effectively suppress weed growth. Even if they do not achieve the weed removal efficacy observed in the laboratory, they significantly impact the growth capacity of weeds. Although Portulaca oleracea L. was used as the representative target weed in the laser experiments, different weed species may vary in leaf structure, stem thickness, water content, and sensitivity to laser irradiation. Therefore, future work will include more weed species to further evaluate the general applicability of the proposed laser weeding system. Subsequent work will advance to the field trial stage, conducting laser weeding experiments in sweet corn fields to further optimize laser parameters. The next step will involve integrating laser equipment with galvanometers to further refine the field laser weeding system, thereby providing support for weed control in sweet corn fields.

Author Contributions

Conceptualization, Y.Z. (Yuqi Zhang); methodology, Y.Z. (Yuqi Zhang); software, Y.Z. (Yuqi Zhang) and X.W.; validation, Y.Z. (Yuqi Zhang); formal analysis, Y.Z. (Yuqi Zhang); investigation, Y.Z. (Yuqi Zhang) and X.W.; resources, Y.Z. (Yang Zhou); data curation, X.W.; writing—original draft preparation, Y.Z. (Yuqi Zhang); writing—review and editing, Y.Z. (Yuqi Zhang); visualization, L.F.; supervision, Y.X.; project administration, Y.X.; funding acquisition, Y.X. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Jilin Provincial Scientific and Technological Development Program, [grant number: 20260601061RC].

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Qu, Y.; Wang, C. Innovation and Tradition: Exploring the IPization Pathway of “Fresh Corn” Agricultural Products. Acad. J. Bus. Manag. 2024, 6. [Google Scholar] [CrossRef]
  2. Zuo, Y.; Li, W. An Improved UNet Lightweight Network for Semantic Segmentation of Weed Images in Corn Fields. Comput. Mater. Contin. 2024, 79, 4413–4431. [Google Scholar] [CrossRef]
  3. Sulzbach, E.; Scheeren, I.; Veras, M.S.T.; Tosin, M.C.; Kroth, W.A.E.; Merotto, A.; Markus, C. Deep learning model optimization methods and performance evaluation of YOLOv8 for enhanced weed detection in soybeans. Comput. Electron. Agric. 2025, 232, 110117. [Google Scholar] [CrossRef]
  4. Fan, X.; Sun, T.; Chai, X.; Zhou, J. YOLO-WDNet: A lightweight and accurate model for weeds detection in cotton field. Comput. Electron. Agric. 2024, 225, 109317. [Google Scholar] [CrossRef]
  5. Memon, M.S.; Chen, S.; Shen, B.; Liang, R.; Tang, Z.; Wang, S.; Zhou, W.; Memon, N. Automatic visual recognition, detection and classification of weeds in cotton fields based on machine vision. Crop Prot. 2025, 187, 106966. [Google Scholar] [CrossRef]
  6. Guzel, M.; Turan, B.; Kadioglu, I.; Basturk, A.; Sin, B.; Sadeghpour, A. Deep learning for image-based detection of weeds from emergence to maturity in wheat fields. Smart Agric. Technol. 2024, 9, 100552. [Google Scholar] [CrossRef]
  7. Goyal, R.; Nath, A.; Niranjan, U. Weed detection using deep learning in complex and highly occluded potato field environment. Crop Prot. 2025, 187, 106948. [Google Scholar] [CrossRef]
  8. Li, Z.; Wang, D.; Yan, Q.; Zhao, M.; Wu, X.; Liu, X. Winter wheat weed detection based on deep learning models. Comput. Electron. Agric. 2024, 227, 109448. [Google Scholar] [CrossRef]
  9. Fan, X.; Chai, X.; Zhou, J.; Sun, T. Deep learning based weed detection and target spraying robot system at seedling stage of cotton field. Comput. Electron. Agric. 2023, 214, 108317. [Google Scholar] [CrossRef]
  10. Patel, J.; Ruparelia, A.; Tanwar, S.; Alqahtani, F.; Tolba, A.; Sharma, R.; Raboaca, M.S.; Neagu, B.C. Deep Learning-Based Model for Detection of Brinjal Weed in the Era of Precision Agriculture. Comput. Mater. Contin. 2023, 77, 1281–1301. [Google Scholar] [CrossRef]
  11. Wessner, R.N.; Frozza, R.; Bagatini, D.D.d.S.; Molz, R.F. Recognition of weeds in corn crops: System with convolutional neural networks. J. Agric. Food Res. 2023, 14, 100669. [Google Scholar] [CrossRef]
  12. Ong, P.; Teo, K.S.; Sia, C.K. UAV-based weed detection in Chinese cabbage using deep learning. Smart Agric. Technol. 2023, 4, 100181. [Google Scholar] [CrossRef]
  13. Rahman, A.; Lu, Y.; Wang, H. Performance evaluation of deep learning object detectors for weed detection for cotton. Smart Agric. Technol. 2023, 3, 100126. [Google Scholar] [CrossRef]
  14. Cui, J.; Zhang, X.; Zhang, J.; Han, Y.; Ai, H.; Dong, C.; Liu, H. Weed identification in soybean seedling stage based on UAV images and Faster R-CNN. Comput. Electron. Agric. 2024, 227, 109533. [Google Scholar] [CrossRef]
  15. Zhao, J.; Tian, G.; Qiu, C.; Gu, B.; Zheng, K.; Liu, Q. Weed Detection in Potato Fields Based on Improved YOLOv4: Optimal Speed and Accuracy of Weed Detection in Potato Fields. Electronics 2022, 11, 3709. [Google Scholar] [CrossRef]
  16. Jia, Z.; Zhang, M.; Yuan, C.; Liu, Q.; Liu, H.; Qiu, X.; Zhao, W.; Shi, J. ADL-YOLOv8: A Field Crop Weed Detection Model Based on Improved YOLOv8. Agronomy 2024, 14, 2355. [Google Scholar] [CrossRef]
  17. Karim, M.J.; Nahiduzzaman, M.; Ahsan, M.; Haider, J. Development of an early detection and automatic targeting system for cotton weeds using an improved lightweight YOLOv8 architecture on an edge device. Knowl.-Based Syst. 2024, 300, 112204. [Google Scholar] [CrossRef]
  18. Shao, Y.; Guan, X.; Xuan, G.; Gao, F.; Feng, W.; Gao, G.; Wang, Q.; Huang, X.; Li, J. GTCBS-YOLOv5s: A lightweight model for weed species identification in paddy fields. Comput. Electron. Agric. 2023, 215, 108461. [Google Scholar] [CrossRef]
  19. Zheng, L.; Yi, J.; He, P.; Tie, J.; Zhang, Y.; Wu, W.; Long, L. Improvement of the YOLOv8 Model in the Optimization of the Weed Recognition Algorithm in Cotton Field. Plants 2024, 13, 1843. [Google Scholar] [CrossRef]
  20. Varghese, R.; Sambath, M. YOLOv8: A Novel Object Detection Algorithm with Enhanced Performance and Robustness. In Proceedings of the 2024 International Conference on Advances in Data Engineering and Intelligent Computing Systems (ADICS), Chennai, India, 18–19 April 2024; pp. 1–6. [Google Scholar]
  21. Ma, B.; Hua, Z.; Wen, Y.; Deng, H.; Zhao, Y.; Pu, L.; Song, H. Using an improved lightweight YOLOv8 model for real-time detection of multi-stage apple fruit in complex orchard environments. Artif. Intell. Agric. 2024, 11, 70–82. [Google Scholar] [CrossRef]
  22. Niu, W.; Lei, X.; Li, H.; Wu, H.; Hu, F.; Wen, X.; Zheng, D.; Song, H. YOLOv8-ECFS: A lightweight model for weed species detection in soybean fields. Crop Prot. 2024, 184, 106847. [Google Scholar] [CrossRef]
  23. Huang, Z.; Gouda, M.; Ye, S.; Zhang, X.; Li, S.; Wang, T.; Zhang, J.; Song, X.; Li, X.; He, Y. Advanced deep learning algorithm for instant discriminating of tea leave stress symptoms by smartphone-based detection. Plant Physiol. Biochem. 2024, 212, 108769. [Google Scholar] [CrossRef]
  24. Deng, B.; Lu, Y.; Li, Z. Detection, counting, and maturity assessment of blueberries in canopy images using YOLOv8 and YOLOv9. Smart Agric. Technol. 2024, 9, 100620. [Google Scholar] [CrossRef]
  25. Paneru, B.; Bist, R.; Yang, X.; Chai, L. Tracking dustbathing behavior of cage-free laying hens with machine vision technologies. Poult. Sci. 2024, 103, 104289. [Google Scholar] [CrossRef]
  26. Jin, T.; Han, X.; Wang, P.; Zhang, Z.; Guo, J.; Ding, F. Enhanced deep learning model for apple detection, localization, and counting in complex orchards for robotic arm-based harvesting. Smart Agric. Technol. 2025, 10, 100784. [Google Scholar] [CrossRef]
  27. Chen, J.; Fu, Y.; Guo, Y.; Xu, Y.; Zhang, X.; Hao, F. An improved deep learning approach for detection of maize tassels using UAV-based RGB images. Int. J. Appl. Earth Obs. Geoinf. 2024, 130, 103922. [Google Scholar] [CrossRef]
  28. Chen, H.; Wu, K.; Lin, H.; Zhou, H.; Zhou, Z.; Mai, Y.; Shi, L.; Zhang, M.; Ma, Z.; Lin, P.; et al. A real-time vision guidance method for autonomous longan picking by the UAV. Comput. Electron. Agric. 2025, 229, 109735. [Google Scholar] [CrossRef]
  29. Cui, J.; Zhang, Y.; Chen, H.; Zhang, Y.; Cai, H.; Jiang, Y.; Ma, R.; Qi, L. CSWin-MBConv: A dual-network fusing CNN and Transformer for weed recognition. Eur. J. Agron. 2025, 164, 127528. [Google Scholar] [CrossRef]
  30. Geng, L.; Chen, J.; Tie, Y.; Qi, L.; Liang, C. Dynamic gesture recognition using 3D central difference separable residual LSTM coordinate attention networks. J. Vis. Commun. Image Represent. 2025, 107, 104364. [Google Scholar] [CrossRef]
  31. Liu, J.; Wang, X. EggplantDet: An efficient lightweight model for eggplant disease detection. Alex. Eng. J. 2025, 115, 308–323. [Google Scholar] [CrossRef]
  32. Dong, X.; Zhang, L.; Xu, C.; Miao, Q.; Yao, J.; Liu, F.; Liu, H.; Lu, Y.-B.; Kang, R.; Song, B. Detection of pine wilt disease infected pine trees using YOLOv5 optimized by attention mechanisms and loss functions. Ecol. Indic. 2024, 168, 112764. [Google Scholar] [CrossRef]
  33. Zhu, S.; Gao, H. MC-ShuffleNetV2: A lightweight model for maize disease recognition. Egypt. Inform. J. 2024, 27, 100503. [Google Scholar] [CrossRef]
  34. Zhang, G.; Liao, T.; Chen, Y.; Zhong, P.; Shen, Z.; Li, D. Efficient one-stage detection of shrimp larvae in complex aquaculture scenarios. Artif. Intell. Agric. 2025, 15, 338–349. [Google Scholar] [CrossRef]
  35. Chuang, X.; Qiang, C.; Yinyan, S.; Xiaochan, W.; Xiaolei, Z.; Yao, W.; Yiran, W. Improved lightweight YOLOv5n-based network for bruise detection and length classification of asparagus. Comput. Electron. Agric. 2025, 233, 110194. [Google Scholar] [CrossRef]
  36. Li, J.; Li, C.; Zeng, S.; Luo, X.; Chen, C.P.; Yang, C. A lightweight pineapple detection network based on YOLOv7-tiny for agricultural robot system. Comput. Electron. Agric. 2025, 231, 109944. [Google Scholar] [CrossRef]
  37. Sharma, A.; Kumar, V.; Longchamps, L. Comparative performance of YOLOv8, YOLOv9, YOLOv10, YOLOv11 and Faster R-CNN models for detection of multiple weed species. Smart Agric. Technol. 2024, 9, 100648. [Google Scholar] [CrossRef]
  38. Kong, X.; Li, X.; Zhu, X.; Guo, Z.; Zeng, L. Detection model based on improved faster-RCNN in apple orchard environment. Intell. Syst. Appl. 2024, 21, 200325. [Google Scholar] [CrossRef]
  39. Su, R.; Yue, J.; Li, Z.; Jia, S.; Sheng, G. Detection and counting method of juvenile abalones based on improved SSD network. Inf. Process. Agric. 2024, 11, 325–336. [Google Scholar] [CrossRef]
Figure 1. Data preprocessing effect.
Figure 1. Data preprocessing effect.
Agriculture 16 01237 g001
Figure 2. Overall Model Structure Diagram.
Figure 2. Overall Model Structure Diagram.
Agriculture 16 01237 g002
Figure 3. Diagram of the GAM-StarNet network structure.
Figure 3. Diagram of the GAM-StarNet network structure.
Agriculture 16 01237 g003
Figure 4. FasterBlock structure diagram.
Figure 4. FasterBlock structure diagram.
Agriculture 16 01237 g004
Figure 5. Structure of CAMB.
Figure 5. Structure of CAMB.
Agriculture 16 01237 g005
Figure 6. Model attention visualization heatmaps. These attention scores are then visually represented as heatmaps, where deeper red color indicated higher attention or relevance to the class.
Figure 6. Model attention visualization heatmaps. These attention scores are then visually represented as heatmaps, where deeper red color indicated higher attention or relevance to the class.
Agriculture 16 01237 g006
Figure 7. Improve the accuracy and loss curve of the model training process.
Figure 7. Improve the accuracy and loss curve of the model training process.
Agriculture 16 01237 g007
Figure 8. Feasibility experiment on experimental environment and weed species detection.
Figure 8. Feasibility experiment on experimental environment and weed species detection.
Agriculture 16 01237 g008
Figure 9. Comparison of detection effects between two algorithms.
Figure 9. Comparison of detection effects between two algorithms.
Agriculture 16 01237 g009
Figure 10. Comparison chart of simulation experiment detection effect (a) YOLOv8n (b) YOLO-GFD.
Figure 10. Comparison chart of simulation experiment detection effect (a) YOLOv8n (b) YOLO-GFD.
Agriculture 16 01237 g010
Figure 11. Schematic diagram of laser weeding experimental site and equipment. (A) Laser weeding equipment. (B) Diagram of the weeding process and laser weeding results.
Figure 11. Schematic diagram of laser weeding experimental site and equipment. (A) Laser weeding equipment. (B) Diagram of the weeding process and laser weeding results.
Agriculture 16 01237 g011
Figure 12. Schematic diagram of weed removal experiment results of near-infrared with different laser powers.
Figure 12. Schematic diagram of weed removal experiment results of near-infrared with different laser powers.
Agriculture 16 01237 g012
Figure 13. Schematic diagram of weed removal experiment results of blue laser weeding with different laser powers.
Figure 13. Schematic diagram of weed removal experiment results of blue laser weeding with different laser powers.
Agriculture 16 01237 g013
Figure 14. Weed survival at different times.
Figure 14. Weed survival at different times.
Agriculture 16 01237 g014
Table 1. Module Combination Performance Comparison Experiment.
Table 1. Module Combination Performance Comparison Experiment.
ModelPrecision/%Recall/%mAP@0.5/%Parameters/MFLOPs/G
YOLOv8n86.9885.4585.123.178.7
YOLOv8n + GAM90.7186.9489.344.79.2
YOLOv8n + StarNet88.6286.2386.922.98.2
YOLOv8n + GAM-StarNet90.2386.8487.232.998.3
Table 2. Module Combination Performance Comparison Experiment.
Table 2. Module Combination Performance Comparison Experiment.
ModelPrecision/%Recall/%mAP@0.5/%Parameters/MFLOPs/G
C2f86.9885.4585.123.178.7
C2f + CA88.7589.9492.153.510.2
C2f+ MBConv93.1592.0189.472.97.2
C2f+ FasterBlock94.3293.0691.623.79.2
C2f-Faster-CAMB95.7795.0192.713.558.9
Table 3. Experimental environmental parameters.
Table 3. Experimental environmental parameters.
EnvironmentParameters
Operating SystemWindows10
CPUIntel(R)Xeon(R)Gold 6246R @ 3.40 GHz 32 cores
Memory128 GB
Deep learning frameworkPytorch-GPU 2.0
GPUNVIDIA Quadro RTX 4090D
CUDA versionCUDA Toolkit 11.8
Torchvision versionTorchvision 0.15.0
Table 4. Parameters for model training.
Table 4. Parameters for model training.
ParametersParameter Value
Epoch200
Learning rate0.001
Batchsize16
OptimizerAdam
Table 5. Comparison AdamW and SGD data.
Table 5. Comparison AdamW and SGD data.
ModelPredict (%)Recall (%)mAP (%)
AdamW85.1 ± 0.683.6 ± 1.191.1 ± 0.5
SGD84.7 ± 0.483.2 ± 0.790.3 ± 0.7
Table 6. Comparative experiment of replacing the model backbone network.
Table 6. Comparative experiment of replacing the model backbone network.
ModelPrecision/%Recall/%mAP@0.5/%mAP@0.5-0.95/%Parameters/MFLOPs/G
YOLOv8n86.9885.4585.1261.83.178.7
YOLOv8n + MobileNetV489.7187.2386.2263.23.029.2
YOLOv8n + EfficientViT88.1584.7285.9264.63.0910.1
YOLOv8n+ ShuffleNetV287.7684.0687.0360.53.108.6
YOLOv8n + GAM-StarNet90.2386.8487.2362.82.998.3
Table 7. Ablation experiment.
Table 7. Ablation experiment.
ModelGAM-StarNetC2f-Faster-CAMBDetect-GSCWIoUmAP@0.5/%mAP@0.5-0.95/%Parameters/MFLOPs/G
YOLOv8n 85.1261.83.178.7
Model-1 87.2362.82.998.3
Model-2 92.7167.63.558.9
Model-3 89.6266.93.168.6
Model-4 94.2567.43.258.2
Model-5 90.9564.93.027.8
Model-6 93.8565.43.428.5
YOLO-GFD95.7769.93.518.1
Table 8. Comparative analysis of multi-model performance.
Table 8. Comparative analysis of multi-model performance.
ModelPrecision/%Recall/%mAP@0.5/%Parameters/MFLOPs/GFPS
YOLOv5s86.3382.9381.467.4312.50102
YOLOv7-tiny89.0789.8391.376.1610.90118
YOLOv8s90.9190.4792.1811.1324.2193
YOLOv8n86.9885.4585.123.178.70141
YOLOv9s92.9192.0793.6312.3026.882
YOLOv1396.1294.9992.133.1018.17150
SSD89.0779.1486.8328.1366.0459
Faster-RCNN88.4681.9890.8445.22161.618
YOLO-GFD95.7795.0195.733.518.10147
Table 9. Results of weed detection using different methods.
Table 9. Results of weed detection using different methods.
ModelPrecision/%Recall/%mAP@0.5/%Parameters/MFLOPs/G
YOLOv8n85.188.390.23.178.2
YOLO-GFD92.890.792.13.518.1
Table 10. Weed detection experiment results.
Table 10. Weed detection experiment results.
Test NumberFLOPs/G
1234
Weed detection rate (%)90.796.194.391.393.1
Corn false detection rate (%)0.71.62.101.1
Table 11. Basic parameters of two types of lasers.
Table 11. Basic parameters of two types of lasers.
ParametersNIRBlue
Output power (W)110110
Power adjustment range (W)0–1100–110
Spot size (mm)11
Wavelength808 nm450 nm
Output methodContinuous outputContinuous output
Control methodLocal controlRS232
Cooling methodAir coolingAir cooling
Table 12. Experimental results of using near-infrared lasers with different powers to remove weeds.
Table 12. Experimental results of using near-infrared lasers with different powers to remove weeds.
Power (W)Irradiation Time (ms)Test1Test2Test3Success Rate (%)
110100100
70100
50100
3033.33
75100100
70100
50100
4033.33
300
5010033.33
2510033.33
Table 13. Experimental results of different power blue laser weedings.
Table 13. Experimental results of different power blue laser weedings.
Power (W)Irradiation Time (ms)Test1Test2Test3Success Rate (%)
110100100
70100
50100
20100
1566.66
100
75100100
70100
50100
3033.33
200
5010033.33
500
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, Y.; Wang, X.; Zhou, Y.; Fu, L.; Xu, Y. Research on Field Weed Detection Methods for Sweet Corn Seedlings and Laser Weed Control Experiments. Agriculture 2026, 16, 1237. https://doi.org/10.3390/agriculture16111237

AMA Style

Zhang Y, Wang X, Zhou Y, Fu L, Xu Y. Research on Field Weed Detection Methods for Sweet Corn Seedlings and Laser Weed Control Experiments. Agriculture. 2026; 16(11):1237. https://doi.org/10.3390/agriculture16111237

Chicago/Turabian Style

Zhang, Yuqi, Xuehai Wang, Yang Zhou, Lili Fu, and Yanlei Xu. 2026. "Research on Field Weed Detection Methods for Sweet Corn Seedlings and Laser Weed Control Experiments" Agriculture 16, no. 11: 1237. https://doi.org/10.3390/agriculture16111237

APA Style

Zhang, Y., Wang, X., Zhou, Y., Fu, L., & Xu, Y. (2026). Research on Field Weed Detection Methods for Sweet Corn Seedlings and Laser Weed Control Experiments. Agriculture, 16(11), 1237. https://doi.org/10.3390/agriculture16111237

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop