# Toward Secure Smart Grid Systems: Risks, Threats, Challenges, and Future Directions
## 5 Smart Grid Attacks
### Non-Cryptography Solutions
#### 7.2.1 Anomaly Detection  
Anomaly detection is essential in smart grids due to the vast amount of data generated by IoT devices in real time, including energy consumption and grid conditions. These techniques identify and analyze abnormal patterns and behaviors to ensure the smart grid's safety, security, and reliability while also enabling efficient energy management. As a result, various anomaly-detection-based solutions were presented (see Table 25) that can be based on statistical or machine learning approaches (unsupervised, supervised, or semi-supervised). In [242], [PERSON] et al. presented a survey that discusses the security and safety issues, limitations, challenges, and solutions of federated learning with IoT systems, especially involving CPS and smart grid systems. In [243], [PERSON] et al. presented a statistical-based anomaly detection method to detect consumption anomalies in a real-time manner. The results demonstrated the effectiveness and scalability of the proposed lambda detection system. Examples of unsupervised learning approaches such as [PERSON] et al. [244] identify anomalies in the smart grid traffic and detect flooding and DoS attacks in smart grid networks using the k-Means clustering algorithm to cluster traffic data and outlier detection for the transmitted data. The results showed that it has a higher percentage in anomaly detection. Also, [PERSON] et al. [245] presented an unsupervised anomaly detection scheme based on a statistical correlation between measurements to differentiate between an actual fault, a disturbance, and an intelligent cyberattack. The results showed that the scheme achieves an accuracy of 99%, a true-positive rate of 98%, and a false-positive rate of less than 2%. In [246], [PERSON] et al. presented a strategy to detect anomalies in the edge of the smart grid using a fog computing approach that detects anomalous patterns in the electricity consumption data via collaboration of distributed devices at the edge of the smart grid network to reduce communication delay. In [247], [PERSON] et al. presented a cyber-physical sensor called Industrial (Control Systems) Resilient Security Technology (IREST) that detects anomalies by considering both cyber and physical disturbances in a complex system, providing a scalable framework for cyber-physical security research. In [248], [PERSON] et al. presented a privacy-preserving anomaly-based data falsification attack detection over Fully Homomorphic Encrypted (FHE) data that performs the needed computations to detect attacks over encrypted individual customer smart meter data. The experimental results show that injection of false power consumption is detected within 11-17 s of execution time, depending on the accuracy. In [249], [PERSON] et al. presented a supervised Machine Learning (ML)-based Anomaly Detection System (ADS) to detect various stealthy IT and OT attacks on DER communication. The experimental results showed that the system has a detection rate of 98.4%, a false-positive rate of 0.28%, and a false-negative rate of 1.32%. In [250], [PERSON] et al. presented an adoption of deep (stacked) auto-encoders with a Long Short-Term Memory (LSTM)-based sequence-to-sequence (seq2 seq) structure to capture the sophisticated data patterns and exploit the time-series nature of data. The simulation results showed an enhancement of 4-21% and 4-13% in detection and false alarm rates. In [251], [PERSON] et al. presented an approach based on physics-informed hybrid deep-learning detection using a process control-based variational autoencoder, prior knowledge of physics, and Long Short-Term Memory to detect false data injection attacks. The experimental results show that the accuracy of the lowest reconstruction error is 96.9%. In [252], [PERSON] et al. introduced a novel privacy-preserving Federated semi-Supervised Class-Rebalanced (Fed-SCR) framework to detect anomalous power data in fog-assisted smart grids while maintaining communication efficiency.