The invention discloses a
weed detection method and device used in a complex environment background, and the method comprises the steps: carrying out the simplification of channel attention
convolution and channel self-attention
convolution in a smooth U-shaped network; a space channel
convolution attention module is designed by introducing a space attention
branch, a gating mechanism and two different residual connection
modes, an edge filtering and
Gaussian filtering combined mechanism is proposed based on an edge
Gaussian aggregation module in a linear efficient
Gaussian network, and rapid spatial
pyramid pooling is fused. A multi-scale
pooling strategy, a channel attention mechanism and a dynamic
weight distribution mechanism are introduced, a multi-scale
pyramid pooling hyper-edge Gaussian aggregation module is designed, a context consistency strategy is constructed on the basis of a space enhancement feedforward module in a space enhancement multi-scale network, dynamic gating is designed through shielding masks, and a multi-scale
pyramid pooling hyper-edge Gaussian aggregation
algorithm is constructed. Designing an efficient multi-
scale space enhancement
network module; based on a YOLOv9t model, a space channel convolution attention module, a multi-scale fast pyramid pooling hyper-edge Gaussian aggregation module and an efficient multi-
scale space enhancement
network module are combined to construct a space enhancement type YOLO model; and weeds are detected based on the spatial enhanced YOLO model.