# Improved YOLOv7 enhances identification of Hylurgus ligniperda in traps

**Authors:** Zhengyi Li, Xiahui Zhang, Jing Tao

PMC · DOI: 10.3389/fpls.2026.1740965 · 2026-03-17

## TL;DR

An improved YOLOv7 model is developed to automatically and accurately detect the red-haired pine bark beetle in traps, improving pest monitoring efficiency.

## Contribution

The paper introduces an improved YOLOv7 model using EfficientNetV2-S and Focal Loss for enhanced small pest detection.

## Key findings

- The improved YOLOv7 achieved an mAP of 82.5%, a 4.4% improvement over the original model.
- The model outperformed other models in detecting Hylurgus ligniperda in trap images.
- The approach offers practical value for pest monitoring and early warning systems.

## Abstract

The red-haired pine bark beetle, Hylurgus ligniperda Fabricius, is an internationally significant forest quarantine pest that poses a threat to coniferous trees in the coastal areas of Shandong, China. Monitoring its infestation is crucial in forest pest management, allowing for timely detection, early intervention, and prevention of further spread. Conventional manual identification methods are insufficient for modern surveillance of the H. ligniperda. To address this challenge, an improved YOLOv7 deep learning model is applied for identification. The aim is to automate, efficiently, and accurately identify and quantify the small, densely distributed, and variably posed H. ligniperda in the natural environment. The original backbone feature extraction network in YOLOv7 was replaced with the more lightweight and efficient EfficientNet Version 2 Small (EfficientNetV2-S) network to achieve model lightweighting while balancing speed and accuracy. Focal Loss was utilized as a loss function to mitigate the impact of class imbalance, balancing the ratio of positive and negative samples, thereby enhancing identification precision. Training on a dataset composed of pest images captured within traps demonstrated that the improved YOLOv7 achieved an impressive mean average precision (mAP) of 82.5%, a 4.4% improvement over the original YOLOv7. Comparative experiments with other models indicated superior performance of this enhanced model in the practical detection of H. ligniperda. This offers a viable solution for the precise identification of small pests and presents a practical application value for pest monitoring and early warning systems.

## Linked entities

- **Species:** Hylurgus ligniperda (taxon 167147)

## Full-text entities

- **Species:** Hylurgus ligniperda (species) [taxon 167147]

## Figures

10 figures with captions in the complete paper: https://tomesphere.com/paper/PMC13036201/full.md

---
Source: https://tomesphere.com/paper/PMC13036201