The invention relates to a YOLOv4-based optimization method for
rapid identification and detection of a sowthistle obstacle, and the method comprises the steps: initializing an anchor frame through employing a K-means
algorithm, generating an anchor frame with higher scale adaptability, and enabling a model to be more suitable for the detection of slender sowthistle; aiming at
network structure optimization of network scene particularity,
cutting far all-grass of Chinese
ixeris and near small all-grass of Chinese
ixeris, and only stably detecting a close shot existing in each frame of image; in the optimization of a
pooling mode,
pooling is carried out by adopting an exponential weighted average filtering mode so as to reserve all useful information as much as possible. According to the method, the YOLOv4 is adopted to accurately detect the all-grass of Chinese
Ixeris, optimization is carried out in three aspects of priori frame reclustering, a
pooling mode and a
network structure, and the optimized YOLOv4 can accelerate a target detection process, so that the method is suitable for real-time application, the use of calculation and memory resources is reduced, the method is suitable for an
embedded system or equipment with resource limitation, and the detection efficiency of the all-grass of Chinese
Ixeris is improved. The accuracy of target detection is not damaged as much as possible, and high-quality recognition of the target is kept.