10.57647/ijm2c.2025.152522

A Mathematical Framework for Anomaly Detection in High-Dimensional Data Using Sparse Autoencoders and Mutual Information Filtering

  1. Department of Accounting, Kho.C., Islamic Azad University, Khomeinishahr, Iran
  2. Department of Mathematics, Kho.C., Islamic Azad University, Khomeinishahr, Iran

Received: 18-06-2025

Revised: 28-07-2025

Accepted: 02-08-2025

Published in Issue 04-08-2025

How to Cite

Karimi, K., & Mahmoodi Ranani, E. (2025). A Mathematical Framework for Anomaly Detection in High-Dimensional Data Using Sparse Autoencoders and Mutual Information Filtering. International Journal of Mathematical Modelling & Computations, 15(4). https://doi.org/10.57647/ijm2c.2025.152522

Abstract

In today’s world, where the volume of generated data is rapidly increasing, anomaly detection in high-dimensional datasets remains a significant challenge in data mining and artificial intelligence. With the rapid expansion of the Internet of Things (IoT) and the increasing number of connected devices, security threats in this domain have significantly intensified. Detecting anomalies in IoT network traffic has become a critical component in combating cyber-attacks and maintaining system integrity. This study aims to develop a deep learning-based approach for anomaly detection in network traffic using the Variational Autoencoder (VAE), a probabilistic generative model capable of learning hidden structures in complex data. The UNSW-NB15 benchmark dataset, which includes a wide range of normal and malicious traffic samples, was utilized. After data preprocessing—comprising cleaning, normalization, and feature selection—the VAE model was trained solely on normal data to learn the typical patterns of network behavior. Anomalies were identified by analyzing the reconstruction error between the original and generated data, where instances with high error values were flagged as anomalous. The model was optimized using a loss function combining reconstruction loss and Kullback-Leibler divergence. Experimental results showed that the proposed VAE model achieved an accuracy of 93.8%, a recall of 89.2%, and an AUC score of 0.94, demonstrating its effectiveness in detecting various types of attacks, including DoS, Fuzzing, and Exploit. This research confirms that probabilistic deep learning models, particularly VAEs, offer a robust and scalable solution for anomaly detection in IoT environments and can be instrumental in developing intelligent intrusion detection systems for modern cyber-physical infrastructures.

Keywords

  • Smart Grid,
  • Mathematical Modeling,
  • Partial Differential Equations,
  • Finite Difference Method,
  • MATLAB,
  • Machine Learning,
  • Genetic Algorithm (GA),
  • UNSW-NB15 Dataset,
  • Latent Space Representation

References

  1. Ahmad, T., Chen, H., Wang, J., Yan, &., B (2020). A review on smart grid technologies and challenges. Renewable and Sustainable Energy Reviews, 81, 1–15. https://doi.org/10.1016/j.rser.2016.01.011
  2. Afatinasab, M., al, e. (2025). Modeling smart grid stability using Generative Adversarial Networks (GANs). Journal of Power Engineering, 52(1), 45–60.
  3. Alam, M., St-Hilaire, M., Kunz, &., T (2021). Residential energy optimization using genetic algorithms: Case study of smart homes. Energy and Buildings, 243, 110996.
  4. Alex, R., Nguyen, T., Zhao, &., Y (2025). Optimized load management in smart grids using hybrid AI models. Journal of Smart Energy Systems, 33(2), 45–58. DOI:10.1109/ICoDSE63307.2024.10829903
  5. Amin, M., Wollenberg, &., B (F). (2005). Toward a smart grid: Power delivery for the 21st century. IEEE Power and Energy Magazine, 3(5), 34–41. DOI:10.1109/MPAE.2005.1507024
  6. Anderson, P (2018). Artificial intelligence in complex systems: Managing nonlinear behavior. Complex Systems Journal, 12(3), 198–210. DOI: 10.1109/MPAE.2005.1507024
  7. Bishop, C (M). (2006). Pattern recognition and machine learning. Springer.
  8. Fadaei, H., Setayesh, &., M (2019). Application of evolutionary algorithms in demand-side management: A case study in Isfahan. Iranian Journal of Energy Studies, 10(1), 31–44.
  9. Ghasemi, M., Dehghani, &., M (2022). Analysis of peak load reduction using smart meters in urban Iran. Energy Reports, 8, 2105–2113.
  10. Heydari, S., al, e. (2024). Machine learning algorithms for load forecasting in smart grids. International Journal of Energy Research, 48(4), 563–578.
  11. Hosseini, R., Zangeneh, &., A (2020). Optimal demand response strategies for residential buildings using machine learning. Applied Energy, 275, 115384.
  12. Jafari-Nejad, A., al, e. (2021). Reliability assessment in smart power networks using fuzzy expert systems. Iranian Journal of Electrical Engineering, 29(2), 123–138.
  13. Karimi, R., al, e. (2020). Urban electrical load modeling using artificial neural networks. Energy Systems, 11(2), 245–260.
  14. Kargar, A., Moradi, &., M (H). (2023). Development of intelligent models for electricity consumption forecasting in Iran’s power distribution companies. Journal of Electrical Engineering and Automation, 5(1), 66–75.
  15. Khodabakhsh, M., Taheri, &., M (2021). The role of smart grid in energy security in Iran: Challenges and opportunities. Iranian Energy Policy Review, 6(2), 88–103.
  16. Khosravi, A., al, e. (2024). Smart grid development and challenges in Iran. Energy Reports, 10, 1123–1135.
  17. LeCun, Y., Bengio, Y., Hinton, &., G (2015). Deep learning. Nature, 521(7553), 436–444.
  18. Mirzaei, H., al, e. (2022). Application of genetic algorithms in energy consumption forecasting for Iran’s smart grids. Journal of Renewable Energy, 57, 112–126.
  19. Mirzaei, M., Rahimi, &., A (2023). Multi-objective optimization of energy use in smart homes. Energy Efficiency Journal, 16(3), 45–60.
  20. Mohammadi, M., al, e. (2023). Artificial intelligence applications in engineering and mathematical sciences in Iran. Journal of AI Research, 44(1), 77–92.
  21. Mitchell, M (2009). Complexity: A guided tour. Oxford University Press.
  22. Nazari, P., al, e. (2019). Reinforcement learning optimization of power flow in distribution networks. IEEE Transactions on Smart Grid, 10(3), 2158–2166.
  23. Pujari, S., al, e. (2024). Energy consumption optimization in smart grids using machine learning. Energy Informatics, 7(1), 15–27.
  24. Rahman, F., al, e. (2023). Electric load forecasting in smart infrastructure using federated learning. Sustainable Computing: Informatics and Systems, 37, 100661.
  25. Rashid, T., al, e. (2024). Stability analysis and energy optimization in smart grids with machine learning. International Journal of Electrical Power & Energy Systems, 140, 108007.
  26. Rezaei, M., al, e. (2023). Dynamic behavior and optimization of smart grids in Iran. Journal of Power and Energy Engineering, 11(3), 145–160.
  27. Russell, S., Norvig, &., P (2021). Artificial intelligence: A modern approach (4th ed.). Pearson.
  28. Verma, S., Rao, &., N (2025). Anomaly detection in smart grids using deep learning. Journal of Cybersecurity in Energy Systems, 3(2), 89–101. DOI: 10.1109/IECON48115.2021.9589851
  29. Zhang, J., al, e. (2023). Machine learning applications in energy systems: A review. Renewable and Sustainable Energy Reviews, 160, 112287. DOI:10.1186/s42162-025-00524-6
  30. Zhang, Y., al, e. (2024). Challenges and opportunities of federated learning in smart grids. IEEE Transactions on Industrial Informatics, 20(1), 34–45.
  31. Zhang, Y., al, e. (2022). Optimization of power grid operations using genetic algorithms. Energy Systems, 13(1), 75–88.
  32. Zhou, B., Yang, S., Zhang, &., X (2020). Load shifting strategies and energy efficiency in smart grid environments. Energy Procedia, 158, 3121–3126.
  33. Khadem, M., Eshlaghy, T., A., Hafshejani, &. F., K (2022). Improving the Performance of Adaptive Neural Fuzzy Inference System (ANFIS) Using a New Meta‑Heuristic Algorithm. International Journal of Mathematical Modelling & Computations, 12(4), 299–312. https://doi.org/10.30495/ijm2c.2023.1955549.1251
  34. Naser, M (M). R., Jalali Varnamkhasti, M., Jasim Mohammed, H., & Aghajani, M. (2024). Artificial Intelligence as a Catalyst for Operational Excellence in Iraqi Industries: Implementation of a Proposed Model. International Journal of Mathematical Modelling & Computations, 14(2), 101–117. https://doi.org/10.71932/ijm.2024.1197656