Field weed detection method and system based on lightweight deep learning model
By constructing a lightweight deep learning model and combining feature learning optimization mechanisms and multi-scale dilated convolution, the robustness and real-time performance issues of existing field weed detection methods in complex environments are solved, achieving efficient field weed detection and deployment.
Patent Information
- Application Number
- CN202511081618.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-11
AI Technical Summary
Existing deep learning-based field weed detection methods have poor robustness under complex environments such as light changes, crop shading, and geometric changes. They also struggle to balance computational complexity and real-time performance, lacking practical application in the field. Traditional models also perform poorly when deployed on mobile terminals and agricultural machinery.
A field weed detection method based on a lightweight deep learning model is constructed. By establishing datasets for multiple crop types and phenological stages, a feature learning optimization mechanism is introduced. The YOLOv10n network model is adopted and combined with the feature learning optimization mechanism. Multi-scale dilated convolution and attention mechanisms are embedded to optimize model performance and deploy it on an embedded development board.
It improves the accuracy and robustness of field weed detection, reduces computing costs, enables efficient real-time detection in complex farmland environments, and supports the actual deployment of mobile terminals and agricultural machinery.
Smart Images

Figure CN120932072A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural surveying and mapping engineering technology, specifically to a method and system for detecting field weeds based on a lightweight deep learning model. Background Technology
[0002] Weeds are a significant factor restricting crop growth, competing with crops for resources and causing yield losses of 30%-60%. Traditional "whole-field pesticide application" methods not only result in 40%-70% pesticide waste but also cause serious environmental pollution. With the development of precision agriculture, there is an urgent need to develop efficient weed identification technologies to achieve precise pesticide application, which is of great significance for ensuring food security and sustainable agricultural development.
[0003] Accurate weed identification and control are key technologies for achieving intelligent development in modern agriculture. While traditional deep learning-based detection methods have solved the weed identification problem to some extent, they still have significant shortcomings in the complex environments of real farmland: on the one hand, existing models are not robust to interference factors such as changes in light intensity, crop shading, and geometric changes, leading to unstable detection accuracy; on the other hand, it is difficult to balance computational complexity and real-time performance, limiting their practical deployment on mobile terminals and agricultural machinery. Furthermore, most research is limited to algorithm optimization in laboratory environments, lacking adaptive studies to the dynamic changes in weed growth in real farmland scenarios, and the practical application of existing technologies in the field needs further improvement. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for detecting field weeds based on a lightweight deep learning model, so as to solve the problems existing in the prior art mentioned in the background.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for detecting field weeds based on a lightweight deep learning model includes the following steps:
[0007] S1: Establish a labeled dataset of field weeds containing multiple crop types and phenological stages, and divide it proportionally to provide a benchmark for model training and validation;
[0008] S2: Based on the YOLOv10n network model, construct and train a field weed detection model;
[0009] S3: Improve model performance by introducing a feature learning optimization mechanism to improve the accuracy of weed detection in the field while keeping the model lightweight;
[0010] S4: Combine accuracy quantification indicators to conduct evaluation and comparative analysis of target detection results of field weed detection models;
[0011] S5: Based on the optimized field weed detection model, it is deployed to an embedded development board and integrated with a four-wheel drive platform to build a mobile weed detection system.
[0012] Preferably, the specific steps of S1 are as follows:
[0013] S11: Use the image visualization annotation tool LabelImg to annotate the images in the dataset, and use the minimum bounding rectangle to determine the location of weeds, ensuring the accuracy of bounding box coordinates and category information;
[0014] S12: Perform orthorectification, gridded cropping, Gaussian smoothing denoising, and color mean square error-based enhancement on the images in the dataset to improve data quality and diversity;
[0015] S13: Randomly shuffle the dataset and divide it into training, validation and test sets in a 7:2:1 ratio to construct a representative standardized dataset.
[0016] Preferably, the specific steps of S2 are as follows:
[0017] S21: First, a basic feature extraction module is constructed using standard convolution and depthwise separable convolution variants;
[0018] S22: Anchor-free center point prediction structure is adopted to optimize the target weed detection performance. Focal Loss solves the class imbalance problem and combined with the improved MPDIoU loss function to improve the localization accuracy.
[0019] S23: Iteratively optimize the preprocessed training dataset, select appropriate hyperparameters through experiments, and save the model with the best performance to verify the field weed detection effect.
[0020] Preferably, the specific steps of S3 are as follows:
[0021] S31: Embed C2f_Faster_EMA depthwise separable convolution, SCDown dynamic sparse convolution and attention mechanism modules at key positions in the model backbone network and feature fusion layer to enhance the extraction and spatial localization capabilities of key weed features;
[0022] S32: The introduced DySample module enhances multi-scale feature alignment capabilities through adaptive deformation convolution, and enhances key feature capture capabilities in conjunction with the SPPF module's multi-scale fusion mechanism and attention mechanism module.
[0023] S33: An AFGC attention mechanism is added to the end of the backbone network to adjust feature weights and reduce redundant information interference; a lightweight adaptive feature extraction module LAE is added to the Neck position of the baseline network to achieve efficient multi-scale feature fusion and enhance the robustness of weed detection in complex farmland environments; a lightweight adaptive feature extraction module LAE is introduced into the detection head and combined with the learnable spatial mask mechanism of the SCDown module to adaptively skip the calculation of the background region, effectively reducing computational redundancy.
[0024] Preferably, the improved C2PSAAFGC attention module is used in S33, which dynamically adjusts feature weights through a channel-space dual attention mechanism to suppress background interference and enhance the model's ability to focus on key regions.
[0025] Preferably, the specific steps of S4 are as follows:
[0026] Weed images collected in the field were acquired and preprocessed, including orthorectified, gridded, Gaussian smoothed, and enhanced with color mean squared error transformation. The preprocessed dataset, along with some publicly available datasets, was divided into training, validation, and test sets. These sets were then input into the optimized network model for training. The field weed detection model was validated using precision, recall, F1 score, and mean precision metrics.
[0027] Preferably, the specific steps of S5 are as follows:
[0028] The optimized lightweight field weed detection model was deployed on the NVIDIA Jetson Orin Nano Super development board, utilizing its high-performance AI computing power to achieve weed identification.
[0029] A mobile weed detection system for fields based on a lightweight deep learning model includes a frame, casters, and hub motors. Two casters and two hub motors are installed at the lower end of the frame for driving the movement of the detection system.
[0030] The lower end of the rack is equipped with a camera for image acquisition, and the upper end of the rack is equipped with a control box, which contains a processing unit based on the NVIDIA Jetson Orin Nano Super development board.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] This invention constructs a dataset of field weed images for various crop types and phenological stages to provide a training and validation benchmark for the model. Subsequently, a lightweight network architecture is introduced to optimize and improve the model by integrating modules such as multi-scale dilated convolution and attention mechanisms. This ensures recognition accuracy while reducing computational costs. The optimized model is then deployed on hardware devices, and a field mobile weed detection system is built by integrating a vision system. Through optimized algorithms and designed hardware, this invention provides efficient and reliable technical support for model optimization and expansion in complex environments, as well as for the construction of a field mobile weed monitoring platform. Attached Figure Description
[0033] Figure 1 This is a flowchart of the detection method of the present invention.
[0034] Figure 2 These are partial dataset photos from this invention.
[0035] Figure 3 This is the network structure diagram of the present invention.
[0036] Figure 4 This is a structural diagram of C2f_Faster_EMA of the present invention.
[0037] Figure 5 This is a structural diagram of the EMA attention mechanism of the present invention.
[0038] Figure 6 This is a structural diagram of the DySample point sampling based on the dynamic range factor of this invention.
[0039] Figure 7 This is a diagram of the C2PSA AFGC multi-scale dilated convolution structure of the present invention.
[0040] Figure 8 This is a structural diagram of the field weed detection system of the present invention.
[0041] In the picture: 1. Hub motor; 2. Control box; 3. Frame; 4. Casters; 5. Camera. Detailed Implementation
[0042] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0043] Please see Figure 1-8 The present invention provides the following technical solutions:
[0044] A method for detecting field weeds based on a lightweight deep learning model includes the following steps:
[0045] Step 1: Construction and partitioning of the weed dataset;
[0046] The following specific examples illustrate the operations involved in step 1:
[0047] (1) Dataset as follows Figure 2 As shown, common weeds such as amaranth and dandelion cover fields of crops such as corn and wheat, including growth stages such as seedling stage and jointing stage;
[0048] (2) Use the image visualization annotation tool LabelImg to annotate the images in the dataset, and use the minimum bounding rectangle to determine the location of weeds to ensure the accuracy of bounding box coordinates and category information;
[0049] (3) Perform orthorectification, gridding cropping, Gaussian smoothing denoising and color mean square error-based enhancement on the images in the dataset to improve data quality and diversity;
[0050] (4) Randomly shuffle the dataset and divide it into training set, validation set and test set in a ratio of 7:2:1 to construct a representative standardized dataset.
[0051] Step 2: Model construction and training;
[0052] Based on the YOLOv10n network model, a basic feature extraction module is first constructed using standard convolution and depthwise separable convolution variants. Then, an anchor-free center point prediction structure is adopted to optimize the target weed detection performance, FocalLoss is used to solve the class imbalance problem, and an improved MPDIoU loss function is combined to improve the localization accuracy. Finally, the preprocessed training dataset is iteratively optimized, and appropriate hyperparameters are selected through experiments. The model with the best performance is saved to verify the field weed detection effect.
[0053] In terms of loss function design, MPDIoU Loss improves the accuracy of bounding box regression by introducing distance information between bounding boxes, thus enhancing the model's robustness when dealing with targets with little overlap or large distances. MPDIoU introduces three key parameters based on traditional IoU: the distance between the center points of the predicted and actual bounding boxes, the aspect ratio of the bounding boxes, and the region overlap. The center point distance reflects the relative position of the center points of the predicted and actual bounding boxes; the aspect ratio helps the model learn more accurate box shapes; and the region overlap uses IoU to calculate the proportion of overlapping areas between the two boxes, combining these factors into a comprehensive loss function. The MPDIoU loss function formula is as follows:
[0054]
[0055] Where h and w represent the length and width of the image to be detected, respectively. and This represents the coordinates of the top-left and bottom-right corners of the true bounding box, and and These represent the coordinates of the top left and bottom right corners of the prediction box, respectively.
[0056] Step 3: Model optimization;
[0057] To enhance the extraction and spatial localization of key weed features, C2f_Faster_EMA depthwise separable convolution, SCDown dynamic sparse convolution, and attention mechanisms are embedded at key locations in the backbone network and feature fusion layer. The introduced DySample module enhances multi-scale feature alignment through adaptive deformation convolution, and, in conjunction with the SPPF module's multi-scale fusion mechanism and attention mechanism, strengthens key feature capture. An AFGC attention mechanism is added at the end of the backbone network to adjust feature weights and reduce redundant information interference. A lightweight adaptive feature extraction module (LAE) is added to the Neck position of the baseline network to achieve efficient multi-scale feature fusion, enhancing the robustness of weed detection in complex farmland environments. By introducing the lightweight adaptive feature extraction module (LAE) into the detection head and combining it with the SCDown module's learnable spatial mask mechanism to adaptively skip background region calculations, computational redundancy is effectively reduced. Furthermore, an improved C2PSA AFGC attention module is used at the end of the network, dynamically adjusting feature weights through a channel-spatial dual attention mechanism to suppress background interference and enhance the model's ability to focus on key regions.
[0058] like Figure 3 As shown, the optimized model network structure is divided into four parts: input, backbone, Neck, and output. The input is used to input images into the model. The backbone extracts image features. The Neck uses a BiFPN bidirectional feature pyramid architecture, introducing a DySample dynamic upsampling module to enhance multi-scale feature alignment through adaptive deformation convolution. It also incorporates the SPPF module's multi-scale fusion mechanism and an attention mechanism to enhance key feature capture capabilities. The output uses an anchor-free detection head structure, converting feature information into the geometric location and class probability of the target through a dual-branch output of center point heatmap prediction and rotated bounding box regression.
[0059] The C2fCIB module of the backbone network integrates standard convolution and involution operators, and combines it with C2f_Faster_EMA depthwise separable convolution to construct a multi-granularity feature extraction network. Furthermore, it introduces SCDown dynamic sparse convolution to intelligently skip background computation through a dynamic masking mechanism, achieving reduced computational cost and improved object detection accuracy. The traditional Bottleneck structure in the C2f module of the backbone network is replaced with a FasterBlock structure to obtain the C2f_Faster module. On this basis, an EMA attention mechanism is added to obtain the C2f_Faster_EMA module. The introduced EMA attention mechanism can retain information in each channel and reduce computational overhead, resulting in a uniform distribution of spatial semantic features within each feature group. The C2f_Faster_EMA structure diagram is shown below. Figure 4 As shown, BiFPN differs from traditional FPN in that it introduces bidirectional connections between adjacent levels of the feature pyramid. Information can flow from higher-level features to lower-level features, and vice versa. When fusing multi-scale feature maps of the input, BiFPN assigns learnable weights to each input, enhancing important features. The formula for calculating the fused output O is as follows:
[0060]
[0061] Among them, I i : The i-th input feature map; w i : Corresponding to I i Learnable weights, initialized to 1; ∈: minimum value (e.g., 10) -4 To prevent division by zero; normalization: The weights are standardized to [0,1], similar to a simplified version of softmax.
[0062] BiFPN integrates features through a two-stage process: top-down and bottom-up.
[0063] Phase 1: Top-down path
[0064]
[0065] It is upsampled to the same resolution as P4, and w1 and w2 are independent weights of P4 and P5.
[0066] Phase 2: Bottom-up Path
[0067]
[0068] Downsampled to the same resolution as P4; direct cross-layer connection: simultaneously fusing the original input. Top-down results Lower layer output
[0069] The introduced EMA attention mechanism provides the model with more refined localization and attention capabilities. The EMA attention mechanism embedded in the backbone network can focus attention on the target region, enabling the model to more accurately identify and locate small weeds. The structure of the EMA attention mechanism is as follows: Figure 5 As shown, the attention mechanism has three branches. First, an input feature map X∈R is processed. C×H×W The channel direction is divided into G sub-features, i.e., X = [X0, X1, ..., X...]. G-1 ],X∈R C×H×W In branch 1, the G sub-feature maps are fused with information from other branches; in branch 2, two-dimensional average pooling is used to perform global average pooling on the feature maps in both height and width directions, as shown in the formula:
[0070]
[0071] In the formula: H and W represent the height and width of the feature map; X c Represents the characteristic tensors of different channels.
[0072] Branch 3 uses 3×3 convolution operations to process the feature map, effectively capturing cross-dimensional information and establishing connections between different dimensions with other branches.
[0073] The three branches of the attention mechanism integrate the advantages of channel attention and spatial attention, capturing both global channel dependencies and local spatial features, thus obtaining more comprehensive features across both channel and spatial dimensions. This makes it more capable of handling tasks involving the recognition of small and blurred targets.
[0074] The SiLU activation function is used instead of the ReLU in the original Conv module. By smoothly normalizing the fused weights, not only is some negative information preserved but the gradient never returns to zero, improving the stability of weight learning. Adding SiLU activation after all convolutional layers enhances the non-linear expressive power of feature transformation. While reducing the network structure and model complexity, this approach enhances the backbone network's feature extraction capability from input weed images, contributing to improved accuracy and real-time performance in weed identification. Its mathematical expression is as follows:
[0075]
[0076] Where SiLU(x) is the Sigmoid function.
[0077] like Figure 6As shown, DySample, as a dynamic upsampling module embedded in the feature pyramid layer, plays a crucial role in replacing traditional interpolation by generating a position-adaptive offset vector field. This accurately addresses feature alignment distortion caused by varying sizes of weeds in the field (from tiny seedlings to mature plants), overlapping leaves, and light-induced deformation. This component, together with the attention mechanism, forms a deformation-attention dual-enhancement link, significantly improving seedling boundary clarity and occluded target separation capabilities with almost no increase in computational overhead. This ensures the lightweight model maintains high accuracy and real-time performance in complex farmland scenarios. The accompanying SPPF is a multi-scale feature fusion module designed to enhance the model's ability to detect targets at different scales. Its core idea is to fuse feature maps through multi-scale pooling, thereby enhancing the expressive power of the features.
[0078] SPPF structure, such as Figure 3 As shown, the mathematical expression of a multi-level max pooling stack can be decomposed into the following steps:
[0079] (1) Input feature map:
[0080] Let the input feature map be X∈R C×H×W Where: C is the number of channels, and H×W is the spatial dimension.
[0081] (2) Multi-scale max pooling:
[0082] SPPF performs multiple max-pooling operations with different kernel sizes (k×k) on the input feature map, typically fusing the results using a concatenated approach. The specific steps are as follows:
[0083] Original features preserved: Input X is passed directly.
[0084] MaxPool(k=5):
[0085] Y1 = MaxPool 5×5 (X)MaxPool(k=9):
[0086] Y2 = MaxPool 9×9 (X)MaxPool(k=13):
[0087] Y3 = MaxPool 13×13 (X)Y3=MaxPool13×13(X)Y3=MaxPool13×13(X)
[0088] Concatenation operation:
[0089] Z = Concat(X, Y1, Y2, Y3)
[0090] The output Z has 4C channels, and it is assumed that the space size after pooling is kept consistent with the input through padding.
[0091] (3) Output feature map:
[0092] Finally, a convolutional layer, such as a 1×1 Conv, is used to adjust the number of channels, resulting in the fused feature map F.
[0093] F = Conv 1×1 (Z)
[0094] By introducing the AFGC attention mechanism into the C2PSA module at the end of the backbone network, we obtain the C2PSAAFGC module, as follows: Figure 7 As shown, the weight vector effectively integrates global and local information and achieves adaptive allocation of feature channel weights. Further extraction and fusion of local and global features from the C2PSA module's output feature map helps improve the model's detection accuracy for weed identification.
[0095] Adding a lightweight adaptive feature extraction (LAE) module before the detection head not only reduces computational costs but also allows for the extraction of more information and high-resolution details from multi-scale feature maps, thereby improving detection robustness in complex farmland environments. The detection head achieves synergistic optimization of accuracy and speed through a modular combination of LAE lightweight adaptive feature extraction, SCDown dynamic sparse convolution, and C2PSA AFGC. SCDown dynamic sparse convolution intelligently skips background calculations through a dynamic masking mechanism, reducing computational cost and improving target detection accuracy. The AFGC attention mechanism in the C2PSA AFGC module adjusts the weights of target information in the feature maps, reducing interference with redundant model information and allowing the detection head to focus more intently on the target region.
[0096] Step 4: Target detection accuracy assessment;
[0097] Weed images collected in the field were acquired and preprocessed using orthorectification, gridded non-overlapping cropping, Gaussian smoothing for noise reduction, and color mean square error transformation enhancement. These images, along with some publicly available datasets, were divided into training, validation, and test sets. The optimized network model was then trained using these sets. The weed detection model was validated using metrics such as precision, recall, F1 score, and mean average precision (mAP).
[0098] Precision refers to the proportion of truly positive samples among the detected positive samples; in other words, how many of the detected targets are genuine targets. Precision can be calculated using the following formula:
[0099]
[0100] In this context, True Precision (TP) represents the number of correctly detected targets, and False Precision (FP) represents the number of non-targets that are falsely detected as targets. Precision ranges from 0 to 1; the closer to 1, the lower the model's false positive rate and the more reliable the prediction results.
[0101] Recall refers to the percentage of true positive samples that are detected, or in other words, how many real targets the object detection model can detect. Recall can be calculated using the following formula:
[0102]
[0103] Here, FN stands for False Negative; False Negative (FN) refers to the number of real targets that the model failed to detect, representing the number of weeds that the model failed to detect. A recall rate closer to 1 indicates that the model has a higher detection capability when detecting targets, meaning it can better identify real targets. A high recall rate means that the model can capture all real targets well, reducing the possibility of missed detections.
[0104] The F1 score is a metric that comprehensively considers precision and recall; it is the harmonic mean of precision and recall, used to comprehensively evaluate model performance. The F1 score can be calculated using the following formula:
[0105]
[0106] A higher F1 score indicates a better overall performance of the model in the object detection task.
[0107] Mean precision (MPP) is a core evaluation metric for object detection. It is calculated by taking the average precision under different recall rates, i.e., the area under the precision-recall curve, to comprehensively reflect the model's performance. Common variations include:
[0108] mAP is used to measure the performance of an object detection model in terms of accuracy. mAP is the average precision under the Precision-Recall curve, which comprehensively considers the detection accuracy and recall rate of different classes, and is an important indicator for evaluating the overall performance of an object detection model. Different mAP values are typically calculated based on different IoU thresholds, including:
[0109] mAP50: The mAP value when the IoU threshold is 0.5;
[0110] mAP50-95: The average mAP value of the IoU threshold from 0.5 to 0.95 (step size 0.05), which has stricter requirements for the accuracy of the detection box.
[0111] Step 5: Build an intelligent weed identification system for fields.
[0112] The optimized lightweight weed detection model was deployed on the NVIDIA Jetson Orin Nano Super development board, which uses its high-performance AI computing power to achieve real-time weed recognition. The development board was installed on the machine through a reinforced package and connected to the MIPI CSI-2 camera to build an intelligent weed recognition platform.
[0113] This invention also discloses a field weed detection system based on a lightweight deep learning model, such as... Figure 8 As shown, the field weed detection system adopts a four-wheel drive mobility scheme, equipped with two omnidirectional wheels 4 and two MSSD-15SMA hub motors 1. Each motor has an outer diameter of 20cm, weighs 5kg, has a rated voltage of 24V (operating range 12~60V), a rated torque of 12N·m, and a power of 150W. The matching brushless driver supports a wide voltage input of 12~60V, an output current of 3~15A, a speed control range of ±(11000 / pole pairs)~±(110000 / pole pairs) RPM, and weighs 350g. Stable operation in complex field environments is achieved through independent closed-loop control of the dual motors and pole pair adjustment. Its wide voltage design and overcurrent protection function ensure the system's environmental tolerance and reliability. A camera 5, using a MIPICSI-2 sensor, is mounted at the lower end of rack 3 for image acquisition. A control box 2 is mounted at the upper end of rack 3. Inside the control box 2 is a processing unit based on an NVIDIA Jetson OrinNano Super development board, which deploys an optimized target detection model and utilizes the TensorRT acceleration framework for efficient inference, accurately identifying the spatial distribution, type, and density of field weeds. This field weed detection system provides a low-cost, easily deployable weed monitoring solution for precision agriculture, while also reserving expansion interfaces for future functional upgrades.
[0114] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A field weed detection method based on a lightweight deep learning model, characterized in that, Includes the following steps: S1: Establish a labeled dataset of field weeds containing multiple crop types and phenological stages, and divide it proportionally to provide a benchmark for model training and validation; S2: Based on the YOLOv10n network model, construct and train a field weed detection model; S3: Improve model performance by introducing a feature learning optimization mechanism to improve the accuracy of weed detection in the field while keeping the model lightweight; S4: Combine accuracy quantification indicators to conduct evaluation and comparative analysis of target detection results of field weed detection models; S5: Based on the optimized field weed detection model, it is deployed to an embedded development board and integrated with a four-wheel drive platform to build a mobile weed detection system.
2. The field weed detection method based on a lightweight deep learning model according to claim 1, characterized in that, The specific steps of S1 are as follows: S11: Use the image visualization annotation tool LabelImg to annotate the images in the dataset, and use the minimum bounding rectangle to determine the location of weeds, ensuring the accuracy of bounding box coordinates and category information; S12: Perform orthorectification, gridded cropping, Gaussian smoothing denoising, and color mean square error-based enhancement on the images in the dataset to improve data quality and diversity; S13: Randomly shuffle the dataset and divide it into training, validation and test sets in a 7:2:1 ratio to construct a representative standardized dataset.
3. The field weed detection method based on a lightweight deep learning model according to claim 1, characterized in that, The specific steps of S2 are as follows: S21: First, a basic feature extraction module is constructed using standard convolution and depthwise separable convolution variants; S22: Anchor-free center point prediction structure is adopted to optimize the target weed detection performance. Focal Loss solves the class imbalance problem and combined with the improved MPDIoU loss function to improve the localization accuracy. S23: Iteratively optimize the preprocessed training dataset, select appropriate hyperparameters through experiments, and save the model with the best performance to verify the field weed detection effect.
4. The field weed detection method based on a lightweight deep learning model according to claim 1, characterized in that, The specific steps of S3 are as follows: S31: Embed C2f_Faster_EMA depthwise separable convolution, SCDown dynamic sparse convolution and attention mechanism modules at key positions in the model backbone network and feature fusion layer to enhance the extraction and spatial localization capabilities of key weed features; S32: The introduced DySample module enhances multi-scale feature alignment capabilities through adaptive deformation convolution, and enhances key feature capture capabilities in conjunction with the SPPF module's multi-scale fusion mechanism and attention mechanism module. S33: An AFGC attention mechanism was added to the end of the backbone network to adjust feature weights and reduce redundant information interference; a lightweight adaptive feature extraction module LAE was added to the Neck position of the baseline network to achieve efficient multi-scale feature fusion and enhance the robustness of weed detection in complex farmland environments; a lightweight adaptive feature extraction module LAE was introduced into the detection head and combined with the learnable spatial mask mechanism of the SCDown module to adaptively skip the calculation of the background region, effectively reducing computational redundancy.
5. The field weed detection method based on a lightweight deep learning model according to claim 1, characterized in that, The specific steps of S4 are as follows: Weed images collected in the field were acquired and preprocessed, including orthorectified, gridded, Gaussian smoothed, and enhanced with color mean squared error transformation. The preprocessed dataset, along with some publicly available datasets, was divided into training, validation, and test sets. These sets were then input into the optimized network model for training. The field weed detection model was validated using precision, recall, F1 score, and mean precision metrics.
6. The field weed detection method based on a lightweight deep learning model according to claim 1, characterized in that, The specific steps of S5 are as follows: The optimized lightweight field weed detection model was deployed on the NVIDIA Jetson Orin Nano Super development board, utilizing its high-performance AI computing power to achieve real-time weed identification.
7. The field weed detection method based on a lightweight deep learning model according to claim 4, characterized in that, The S33 module employs a C2PSA AFGC attention module, which dynamically adjusts feature weights through a channel-space dual attention mechanism to suppress background interference and enhance the model's ability to focus on key regions.
8. A field weed detection system based on a lightweight deep learning model, characterized in that, It includes a frame (3), casters (4), and hub motors (1). The lower end of the frame (3) is equipped with two casters (4) and two hub motors (1) for driving the movement of the detection system. The lower end of the rack (3) is equipped with a camera (5) for image acquisition, and the upper end of the rack (3) is equipped with a control box (2). The control box (2) contains a processing unit based on the NVIDIA Jetson Orin Nano Super development board.
Citation Information
Cited By
Double-branch lightweight tobacco leaf grading method based on mixed framework
CN121459064A
Fall detection optimization method and system based on infrared image features
CN122290177A