Intrinsic Attention vs. Post-Hoc Explainability in Edge-Deployed Motor Load Classification: A TinyML Benchmark on Android smartphones

Read full text
Authors: SRINIVAAS ASHOK KUMAR, Lakshmana Kumar Ramasamy, Vishal Krishnaa R, Ram Viyaas S, Raju, Gunasunderi, L. C. Shashidhara
Cited by: 0

Abstract

File Descriptions Model Training 1D_CNN_Training_Code.txtTrains the baseline 1D Convolutional Neural Network on the multisensor acoustic dataset. Includes raw sensor preprocessing, non-overlapping windowing (window=200, step=100), 5-fold cross-validation with GroupKFold to prevent data leakage, dynamic class balancing, and performance evaluation metrics (accuracy, F1, ROC-AUC, confusion matrix). CNN_BiGRU_Attention_Training_Code.txtTrains the proposed hybrid CNN–BiGRU model with a custom Bahdanau-style Attention layer. Maintains identical cross-validation and hyperparameter settings as the 1D-CNN to ensure fair model performance comparison. Exports the attention weights for intrinsic explainability. XAI Core Utilities XAI_Metrics.txtCore evaluation utility that calculates the exact formulas for Faithfulness (Deletion and Insertion AUC), Sparsity (Gini index), Stability (Variance), and Robustness against standard Gaussian noise perturbations. XAI_Methods.txtCore wrapper functions containing standardized implementations for generating explanation maps. Includes utilities for sliding-window Occlusion, SHAP (KernelExplainer), LIME tabular wrappers, and attention-weight extraction from the CNN–BiGRU architecture. Benchmarking Scripts Benchmarking_Faithfulness_Attention.txtEvaluation script that calculates the intrinsic faithfulness of the CNN–BiGRU model. Extracts the temporal attention weights and executes continuous temporal deletion and insertion over the acoustic signal dataset, recording the exact drop in probability. Benchmarking_Faithfulness_Occlusion.txtEvaluation script that systematically zeroes out temporal segments of the 1D-CNN input to compute Occlusion maps. Evaluates the Deletion and Insertion Area Under Curve (AUC) to benchmark the reliability of perturbation-based XAI. Benchmarking_Faithfulness_SHAP_LIME.txtExecutes extensive post-hoc evaluation using SHAP (KernelExplainer) and LIME on the 1D-CNN model. Applies rigorous disjoint background sampling and exhaustive subset evaluations to provide a statistically sound baseline for post-hoc computational overhead and reliability. Android Kotlin Applications Android_Kotlin_App_Attention_Code.txtRaw Kotlin source files for the on-device mobile application running the intrinsic CNN–BiGRU model. Demonstrates extremely low-latency, real-time inference and immediate attention-map generation directly on a smartphone (Samsung Galaxy S23) without cloud dependency. Android_Kotlin_App_Occlusion_Code.txtRaw Kotlin source files for the on-device mobile application running the 1D-CNN model. Performs real-time sliding-window occlusion analysis for fast perturbation-based explanations directly on mobile hardware. Android_Kotlin_App_SHAP_LIME_Code.txtRaw Kotlin source files implementing optimized versions of LIME and SHAP algorithms for on-device execution. Includes weighted least-squares solvers and exact feature masking logic to benchmark the severe latency and memory overhead of post-hoc methods on mobile hardware. Dataset DescriptionRaw triaxial accelerometer and magnetometer signals recorded from a Siemens 20 HP, 3-phase induction motor (1440 RPM) coupled with a Micro Finish centrifugal pump, controlled by a Variable Frequency Drive (VFD).

Fields of Study & Subjects

Explainable Artificial Intelligence (XAI) Advanced Neural Network Applications IoT and Edge/Fog Computing

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
28 February 2026
Language
EN