The rapid changes in the global environment have led to an unprecedented decline in biodiversity, with over 28% of species facing extinction. This includes snakes, which are key to ecological balance. Detecting snakes is challenging due to their camouflage and elusive nature, causing data loss and feature extraction difficulties in ecological monitoring. To address these challenges, we propose an enhanced snake detection model, Snake-DETR, based on RT-DETR, specifically designed for snake detection in complex natural environments. First, we designed the Enhanced Generalized Efficient Layer Aggregation Network Based on Context Anchor Attention, which enhances the feature extraction capability for occluded snakes by aggregating critical layer information and strengthening context-dependent feature extraction. Additionally, we introduced the Enhanced Feature Extraction Backbone Network Based on Context Anchor Attention, which manages input information using multiple Enhanced Generalized Efficient Layer Aggregation Networks to retain essential spatial and semantic information. Subsequently, a lightweight Group-Shuffle Convolution is used to optimize the encoder, which reduces dependency on large-scale training data, thereby making it suitable for deployment on edge devices. Finally, we incorporated the Powerful-IoU loss function to improve regression path accuracy. Experimental results on a custom dataset covering 27 snake species demonstrate that Snake-DETR achieves a good balance between model efficiency and detection performance, meeting the requirements for fine-grained snake object detection. Compared to other state-of-the-art models, Snake-DETR achieved an accuracy of 97.66%, a recall rate of 93.92%, [email protected] of 95.23%, and [email protected]:0.95 of 72.15%, all outperforming other algorithms in the comparative tests. Furthermore, the computational load and parameter count of the model are reduced by 47.2 and 52.2%, respectively, compared to the benchmark model. Additionally, the real-time processing capability is 43.5 frames per second, meeting the demand for real-time processing. Snake-DETR demonstrates excellent performance in complex environments and is suitable for wild snake fauna monitoring and edge device deployment, providing key technical support for ecological research.
Keywords: Context anchor attention; Fine-grained object detection; Power-IoU; RT-DETR; Snake; Snake object detection.
© 2025. The Author(s).