## 6 Conclusions  
In today's era of ubiquitous Internet of Things and mobile network applications, it is obvious that network attacks have become more frequent. Therefore, the study of network security and defense is becoming increasingly important. Traditional network intrusion detection systems (NIDS) are no longer effective in detecting ever-changing network attacks. The use of artificial intelligence to improve NIDS has been an important trend in recent years. However, many of the NIDS datasets currently used by scholars suffer from a serious data imbalance. That is, it is particularly difficult to identify the classes of these sparse attack data by using machine learning and deep learning algorithms. Therefore, this research studied three data augmentation methods to increase the distribution percentage of the sparse attack class. Upon increasing the distribution percentage, the recognition accuracy rate of the sparse data classes could be improved. We also proposed a two-stage fine-tuning algorithm to optimize the data-enhanced model and all of the important parameters of the classification algorithms, which could further improve the recognition accuracy rate of the sparse attack data. The experimental results revealed that the MLP classification accuracy of the Probe attack sparse data could be significantly improved by using WGAN-GP data augmentation and the fine-tuning algorithm. However, for attack data with extremely sparse information, such as U2R and R2L in NSLKDD, we should prioritize increasing the collection of real data instead of using data augmentation. For attack data with a certain amount of data, such as Probe attack data in NSLKDD, the method provided in this paper can be used to improve the attack identification accuracy.  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **MLP** & **CNN** \\ \hline Best Feature Number & 21 & 23 \\ Best Data-Enhanced Number & 6000 & 8000 \\ Best Number of Model Layers & 4 & 6 \\ Accuracy of Probe Detection & 80\% & 73\% \\ \hline \hline \end{tabular}
\end{table}
Table 16: Best numbers of model layers.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **KNN** & **SVM** & **RF** & **XGB** & **MLP** & **CNN** \\ \hline Best Feature Number & 15 & 41 & 15 & 18 & 21 & 23 \\ \hline Best Data-Enhanced Number & 8000 & 8000 & 7000 & 6000 & 6000 & 8000 \\ \hline Best Number of Model Layers & - & - & - & - & 4 & 6 \\ \hline Probe Accuracy & 76\% & 75\% & 64\% & 55\% & 80\% & 73\% \\ \hline \hline \end{tabular}
\end{table}
Table 17: Best hyperparameters with WGAN-GP data enhancement for all classifiers.  
**Author Contributions:** Conceptualization, G.-C.L.; methodology, G.-C.L. and J.-H.L.; software, J.-H.L.; validation, G.-C.L., [PERSON]-H.L. and Z.-Y.L.; formal analysis, G.-C.L. and J.-H.L.; investigation, G.-C.L. and [PERSON]-H.L.; resources, G.-C.L.; data curation, G.-C.L., J.-H.L. and Z.-Y.L.; writing--original draft preparation, G.-C.L. and Z.-Y.L.; writing--review and editing, G.-C.L. and Z.-Y.L.; visualization, G.-C.L. and Z.-Y.L.; supervision, G.-C.L.; project administration, G.-C.L.; funding acquisition, G.-C.L. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** Not applicable.  
**Conflicts of Interest:** The authors declare no conflict of interest.