Small targets in drone imagery are often difficult to accurately locate and identify due to scale imbalance and limitations, such as pixel representation and dynamic environmental interference, and the balance between detection accuracy and resource consumption of the model also poses challenges. Therefore, we propose an interpretable computer vision framework based on YOLOv12m, called LCW-YOLO. First, we adopt multi-scale heterogeneous convolutional kernels to improve the lightweight channel-level and spatial attention combined context (LA2C2f) structure, enhancing spatial perception capabilities while reducing model computational load. Second, to enhance feature fusion capabilities, we propose the Convolutional Attention Integration Module (CAIM), enabling the fusion of original features across channels, spatial dimensions, and layers, thereby strengthening contextual attention. Finally, the model incorporates Wise-IoU (WIoU) v3, which dynamically allocates loss weights for detected objects. This allows the model to adjust its focus on samples of average quality during training based on object difficulty, thereby improving the model’s generalization capabilities. According to experimental results, LCW-YOLO eliminates 0.4 M parameters and improves mAP@0.5 by 3.3% on the VisDrone2019 dataset when compared to YOLOv12m. And the model improves mAP@0.5 by 1.9% on the UAVVaste dataset. In the task of identifying small objects with drones, LCW-YOLO, as an explainable AI (XAI) model, provides visual detection results and effectively balances accuracy, lightweight design, and generalization capabilities.
The autonomous navigation of inspection robots in complex forest environments heavily relies on accurate trunk detection. However, existing detection models struggle to achieve both high accuracy and real-time performance on resource-constrained edge devices. To address this challenge, this study proposes a lightweight algorithm named YOLOv11-TrunkLight. The core innovations of the algorithm include (1) a novel StarNet_Trunk backbone network, which replaces traditional residual connections with element-wise multiplication and incorporates depthwise separable convolutions, significantly reducing computational complexity while maintaining a large receptive field; (2) the C2DA deformable attention module, which effectively handles the geometric deformation of tree trunks through dynamic relative position bias encoding; and (3) the EffiDet detection head, which improves detection speed and reduces the number of parameters through dual-path feature decoupling and a dynamic anchor mechanism. Experimental results demonstrate that compared to the baseline YOLOv11 model, our method improves detection speed by 13.5%, reduces the number of parameters by 34.6%, and decreases computational load (FLOPs) by 39.7%, while the average precision (mAP) is only marginally reduced by 0.1%. These advancements make the algorithm particularly suitable for deployment on resource-constrained edge devices of inspection robots, providing reliable technical support for intelligent forestry management.