journal article·2025-12-30Open access

High-Precision Peanut Pod Detection Device Based on Dual-Route Attention Mechanism

Yongkuai Chen, Pengyan Chang, Tao Wang, Jian Zhao

Applied Sciences· Volume 16· Issue 1

Abstract

Peanut, as an important economic crop, is widely cultivated and rich in nutrients. Classifying peanuts based on the number of seeds helps assess yield and economic value, providing a basis for selection and breeding. However, traditional peanut grading relies on manual labor, which is inefficient and time-consuming. To improve detection efficiency and accuracy, this study proposes an improved BTM-YOLOv8 model and tests it on an independently designed pod detection device. In the backbone network, the BiFormer module is introduced, employing a dual-route attention mechanism with dynamic, content-aware, and query-adaptive sparse attention to extract features from densely packed peanuts. In addition, the Triple Attention mechanism is incorporated to strengthen the model’s multidimensional interaction and feature responsiveness. Finally, the original CIoU loss function is replaced with MPDIoU loss, simplifying distance metric computation and enabling more scale-focused optimization in bounding box regression. The results show that BTM-YOLOv8 has stronger detection performance for ‘Quan Hua 557’ peanut pods, with precision, recall, mAP50, and F1 score reaching 98.40%, 96.20%, 99.00%, and 97.29%, respectively. Compared to the original YOLOv8, these values improved by 3.9%, 2.4%, 1.2%, and 3.14%, respectively. Ablation experiments further validate the effectiveness of the introduced modules, showing reduced attention to irrelevant information, enhanced target feature capture, and lower false detection rates. Through comparisons with various mainstream deep learning models, it was further demonstrated that BTM-YOLOv8 performs well in detecting ‘Quan Hua 557’ peanut pods. When comparing the device’s detection results with manual counts, the R2 value was 0.999, and the RMSE value was 12.69, indicating high accuracy. This study improves the efficiency of ‘Quan Hua 557’ peanut pod detection, reduces labor costs, and provides quantifiable data support for breeding, offering a new technical reference for the detection of other crops.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Smart Agriculture and AI · Advanced Neural Network Applications · Peanut Plant Research Studies

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Institute of Digital Agriculture, Fujian Academy of Agricultural Sciences, Fuzhou 350003, China

Institute of Subtropical Agriculture, Fujian Academy of Agricultural Sciences, Zhangzhou 363005, China

Funding

Key Technology for Digitization of Characteristic Agricultural Industries in Fujian Province · Fujian Academy of Agricultural Sciences Research Project

References (41)

Show source-provided references
1. Early detection of bacterial wilt in peanut plants through leaf-level hyperspectral and unmanned aerial vehicle data10.1016/j.compag.2020.105708 ↗
2. Huai, D., Wu, J., Xue, X., Hu, M., Zhi, C., Pandey, M.K., Liu, N., Huang, L., Bai, D., and Yan, L. (2023). Red fluorescence protein (DsRed2) promotes the screening efficiency in peanut genetic transformation. Front. Plant Sci., 14.10.3389/fpls.2023.1123644 ↗
3. Lightweight detection model for safe wear at worksites using GPD-YOLOv8 algorithm10.1038/s41598-024-83391-7 ↗
4. Detection of safety helmet and mask wearing using improved YOLOv5s10.1038/s41598-023-48943-3 ↗
5. Nandhini, T.J., and Thinakaran, K. (2023, January 5–7). Detection of Crime Scene Objects using Deep Learning Techniques. Proceedings of the 2023 International Conference on Intelligent Data Communication Technologies and Internet of Things (IDCIoT), Bengaluru, India.
6. Advancing cardiac diagnostics: Exceptional accuracy in abnormal ECG signal classification with cascading deep learning and explainability analysis10.1016/j.asoc.2024.112056 ↗
7. Recent Advancements and Future Prospects in Active Deep Learning for Medical Image Segmentation and Classification10.1109/ACCESS.2023.3313977 ↗
8. YOLO-FSE: An Improved Target Detection Algorithm for Vehicles in Autonomous Driving10.1109/JIOT.2025.3526224 ↗
9. Pavel, M.I., Tan, S.Y., and Abdullah, A. (2022). Vision-Based Autonomous Vehicle Systems Based on Deep Learning: A Systematic Literature Review. Appl. Sci., 12.10.3390/app12146831 ↗
10. A visual inspection and diagnosis system for bridge rivets based on a convolutional neural network10.1111/mice.13274 ↗
11. Industrial object and defect recognition utilizing multilevel feature extraction from industrial scenes with Deep Learning approach10.1007/s12652-021-03688-7 ↗
12. Chen, Y., Xu, H., Chang, P., Huang, Y., Zhong, F., Jia, Q., Chen, L., Zhong, H., and Liu, S. (2024). CES-YOLOv8: Strawberry Maturity Detection Based on the Improved YOLOv8. Agronomy, 14.10.3390/agronomy14071353 ↗
13. Integrated fuzzy and deep learning model for identification of coconut maturity without human intervention10.1007/s00521-023-09402-2 ↗
14. Liu, S., Xu, H., Deng, Y., Cai, Y., Wu, Y., Zhong, X., Zheng, J., Lin, Z., Ruan, M., and Chen, J. (2025). YOLOv8-LSW: A Lightweight Bitter Melon Leaf Disease Detection Model. Agriculture, 15.10.3390/agriculture15121281 ↗
15. Multiple disease detection method for greenhouse-cultivated strawberry based on multiscale feature fusion Faster R_CNN10.1016/j.compag.2022.107176 ↗
16. A method for segmentation and localization of tomato lateral pruning points in complex environments based on improved YOLOV510.1016/j.compag.2024.109731 ↗
17. Computer vision-based apple grading for golden delicious apples based on surface features
18. Classification of Peanut Images Based on Multi-features and SVM10.1016/j.ifacol.2018.08.110 ↗
19. Machine vision based soybean quality evaluation10.1016/j.compag.2017.06.023 ↗
20. Wheat grain classification by using dense SIFT features with SVM classifier10.1016/j.compag.2016.01.033 ↗
21. Classification of rice varieties with deep learning methods10.1016/j.compag.2021.106285 ↗
22. A novel method for peanut variety identification and classification by Improved VGG1610.1038/s41598-021-95240-y ↗
23. Optimizing aflatoxin B1 detection in peanut kernels through deep modular combination optimization algorithm: A deep learning approach to quality evaluation of postharvest nuts10.1016/j.postharvbio.2024.113293 ↗
24. Improved Peanut Quality Detection Method of YOLOv8n
25. LGP-YOLO: An efficient convolutional neural network for surface defect detection of light guide plate10.1007/s40747-023-01256-4 ↗
26. Buslaev, A., Iglovikov, V.I., Khvedchenya, E., Parinov, A., Druzhinin, M., and Kalinin, A.A. (2020). Albumentations: Fast and flexible image augmentations. Information, 11.10.3390/info11020125 ↗
27. Sohan, M., Sai Ram, T., and Rami Reddy, C.V. (2024). A Review on YOLOv8 and Its Advancements. Algorithms for Intelligent Systems, Springer Nature.10.1007/978-981-99-7962-2_39 ↗
28. SH17: A dataset for human safety and personal protective equipment detection in manufacturing industry
29. Research on pig behavior recognition method based on CBCW-YOLO v8
30. Fracture detection in pediatric wrist trauma X-ray images using YOLOv8 algorithm10.1038/s41598-023-47460-7 ↗
31. Zhu, L., Wang, X., Ke, Z., Zhang, W., and Lau, R. (2023, January 18–22). BiFormer: Vision Transformer with Bi-Level Routing Attention. Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada.10.1109/CVPR52729.2023.00995 ↗
32. Deng, F., Chen, J., Fu, L., Zhong, J., Qiaoi, W., Luo, J., Li, J., and Li, N. (2024). Real-time citrus variety detection in orchards based on complex scenarios of improved YOLOv7. Front. Plant Sci., 15.10.3389/fpls.2024.1381694 ↗
33. Efficient content-based sparse attention with routing transformers10.1162/tacl_a_00353 ↗
34. Misra, D., Nalamada, T., Arasanipalai, A.U., and Hou, Q. (2021, January 5–9). Rotate to Attend: Convolutional Triplet Attention Module. Proceedings of the 2021 IEEE Winter Conference on Applications of Computer Vision (WACV), Virtual.10.1109/WACV48630.2021.00318 ↗
35. A multivariate intersection over union of SiamRPN network for visual tracking10.1007/s00371-021-02150-1 ↗
36. Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression
37. He, J., Zhang, S., Yang, C., Wang, H., Gao, J., Huang, W., Wang, Q., Wang, X., Yuan, W., and Wu, Y. (2024). Pest recognition in microstates state: An improvement of YOLOv7 based on Spatial and Channel Reconstruction Convolution for feature redundancy and vision transformer with Bi-Level Routing Attention. Front. Plant Sci., 15.10.3389/fpls.2024.1327237 ↗
38. Wikipedia Contributors (2025). Precision and Recall. Wikipedia, The Free Encyclopedia, Wikimedia Foundation, Inc.. Available online: https://en.wikipedia.org/wiki/Precision_and_recall.
39. Groundnut (Arachis hypogaea L.) seed defect classification using ensemble deep learning techniques10.1016/j.atech.2024.100587 ↗
40. Peanut maturity classification using hyperspectral imagery10.1016/j.biosystemseng.2019.10.019 ↗
41. Osornio-Rios, R.A., Cueva-Perez, I., Alvarado-Hernandez, A.I., Dunai, L., Zamudio-Ramirez, I., and Antonino-Daviu, J.A. (2024). FPGA-Microprocessor based Sensor for faults detection in induction motors using time-frequency and machine learning methods. Sensors, 24.10.3390/s24082653 ↗