Explainable and cyber-resilient vision transformers for joint steering and collision-avoidance perception in autonomous drone navigation: a multi-task Grad-CAM framework
Abstract
Micro aerial vehicles (MAVs) flying through indoor corridors and other GNSS-denied environments cannot rely on satellite positioning, so a single monocular RGB camera is often the only sensing modality available. The navigation objective addressed in this paper is reactive, map-free corridor following: from each camera frame the onboard perception stack must choose a discrete steering direction that keeps the vehicle advancing along the corridor while avoiding walls and obstacles, rather than tracking a pre-specified waypoint, route, or global path. Prior work (DroNet, PULP-DroNet) addresses this problem with lightweight convolutional networks that map camera frames directly to a steering command and a collision flag; this paper asks whether a Vision Transformer can perform the same mapping with higher accuracy while remaining auditable. We present ViTDrone, an explainable artificial intelligence (XAI) framework that couples a Vision Transformer (ViT-Base/16) backbone with multi-task learning and gradient-weighted class activation mapping (Grad-CAM). From a single shared backbone the model simultaneously predicts a three-class steering command (left/forward/right) and a binary collision label. We build a scalable data pipeline that aggregates 309 acquisition sequences of the PULP-DroNet v3 benchmark, yielding 195,455 training and 76,390 test frames annotated with yaw-rate commands and collision risk. After five epochs of AdamW fine-tuning from ImageNet-21k weights, ViTDrone attains 76.35% yaw classification accuracy and 60.77% collision accuracy. To make the model auditable we adapt Grad-CAM to the transformer with a reshape transform over the patch tokens. The resulting saliency maps are reassuring: the network looks where a human pilot would, at floor-wall boundaries when it decides to turn and at overhead structure when it senses a collision. However, aggregate accuracy conceals substantial variation across classes. A per-class analysis, combining loss curves, confusion matrices, and a comparison against convolutional baselines, shows that the reported accuracies are driven disproportionately by the two majority classes (forward steering and no-collision), while minority classes, sharp turns and imminent collisions, are recognized far less reliably. We attribute this shortfall to two measurable causes rather than to insufficient backbone capacity: severe label imbalance (78.6% forward, 60.7% no-collision) and a persistent gap between training and validation loss that is consistent with distribution shift across acquisition sequences. Relative to prior work, which has evaluated either convolutional navigation policies without explainability or Vision Transformer explainability outside the UAV navigation setting, this paper contributes (i) to our knowledge, the first integration of transformer-native Grad-CAM explainability with a multi-task steering-and-collision policy for MAV navigation, and (ii) a systematic diagnosis showing that class imbalance and domain shift, rather than model capacity, are the dominant factors limiting both accuracy and interpretability in this setting, together with a concrete research agenda for addressing them.