## 4 Simulation Result and Discussion
### Analysis of Case Studies
#### 4.3.5 Case V: Transfer Learning for N-1 Contingency Case  
In this case, the performance of the proposed TempCNN-LSTM model to the unseen network topology change condition is analyzed for online application using the transfer learning approach. The unseen network condition can be the variation in load pattern, generation, and system topology changes due to contingencies that are not included in the data set during the training process. Here, we have used the N-1 contingency case to represent the network topology change condition subjected to disturbance. For the IEEE 9 Bus system, the critical N-1 contingency is the outage of line 3 connected between bus 5 and 8, which has a maximum loading violation. In total, 260 labeled samples are generated using the data generation configuration as in Table 3 for this test system. Similarly, for the New England 39 Bus test system, the critical N-1 contingency condition is the outage of generator 9 located at bus 38, which has a maximum impact for the loading violation at the transformer connected between bus 6 and 31. The total of 340 labeled samples are generated using the data generation configuration as in Table 3 for this test system. The prediction result of the proposed model for the topology change condition is presented in Table 7. Here, the classification accuracy of the pre-trained model for the unseen N-1 contingency case is significantly low without transfer learning. However, it can be seen from the table that the same model using transfer learning can predict the STVS state for the N-1 contingency case with the accuracy of 98.08% and 97.06% for the IEEE 9 Bus and New England 39 Bus test systems, respectively, with few numbers of labeled samples. In addition, for the uneven distribution of the class labels in the test samples, the proposed model gives better results with precision of 98.17%, recall of 98.08%, and F1-score of 97.78% for the IEEE 9 bus test system and with precision of 97.16%, recall of 97.06%, and F1-score of 96.59% for the New England 39 bus test system compared to other classifiers. Similarly, the performance of TempCNN seems significantly better followed by LSTM, while SVM and DT have poor performance for both the test systems using the transfer learning approach with few labeled data samples for the N-1 contingency condition. The computational time required for both the training and testing reduces significantly compared to Table 5 using the single deep learning-based transfer learning method; thus, it is suitable for online application.  
This case study has only considered a single N-1 contingency to show the application of transfer learning for the unseen topology change condition with few labeled data samples. However, if needed, the approach presented in this section can be simply expanded by creating labeled data samples that account for additional contingencies such as the N-1-1 contingency case.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Parameter**} & \multicolumn{2}{c}{**IEEE 9 Bus**} & \multicolumn{2}{c}{**New England 39 Bus**} \\ \cline{3-6}  & & **With TL** & **Without TL** & **With TL** & **Without TL** \\ \hline \multirow{5}{*}{Proposed} & Accuracy & 98.08\% & 66.35\% & 97.06\% & 58.82\% \\  & Precision & 98.17\% & 76.92\% & 97.16\% & 69.13\% \\ \cline{1-1}  & Recall & 98.08\% & 61.54\% & 97.06\% & 58.82\% \\ \cline{1-1}  & F1-Score & 97.78\% & 53.15\% & 96.59\% & 45.38\% \\ \cline{1-1}  & Re-Training Time & 9.3 s & - & 27.2 s & - \\ \cline{1-1}  & Testing Time & 45.7 ms & 59 ms & 55 ms & 57 ms \\ \hline \hline \end{tabular}
\end{table}
Table 7: Comparison of performance using proposed transfer learning method for N-1 contingency case.