DAAL-YOLOv12n: A Method for Detecting Common Forest Pests Incorporating Dynamic Attention and Adaptive Lightweight Modules

Variable illumination, severe occlusion, and the small scale of pest instances in complex forest environments significantly compromise the accuracy of automated forest pest detection. Existing deep learning-based detection models often face challenges in achieving an optimal trade-off among detection accuracy, model lightweightness, and training stability. To achieve efficient and intelligent monitoring of forest pests, we propose a novel detection framework named DAAL-YOLOv12n by improving the lightweight YOLOv12n baseline with two specifically designed modules for complex forest scenarios. To overcome the limited feature adaptability caused by fixed convolutional branches and conventional residual connections in the original A2C2f block, a DynamicA2C2f dynamic attention module is introduced. This module employs dynamic gating weights and adaptive residual adaptation modulation to achieve directional feature enhancement and improved cross-channel compatibility. Furthermore, to reduce the computational redundancy of the conventional C3/C2f block and alleviate abnormal optimization errors in the exponential moving average (EMA) caused by persistently stored dynamic tensors, an AdaptiveC3K2 lightweight adaptation module is developed. Through shared convolution representations, temporary dynamic weight generation, and pre-residual adaptation strategies, the proposed module achieves model compression, flexible channel adaptation, and EMA-compatible optimization. Extensive experiments are conducted on a self-collected forest pest dataset comprising 16 common pest categories. Experimental results demonstrate that, compared with advanced detectors such as YOLOv12n, DAAL-YOLOv12n improves precision and recall by 10.5% and 11.1%, respectively, with only a marginal increase in model parameters. Furthermore, the proposed approach increases [email protected] and [email protected]:0.95 by 10.2% and 18.0%, respectively, attaining an [email protected] of 93.0% alongside a real-time inference throughput of 93 FPS. These results indicate that the proposed method offers a viable solution for deploying accurate and lightweight forest pest detection systems on edge devices, offering technical support for intelligent pest surveillance in the wild.

Authors

Institutions

Publication Details

Journal
Forests
Published
2026-08-17
DOI
https://doi.org/10.3390/f17080975
Primary Topic
Smart Agriculture and AI
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

DAAL-YOLOv12n: A Method for Detecting Common Forest Pests Incorporating Dynamic Attention and Adaptive Lightweight Modules

Songnan Chen, Yun Pan, Xuelin Chen
Forests
Smart Agriculture and AI
article

DAAL-YOLOv12n: A Method for Detecting Common Forest Pests Incorporating Dynamic Attention and Adaptive Lightweight Modules

Songnan Chen, Yun Pan, Xuelin Chen
article en

Abstract

Variable illumination, severe occlusion, and the small scale of pest instances in complex forest environments significantly compromise the accuracy of automated forest pest detection. Existing deep learning-based detection models often face challenges in achieving an optimal trade-off among detection accuracy, model lightweightness, and training stability. To achieve efficient and intelligent monitoring of forest pests, we propose a novel detection framework named DAAL-YOLOv12n by improving the lightweight YOLOv12n baseline with two specifically designed modules for complex forest scenarios. To overcome the limited feature adaptability caused by fixed convolutional branches and conventional residual connections in the original A2C2f block, a DynamicA2C2f dynamic attention module is introduced. This module employs dynamic gating weights and adaptive residual adaptation modulation to achieve directional feature enhancement and improved cross-channel compatibility. Furthermore, to reduce the computational redundancy of the conventional C3/C2f block and alleviate abnormal optimization errors in the exponential moving average (EMA) caused by persistently stored dynamic tensors, an AdaptiveC3K2 lightweight adaptation module is developed. Through shared convolution representations, temporary dynamic weight generation, and pre-residual adaptation strategies, the proposed module achieves model compression, flexible channel adaptation, and EMA-compatible optimization. Extensive experiments are conducted on a self-collected forest pest dataset comprising 16 common pest categories. Experimental results demonstrate that, compared with advanced detectors such as YOLOv12n, DAAL-YOLOv12n improves precision and recall by 10.5% and 11.1%, respectively, with only a marginal increase in model parameters. Furthermore, the proposed approach increases [email protected] and [email protected]:0.95 by 10.2% and 18.0%, respectively, attaining an [email protected] of 93.0% alongside a real-time inference throughput of 93 FPS. These results indicate that the proposed method offers a viable solution for deploying accurate and lightweight forest pest detection systems on edge devices, offering technical support for intelligent pest surveillance in the wild.

ForestsVol. 17(8)
Xinyang Normal University (CN), Xinyang Agriculture and Forestry University (CN), South China Robotics Innovative Research Institute (CN)
Basic and Applied Basic Research Foundation of Guangdong Province
Life in Land
Openalex Percentile: Top 12%
Smart Agriculture and AI
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.