As Artificial Intelligence (AI) becomes increasingly integrated into
microgrid control systems, the risk of malicious actors exploiting
vulnerabilities in Machine Learning (ML) algorithms to disrupt power generation
and distribution grows. Detection models to identify adversarial attacks need
to meet the constraints of edge environments, where computational power and
memory are often limited. To address this issue, we propose a novel strategy
that optimizes detection models for Vehicle-to-Microgrid (V2M) edge
environments without compromising performance against inference and evasion
attacks. Our approach integrates model design and compression into a unified
process and results in a highly compact detection model that maintains high
accuracy. We evaluated our method against four benchmark evasion attacks-Fast
Gradient Sign Method (FGSM), Basic Iterative Method (BIM), Carlini & Wagner
method (C&W) and Conditional Generative Adversarial Network (CGAN) method-and
two knowledge-based attacks, white-box and gray-box. Our optimized model
reduces memory usage from 20MB to 1.3MB, inference time from 3.2 seconds to 0.9
seconds, and GPU utilization from 5% to 2.68%.