The invention discloses a lightweight
livestock target detection method based on a dual environment
perception feature
pyramid. The method comprises the following steps of: firstly, taking YOLOv5s as a basic network, and introducing GhostNet to lighten a
convolution module and a C3 module in the YOLOv5s so as to reduce a
model parameter quantity and a calculation quantity; secondly, designing a dual environment awareness feature
pyramid network (DA-FPN), optimizing a path aggregation network (PAN) in the original YOLOv5s, realizing multi-scale
feature fusion, and enhancing channel and position information related to targets in
feature mapping, thereby solving the difficulty in detection of small targets and overlapped targets; thirdly, introducing a Focal-EIoU
loss function, improving a CIoU
loss function in the original YOLOv5s, and enabling the model to focus on
processing small targets which are difficult to detect and recognize; and finally, constructing a candidate box
selection strategy based on a DIOU-NMS post-
processing module, and further optimizing the detection accuracy of the overlapping target. The method provided by the invention not only has the
advantage of light weight, but also has good accuracy and generalization, and can effectively meet the
livestock target detection requirement in an actual application scene.