Accurate identification of rice pests is often crucial for national food security. A robust pest recognition model is also required in complex field scenarios. However, existing models are limited in cross-channel feature extraction due to the extremely imbalanced data in sample distribution. In this study, a dual-feature dynamic optimization model—ResNet-EAF, was proposed to recognize the rice pest with the imbalanced image dataset. Two feature calibration mechanisms were integrated, namely Efficient Channel Attention (ECA) and Channel-wise Affine Adaptation (CAA), to achieve synergistic and precise optimization of feature representation. This framework was used to construct the dual-feature optimization mechanism of "ECA feature screening—CAA feature calibration" after the Global Average Pooling (GAP) layer of the ResNet50 network. In the ECA module, the inter-channel correlations were established within local windows via adaptively matched 1D convolution kernels. Cross-channel interaction information was captured without dimensionality reduction. The weights of key pest feature channels were adaptively amplified to suppress the interference from redundant channels, thereby extracting the key features. Two types of learnable parameters were introduced into the CAA module. Each feature channel was realized to independently learn the configurations. The contribution weights were regulated and then refined using machine learning. The channels were prioritized for classification to weaken the noise channels during optimization. As such, the CAA module was realized to decouple the weight-bias coupling relationship in conventional affine transformation into channel-wise independent scaling-translation. The feature distinguishability among different pest categories was improved by the feature distribution in the datasets. The domain shift was then alleviated to enhance the generalization of the unknown field data. Notably, the very few learnable parameters were added with negligible computational overhead for the high recognition efficiency. A dynamic balanced loss strategy with Focal Loss (FL), inverse frequency weighting, and modulation coefficients acted synergistically with the dual-feature module to tackle the extreme sample imbalance. Specifically, the inverse frequency weighting dynamically assigned the weights according to the proportion of class samples to initially balance category distribution. The FL reduced the weights of easily classified majority-class samples via a modulation factor, thus focusing machine learning on hard-to-classify minority-class samples. Additional modulation coefficients were used to fine-tune the loss gradient for the training bias caused by extreme imbalance. Accurate identification of dominant pest categories was realized in the subtle core features of minority-class samples. The coverage of full-category recognition was significantly improved after optimization, which was highly compatible with the stable deep feature extraction of ResNet50. A series of experiments was conducted on the self-built pest image dataset. The ResNet-EAF model achieved an accuracy of 98.06%, a macro-average recall of 93.93%, and an F1-score of 93.80%, which were 3.63, 6.96, and 5.67 percentage points higher than the baseline model, respectively, thus ranking first among 11 models. Furthermore, the recall rates increased by 13.16 and 4.55 percentage points, respectively, in the minority-class pests (Pyralidae and Arctiidae). An anti-interference and generalization were evaluated on the public JUTE PEST dataset in real field environments. The ResNet-EAF model achieved an accuracy of 98.35% (second only to DINOv2’s 98.42%), with the highest macro-average recall and the recall rate of the minority-class Beet Armyworm among 11 models. Ablation experiments also verified the effectiveness of the dual-feature module. A channel importance pre-screening mechanism was lacking in the CAA module to locate key pest features. Generalized feature calibration failed to directly solve the minority-class recognition. In contrast, the ECA and CAA modules were combined into the complete "feature screening—calibration" closed loop. Firstly, the ECA module was used to precisely screen the key channels for the high-quality "effective feature base" in the CAA module. And then the CAA module performed the channel-wise adaptive calibration on these features for the feature distinguishability. In addition, the combination of ECA and dynamic balanced loss was achieved in the highest accuracy, macro-average recall, and F1-score among four mainstream attention mechanisms and five common loss functions. In summary, ResNet-EAF can provide an efficient technical solution to monitor pest disease under the imbalanced data scenarios using ECA-CAA dual-feature dynamic optimization and synergistic dynamic loss strategy. The practicality and robustness of the model were verified in complex field environments. The significant performance was obtained from the constructive interaction of FL, ECA, and CAA. The finding can offer an extensible solution for reliable field pest recognition in precision agriculture.
- Article type
- Year
- Co-author
Object detection can often hold the promising potential to replace the human visual recognition in smart agriculture. However, the small target pests are still challenging to detect for three reasons. Firstly, the pests can move rapidly, which is difficult to for real-time detection. Secondly, the accuracy of the model can depend mainly on the small size, the large number of groups, the uneven distribution, and the occluded pests of each other. Finally, the imbalanced sample can make the recognition more difficult, leading to the low accuracy of detection. It is necessary to efficiently and precisely identify the numerous, unevenly distributed, complex shapes, as well as small and densely packed pests. In this study, a pest recognition (called FieldSentinel-YOLOv8) was proposed using the improved YOLOv8m model. The FieldSentinel-YOLOv8 was improved as follows. Firstly, three detection heads were replaced by two ones, in order to simplify the original YOLOv8 model. The SMO (simplify model operations) was enhanced the fine-grained features for the small targets. The floating-point operations and computational burden were also reduced to streamline the YOLOv8 model; Secondly, the convolutional block attention module (CBAM) was integrated into the YOLOv8. Thus the general feature (such as background) was suppressed to focus more on the pest regions. Thus, the accuracy of the improved model was enhanced to identify the occluded pests. Lastly, the Focal-CIoU Loss was employed to replace the CIoU Loss. The class imbalance was reduced to further improve the accuracy of detection. Many current models depend heavily on the overly idealized datasets, leading to compromise in their accuracy in actual field conditions. Pest monitoring equipment was deployed directly in the field. The datasets were collected under natural environments, indicating the accurate reflection of the real-world presence of pests. The dataset was then taken by the pest monitoring equipment. A series of comparative experiments were conducted to evaluate the performance of the FieldSentinel-YOLOv8 under identical conditions using a self-constructed dataset and various object detections. FieldSentinel-YOLOv8 algorithm also demonstrated the superior performance across most metrics. Compared with the original model, the improved model was reduced the number of parameters by 15.52 M, whereas, there was the an increase in the processing speed to 52.73 frames per second. Moreover, the mAP0.5 and recall rate of the improved model were enhanced by 2.72 and 7.05 percentage points, respectively. Furthermore, transfer learning was employed to train the FieldSentinel-YOLOv8 model, taking the Pest24 dataset as the source domain and a self-built dataset as the target domain. The trained model was then named the FieldSentinelTransfer-YOLOv8. The improved model was achieved in the better performance of detection after transfer learning. The mAP0.5 increased by 3.36 percentage points, reaching 77.00%, with the accuracy and recall rates of 69.90% and 77.73%, respectively. Therefore, the FieldSentinel-YOLOv8 can provide the valuable technical references for the accurate and rapid identification of agricultural pests. The high-precision FieldSentinelTransferYOLOv8 model after transfer learning can also offer the technical support for the detection of agricultural pests.
京公网安备11010802044758号