Pruning-Based TinyML Optimization of Machine Learning Models for Anomaly Detection in Electric Vehicle Charging Infrastructure
Fatemeh Dehrouyeh, Ibrahim Shaer, Soodeh Nikan, Firouz Badrkhani Ajaei, Abdallah Shami
TL;DR
This work tackles real-time anomaly detection in electric vehicle charging infrastructure on resource-constrained devices by combining unstructured pruning with SHAP-based feature selection. Three models (MLP, LSTM, XGBoost) are tuned with Optuna and enhanced using sparse CSR inference, enabling significant reductions in model size and latency while preserving detection performance on the CICEVSE2024 dataset. SHAP-based FS dramatically reduces input features for neural networks, while XGBoost relies on its intrinsic feature importance, collectively yielding up to ~98% inference-time reductions and substantial memory savings with less than a 0.5% drop in accuracy. The results demonstrate the practicality of TinyML for on-device IDS in EV charging ecosystems, supporting secure, low-power operation without constant cloud connectivity.
Abstract
With the growing need for real-time processing on IoT devices, optimizing machine learning (ML) models' size, latency, and computational efficiency is essential. This paper investigates a pruning method for anomaly detection in resource-constrained environments, specifically targeting Electric Vehicle Charging Infrastructure (EVCI). Using the CICEVSE2024 dataset, we trained and optimized three models-Multi-Layer Perceptron (MLP), Long Short-Term Memory (LSTM), and XGBoost-through hyperparameter tuning with Optuna, further refining them using SHapley Additive exPlanations (SHAP)-based feature selection (FS) and unstructured pruning techniques. The optimized models achieved significant reductions in model size and inference times, with only a marginal impact on their performance. Notably, our findings indicate that, in the context of EVCI, pruning and FS can enhance computational efficiency while retaining critical anomaly detection capabilities.
