# Risk Assessment Method of Solar Smart Grid Network Security Based on TimesNet Model
## 4 Analysis of the Results of NSR Evaluation for Smart Grid
### Performance Analysis of SGTBD Model  
To validate the feasibility of the TimesNet-based SGTBD, this study used a publicly available dataset of actual electricity users from the Irish power grid for testing. The dataset was published by the Irish National Grid operator and ESB Networks and includes power generation data from renewable energy sources such as wind and solar energy [25]. Randomly selecting 90 days of electricity consumption data from 2000 users. Considering that the electricity consumption behavior of normal electricity users usually has periodicity, a sample of 12,000 normal samples is taken based on 15 days of electricity consumption data for each user. Randomly select 5%, 10%, 15%, 20%, and 25% of 12,000 normal samples, add random noise to the electricity consumption data of the normal samples to cause abnormal fluctuations in the data, simulate electricity theft behavior, and generate electricity theft users. Divide the model into training, validation, and testing sets in an 8:1:1 ratio. Due to the normal sample size of 12,000, electricity theft samples are generated by randomly selecting 5%, 10%, 15%, 20%, and 25% of the normal samples. This means that the number of electricity theft samples is much smaller than that of normal samples, and the dataset exhibits significant imbalance. Unbalanced datasets may cause the model to lean towards the majority class (i.e., normal samples) during training, resulting in insufficient detection ability for minority classes (electricity theft samples). The testing environment adopts the Windows 11 system, with AMD Ryzen 75800H CPU. The host memory is 32.0 GB, and the graphics card is NVIDIA GeForce RTX 3060. The iterations are set to 200. The Detection Rate (DR) and False Detection Rate (FDR) of the model are analyzed under different theft detection windows and theft data ratios, as shown in Figure 6. In Figure 6a, as the window for electricity theft detection increases, the DR of the model gradually increases and the FDR gradually decreases. When the electricity theft detection window reaches 15 days and continues to increase, the magnitude of changes in the DR and FDR models decreases, so the electricity theft detection window is set to 15 days. In Figure 6b, as the proportion of electricity theft data in the dataset increases, the DR and FDR of the model show a gradually increasing trend overall, but the FDR is still at a relatively low level. When the proportion of electricity theft data is 25%, the FDR is 3.52. The reason for false positives may be that although Tsfresh can extract time series features, in some cases, it may not be able to fully distinguish the subtle differences between normal electricity consumption and electricity theft behavior. For example, some users have unique electricity usage patterns, such as the use of temporary high energy consuming devices, which may result in peak electricity consumption and similar characteristics to electricity theft behavior, leading to misjudgment as electricity theft. This indicates that the SGTBD model based on TimesNet still has good detection performance in imbalanced samples and has a certain level of reliability. To verify the effectiveness, ablation experiments are performed. The detection accuracy and recall of traditional TimesNet (A), Tsfresh-TimesNet (B), MIC-TimesNet (C), and the complete model (D) are compared. The results of the ablation experiment are shown in Figure 7. The accuracy and recall of the complete model in Figure 7a,b are the highest, at 97.15% and 96.45%. The TimesNet model has the lowest accuracy (90.47%) and recall (89.43%). The proposed feature extraction and selection strategy can enhance the detection accuracy of the TimesNet and has certain feasibility.