Towards accurate field counting of small pests with visual prompts

• Prompt-Guided Pest Counter (PGPC) uses visual prompts to improve pest counting. • FN-FP prototype matching reduces errors via prompt-guided optimization. • Patch Self-Attention and Adaptive Feature Gate enhance feature extraction and fusion. • Large-scale dataset (250 K + annotations) supports robust evaluation. • Balanced performance, high accuracy with low computational cost. Accurate field pest counting is crucial for timely reporting, rational pesticide use, and effective pest control. However, existing methods struggle with precisely detecting andcounting the tiny pests in field conditions due to two challenges: (I) environmental complexity and the minimal distinctive features of pests, which lead to high False Negative (FN) and False Positive (FP) rates; and (II) the inability to correct detection errors through secondary optimization. We propose the P rompt- G uided P est C ounter (PGPC), a method using visual prompts to improve detection and counting. Firstly, PGPC employs a fully convolutional encoder-decoder architecture with Patch Self Attention (PSA) to enhance feature extraction capability. It is trained using Object Counting Loss (OC Loss) to enable precise detection and counting by predicting the location of each pest. Secondly, we introduce a visual prompt-based FN-FP prototype matching branch to address detection errors. This branch uses a small number of prompt boxes to extract features and generates response maps, which are then fused with original features via an Adaptive Feature Gate (AFG) to perform secondary optimization on erroneous results. We collected a large-scale rice planthopper dataset from 2023 to 2024, containing over 250,000 annotations, and categorized into low-, medium-, and high-densities based on pest counts. Detection accuracy and counting errors were employed as evaluation metrics. The results demonstrate that visual prompts can optimize detection in complex environments, improving the model’s F1-score by 2.11% and reducing RMSE by 22.4% and 22.6% for medium- and high-densities, respectively. Ultimately, PGPC achieves an F1-score of 88.52%, with RMSE of 2.08, 5.97, and 10.81 for low-, medium-, and high-densities. Compared to state-of-the-art methods, PGPC maintains lower computational overhead while delivering competitive detection and counting performance.

Authors

Institutions

Publication Details

Journal
Computers and Electronics in Agriculture
Published
2025-06-08
DOI
https://doi.org/10.1016/j.compag.2025.110635
Citations
2
Primary Topic
Smart Agriculture and AI
Type
article
Field-Weighted Citation Impact
3.50

Funders

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

Towards accurate field counting of small pests with visual prompts

Yuheng Guo, Liang Zhang, Huayan Guo, Yu Zhang et al.
2 citations
Computers and Electronics in Agriculture
Smart Agriculture and AI
3.50
article

Towards accurate field counting of small pests with visual prompts

Yuheng Guo, Liang Zhang, Huayan Guo, Yu Zhang, Lianyou Gui, Ke Zhou, Wei Zhan, Kanglin Sun, Zhangzhang He, Sisi Tong, Zhiliang Zhang
article en
2 citations

Abstract

• Prompt-Guided Pest Counter (PGPC) uses visual prompts to improve pest counting. • FN-FP prototype matching reduces errors via prompt-guided optimization. • Patch Self-Attention and Adaptive Feature Gate enhance feature extraction and fusion. • Large-scale dataset (250 K + annotations) supports robust evaluation. • Balanced performance, high accuracy with low computational cost. Accurate field pest counting is crucial for timely reporting, rational pesticide use, and effective pest control. However, existing methods struggle with precisely detecting andcounting the tiny pests in field conditions due to two challenges: (I) environmental complexity and the minimal distinctive features of pests, which lead to high False Negative (FN) and False Positive (FP) rates; and (II) the inability to correct detection errors through secondary optimization. We propose the P rompt- G uided P est C ounter (PGPC), a method using visual prompts to improve detection and counting. Firstly, PGPC employs a fully convolutional encoder-decoder architecture with Patch Self Attention (PSA) to enhance feature extraction capability. It is trained using Object Counting Loss (OC Loss) to enable precise detection and counting by predicting the location of each pest. Secondly, we introduce a visual prompt-based FN-FP prototype matching branch to address detection errors. This branch uses a small number of prompt boxes to extract features and generates response maps, which are then fused with original features via an Adaptive Feature Gate (AFG) to perform secondary optimization on erroneous results. We collected a large-scale rice planthopper dataset from 2023 to 2024, containing over 250,000 annotations, and categorized into low-, medium-, and high-densities based on pest counts. Detection accuracy and counting errors were employed as evaluation metrics. The results demonstrate that visual prompts can optimize detection in complex environments, improving the model’s F1-score by 2.11% and reducing RMSE by 22.4% and 22.6% for medium- and high-densities, respectively. Ultimately, PGPC achieves an F1-score of 88.52%, with RMSE of 2.08, 5.97, and 10.81 for low-, medium-, and high-densities. Compared to state-of-the-art methods, PGPC maintains lower computational overhead while delivering competitive detection and counting performance.

Computers and Electronics in AgricultureVol. 237
Yangtze University (CN), Jingchu University of Technology (CN)
National Natural Science Foundation of China
Zero hunger
Openalex Percentile: Top 8%
Smart Agriculture and AI
3.50
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.