## 3 Detection of Cyber-Attacks with Supervised Machine Learning-Artificial Neural Networks
### Cyber-Physical PV-Powered Energy Island Structure
Cyber attackers can interrupt data flow, send deceptive control signals, or modify information. As a result of such an attack, energy production and consumption may be mismanaged, leading to overload or energy outages. * In hijacking attacks, the adversary can intercept data, alter it, or inject fake commands by acting as a bridge between the EI's control devices and the central energy management, as seen in Figure 1:2 For better illustration, false signals can be sent that reduce the production level of PV panels or overload the microgrid. * In FDI attacks, attackers inject misleading sensor data into the system, leading the system to make incorrect decisions. For instance, sending fake voltage and frequency data can misdirect energy production or storage, resulting in system instability, overload, or equipment failures, as shown in Figure 1:3  
Finally, malware and ransomware attacks involve malware infecting EIs' digital systems. Malware can hinder the controllers' operation, cause data loss, or lock down systems with ransom demands. A ransomware attack on an EI could result in complete system downtime and significant economic losses. A hijack attack manipulates the control signals (e.g., \(d\), sensor data of control layer-\(V_{PV}\), \(I_{PV}\)), resulting in incorrect power dispatch and instability issues. Once a hijack attack occurs, the compromised \(d\) can be expressed as follows:  
Figure 1:4where, \(\Delta d_{Attack}\) denotes the attack that involved an error in the \(d\). Afterward, the output of the converter, i.e., \(V_{DC}\), is stated as  
Figure 1:5  
where, \(\Delta V_{Attack}\) expresses the deviation in the \(V_{DC}\) originating from the attack. Suppose attacks occur in the measurement signals or control devices to modify power demand, trick the system into producing insufficient power, or lead to incorrect control decisions. In that case, an FDI attack manipulates the system by injecting false data into it. Similarly, the compromised sensor measurement value-\(m\) is presented as follows:  
Figure 1:6  
Whilst the attack aims at the control layer sensors, such as voltage and current sensors,  
\[\left. \begin{array}{c}V_{PV}{}^{*}=\Delta V+V_{PV}\\ I_{PV}{}^{*}=\Delta I+I_{PV}\end{array} \right\} \tag{12}\]  
where, \(m\) is current sensor measurements, \(\Delta m\) is the injected attack signal, \(\Delta V\) and \(\Delta I\) are injected attacks for voltage and current sensors, respectively. The injected signal emulates an FDI attack in our simulations, where a bias (constant shift) or time-varying perturbation is added to the sensor measurements. After the perturbation, the gate signal of the semiconductor device is completely altered and deviates from the expected range of switching characteristics. The signal is incorporated into the \(V_{PV}\) and \(I_{PV}\) measurements to induce misinterpretations in the ANN-based detection system. While the sensor data is disturbed by the cyber-physical component under the FDI attack, the hijacking attack injects fake commands by serving as a bridge between the EI's control devices. To mitigate the negative impacts of cyber-attacks, utilizing AI-supported intrusion detection systems, employing encrypted and secure communication protocols, such as VPN, developing real-time monitoring and anomaly detection systems, ensuring data integrity with blockchain-based security solutions, and implementing robust authentication mechanisms (multi-factor authentication) can be remedy for addressed issues. As mentioned before, an AI-supported intrusion detection and defense mechanism was established using an SML-based ANN structure in this study. Consequently, cyber-physical EIs must be safeguarded against both digital and physical threats. Hijacking attacks on the control layer represent a significant risk to their security. Therefore, strong cybersecurity measures and intelligent detection mechanisms should be designed to prevent such attacks and enhance the reliability of energy systems.