## 4 Results
### Baseline  
We evaluated NIDS primarily in terms of accuracy in dichotomous and multi-classification. Firstly, we compared the differences between our method and other NIDSs regarding False Negatives, accuracy, etc. KNN-NIDS [29] uses KNN as the classification algorithm of the project and uses PCA for dimension reduction. LR-NIDS [30], Bayes-NIDS [31], DT-NIDS [32], and AB-NIDS [33] use a Logistic Regression, Naive Bayesian algorithm, Decision Tree algorithm, Ada Boost algorithm, and Random Forest algorithm, respectively, in the NIDS scenario.  
In order to ensure good training results and evaluate the classifier's performance, we combined the above considerations. The F1-Score combines two metrics, Precision and Recall, to evaluate the overall performance of the model:  
\[\mathrm{F-Sc=}\frac{2\times\mathrm{rcs}\times\mathrm{Rcl}}{\mathrm{Prcs}+\mathrm{ Rcl}} \tag{9}\]  
The higher the value of F-Sc, the better the training effect is proved to be. The results are as Table 3:  
For NIDS, its primary task is to identify whether the packets are anomalous or not, so it has very demanding requirements for the accuracy of binary classification. Our approach (CM-NIDS) has a clear advantage in binary classification. On the TPR metric, CM-NIDS outperforms the optimal algorithm by 21 percentage points, and has a clear advantage on the three remaining commonly used measures of binary classification accuracy (especially on Precision and F-Sc comparisons). This is partly due to our adequate data pre-processing combined with KNN-based feature selection and partly due to our use of a more accurate binary-classification method.  
Figure 3: The backbone of the neural network model, used in the experiment of the feature extractor, binary classification, and multi-classification.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Methods** & **TPR** & **Precision** & **Recall** & **F-Sc** \\ \hline CM-NIDS & 1.000 & 1.000 & 1.000 & 1.000 \\ KNN-NIDS & 0.772 & 0.157 & 0.607 & 0.172 \\ SVM-NIDS & 0.788 & 0.147 & 0.594 & 0.153 \\ LR-NIDS & 0.619 & 0.076 & 0.643 & 0.135 \\ Bayes-NIDS & 0.283 & 0.588 & 0.624 & 0.605 \\ DT-NIDS & 0.566 & 0.082 & 0.699 & 0.147 \\ AB-NIDS & 0.610 & 0.076 & 0.652 & 0.137 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison of different algorithms in terms of correct packet detection rate.  
Furthermore, it is fundamental to correctly identify the attack type for multi-classification networks. At the same time, we examined the difference between the model and some classical models in terms of the total tensor used. We were able to see that our model uses a significantly smaller number of tensors. The comparative algorithms we used include APFL [34], Ditto [35], FedBN [36], FedFomo [37], and PerAvg [38]. They are all among more emerging algorithms applicable to NIDS. Our comparison of several algorithms is shown in Table 4.  
In terms of TDR, we compared our approach with other frameworks. It is clear to see that we have an outstanding advantage in terms of attack-type classification. The CM-NIDS algorithm has a TDR value of 0.910, the highest among the provided algorithms. This indicates that the algorithm can classify different data classes more accurately and has a higher detection accuracy in network intrusion detection tasks. Also, the CM-NIDS algorithm uses a total tensor number of 2,100,391, which is less than other algorithms. This may imply that the CM-NIDS algorithm requires less computational and storage resources in the computation process and, thus, is more competitive in terms of efficiency. The smaller number of tensors may imply less memory usage and computational burden and, therefore, it can run more efficiently in the same hardware environment. This is mainly due to our improved approach to multi-classification. It is performed through a combination of binary classification, resulting in a much higher accuracy rate.