A Comparative Analysis of Pruning, Quantization, and Compilation for LightGBM-Based Electricity Anomaly Detection on IoT Edge Devices

Authors

  • Soiful Hadi Diponegoro University, Semarang, Indonesia | Semarang University, Semarang, Indonesia
  • Wahyul Amien Syafei Diponegoro University, Semarang, Indonesia
  • Adi Wibowo Diponegoro University, Semarang, Indonesia
  • Wahyu Maulana Hassanudin Semarang University, Semarang, Indonesia
  • Eko Fidia Setiana Semarang University, Semarang, Indonesia
  • Astrid Novita Putri Semarang University, Semarang, Indonesia
Volume: 16 | Issue: 2 | Pages: 32935-32941 | April 2026 | https://doi.org/10.48084/etasr.16433

Abstract

Operating machine learning models designed for electricity theft detection on resource-limited Internet of Things (IoT) edge devices involves significant trade-offs among inference speed, power utilization, and detection precision. This paper provides the first detailed comparison of pruning, quantization, and compilation strategies on Raspberry Pi 4 hardware for Light Gradient Boosting Machine (LightGBM)-based anomaly detection. We tested three optimization strategies: pruned models, Open Neural Network Exchange (ONNX) 8-bit integer (INT8) quantization, and Treelite compilation against a baseline native version for 1,000 inference cycles under practical operating conditions. ONNX INT8 quantization produced a 40.66× speedup for real-time inference (0.091 ms), but exhibited significant thermal load (80.67% CPU utilization, +7.3 °C). Treelite offered best-in-class batch processing efficiency (13.41× speedup, 25.99% CPU utilization). All approaches retained 96.98% accuracy and produced an identical confusion matrix to the baseline model. Experiments indicate that the choice of the optimization strategy hinges critically on deployment scenarios, such as real-time streaming versus occasional batch processing. Our results give practical recommendations for implementers of edge-based grid smart-monitoring systems.

Keywords:

edge computing, LightGBM optimization, electricity theft detection, model quantization, IoT deployment

Downloads

Download data is not yet available.

References

B. Wang et al., "An IoT-Enabled Stochastic Operation Management Framework for Smart Grids," IEEE Transactions on Intelligent Transportation Systems, vol. 24, no. 1, pp. 1025–1034, Jan. 2023. DOI: https://doi.org/10.1109/TITS.2022.3183327

A. Muzumdar, C. Modi, and C. Vyjayanthi, "Designing a blockchain-enabled privacy-preserving energy theft detection system for smart grid neighborhood area network," Electric Power Systems Research, vol. 207, June 2022, Art. no. 107884. DOI: https://doi.org/10.1016/j.epsr.2022.107884

D. Utomo and P.-A. Hsiung, "A Multitiered Solution for Anomaly Detection in Edge Computing for Smart Meters," Sensors, vol. 20, no. 18, Sept. 2020, Art. no. 5159. DOI: https://doi.org/10.3390/s20185159

M. J. C. S. Reis and C. Serôdio, "Edge AI for Real-Time Anomaly Detection in Smart Homes," Future Internet, vol. 17, no. 4, Apr. 2025, Art. no. 179. DOI: https://doi.org/10.3390/fi17040179

C. Bentéjac, A. Csörgő, and G. Martínez-Muñoz, "A comparative analysis of gradient boosting algorithms," Artificial Intelligence Review, vol. 54, no. 3, pp. 1937–1967, Mar. 2021. DOI: https://doi.org/10.1007/s10462-020-09896-5

K.-T. Nguyen, T.-N. Tran, and H.-T. Nguyen, "Research on the Influence of Hyperparameters on the LightGBM Model in Load Forecasting," Engineering, Technology & Applied Science Research, vol. 14, no. 5, pp. 17005–17010, Oct. 2024. DOI: https://doi.org/10.48084/etasr.8266

K. M. Hosny, A. Magdi, A. Salah, O. El-Komy, and N. A. Lashin, "Internet of things applications using Raspberry-Pi: a survey," International Journal of Electrical and Computer Engineering, vol. 13, no. 1, pp. 902–910, Feb. 2023. DOI: https://doi.org/10.11591/ijece.v13i1.pp902-910

H. Guo, Z. Zhou, D. Zhao, and W. Gaaloul, "EGNN: Energy-efficient anomaly detection for IoT multivariate time series data using graph neural network," Future Generation Computer Systems, vol. 151, pp. 45–56, Feb. 2024. DOI: https://doi.org/10.1016/j.future.2023.09.028

S. Hadi, W. Amien Syafei, and A. Wibowo, "Ambient Intelligence to Detect Misuse of Electricity Consumption Based on IoT Using Blockchain Technology," IEEE Access, vol. 13, pp. 80371–80394, 2025. DOI: https://doi.org/10.1109/ACCESS.2025.3561677

S. Y. Appiah, E. K. Akowuah, V. C. Ikpo, and A. Dede, "Extremely randomised trees machine learning model for electricity theft detection," Machine Learning with Applications, vol. 12, June 2023, Art. no. 100458. DOI: https://doi.org/10.1016/j.mlwa.2023.100458

S. Ronaghi, A. Ferrero, S. Salicone, and H. V. Jetti, "Data-Driven Anomaly Detection for Smart Energy Meters," in 2024 IEEE 14th International Workshop on Applied Measurements for Power Systems, Caserta, Italy, 2024, pp. 1–6. DOI: https://doi.org/10.1109/AMPS62611.2024.10706664

G. Ke et al., "LightGBM: a highly efficient gradient boosting decision tree," in Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA, 2017, pp. 3149–3157.

M. A. Mohsin, S. N. Shahrouzi, and D. G. Perera, "Composing Efficient Computational Models for Real-Time Processing on Next-Generation Edge-Computing Platforms," IEEE Access, vol. 12, pp. 24905–24932, 2024. DOI: https://doi.org/10.1109/ACCESS.2024.3365652

J. Jin, X. Qiu, and C. Lu, "Edge Artificial Intelligence for Electrical Anomaly Detection Based on Process-In-Memory Chip," Electronics, vol. 13, no. 21, Oct. 2024, Art. no. 4255. DOI: https://doi.org/10.3390/electronics13214255

R. D. Rachmanto, Z. Sukma, A. N. L. Nabhaan, A. Setyanto, T. Jiang, and I. K. Kim, "Characterizing Deep Learning Model Compression with Post-Training Quantization on Accelerated Edge Devices," in 2024 IEEE International Conference on Edge Computing and Communications, Shenzhen, China, 2024, pp. 110–120. DOI: https://doi.org/10.1109/EDGE62653.2024.00023

J. Lee, M. Yu, Y. Kwon, and T. Kim, "Quantune: Post-training quantization of convolutional neural networks using extreme gradient boosting for fast deployment," Future Generation Computer Systems, vol. 132, pp. 124–135, July 2022. DOI: https://doi.org/10.1016/j.future.2022.02.005

F. Alkhoury, S. Buschjäger, and P. Welke, "Splitting stump forests: tree ensemble compression for edge devices (extended version)," Machine Learning, vol. 114, no. 10, Aug. 2025, Art. no. 219. DOI: https://doi.org/10.1007/s10994-025-06866-2

A. P. Taruna, G. Arisona, D. Irwanto, A. B. Bestari, and W. Juniawan, "Electricity Theft Detection Using Machine Learning in Traditional Meter Postpaid Residential Customers: A Case Study on State Electricity Company (PLN) Indonesia," IEEE Access, vol. 13, pp. 7167–7191, 2025. DOI: https://doi.org/10.1109/ACCESS.2025.3526764

Buku 2: Standar Konstruksi Sambungan Tenaga Listrik, Keputusan Direksi PT PLN (Persero) No. 474.K/DIR/2010, PT PLN (Persero), Jakarta, Indonesia, 2010.

R. Yao, N. Wang, Z. Liu, P. Chen, D. Ma, and X. Sheng, "Intrusion detection system in the Smart Distribution Network: A feature engineering based AE-LightGBM approach," Energy Reports, vol. 7, pp. 353–361, Nov. 2021. DOI: https://doi.org/10.1016/j.egyr.2021.10.024

"Treelite : model compiler for decision tree ensembles." Treelite. https://treelite.readthedocs.io/en/2.4.0/.

Downloads

How to Cite

[1]
S. Hadi, W. A. Syafei, A. Wibowo, W. M. Hassanudin, E. F. Setiana, and A. N. Putri, “A Comparative Analysis of Pruning, Quantization, and Compilation for LightGBM-Based Electricity Anomaly Detection on IoT Edge Devices”, Eng. Technol. Appl. Sci. Res., vol. 16, no. 2, pp. 32935–32941, Apr. 2026.

Metrics

Abstract Views: 209
PDF Downloads: 50

Metrics Information