## 2 Related Works  
The research on this topic is significant, as it is caused by the rapid development of ML methods and applications on one side and the instantly growing network traffic with the accompanying increase in cyber threats on the other [1, 11, 12, 13, 14]. Also, relatively new networks like the Internet of Things (IoT), connecting consumer devices, and the Industrial Internet of Things (IIoT), which are gaining popularity in the industrial domain, have become vulnerable to attacks. As a result of all the above factors, many methods and approaches have been developed till now [15, 16, 17, 18, 19]. The paper [20] explores the relationship between NIDS models and datasets, identifying biases introduced by training on non-comprehensive datasets. The authors conclude that model overfitting and dataset limitations significantly reduce the generalizability of NIDS models, calling for improvements in both model robustness and dataset quality. The paper [21] evaluates the inter-dataset generalizability of autoencoders for NIDS, focusing on their ability to perform well across different datasets, highlighting the challenge of dataset-specific biases in model performance. Paper [22] performs a cross-dataset evaluation of ML models for intrusion detection. The study reveals that many ML models exhibit poor cross-dataset performance, stressing the need for better generalization strategies. Dataset diversity and data quality are highlighted as critical factors influencing model performance. Paper [23] evaluates standard feature sets, improving the generalizability and explainability of ML-based NIDS. The findings suggest that carefully selected universal features can help models generalize better across datasets. Studies [24, 25] focus on the explainable cross-domain evaluation of ML-based NIDS, emphasizing the challenges of transferring models across different network environments. Papers recommends cross-domain validation to assess real-world effectiveness. Article [26] analyzes the inter-dataset generalization strength of supervised ML models for intrusion detection. The study by [27] experiments on generalizability with four datasets (pairwise) with visualization. It examines the cross-dataset generalization of ML models for NIDS, finding that models trained on one dataset often struggle when tested on others. Paper [28] discusses dataset biases in learning systems for intrusion detection, highlighting how dataset-specific characteristics can distort model performance. In [29], authors investigate the issue of overfitting various ML models that cause unfounded high accuracy on training data in terms of the data or pattern leakage. In contrast to the relatively low number of papers discussing the issue of generalizability, the number of papers focusing on developing the most effective ML-based IDS models is growing rapidly [30]. There are many datasets used in ML-based NIDS. Papers [31] presented their comprehensive surveys. In [32, 33, 34], the authors discuss various aspects of collecting and processing data, given the need for efficient machine learning datasets. Considering only four datasets used in our paper, many recent papers have described newly proposed models. The NB15 dataset has been used in many research projects. In Industry 4.0 applications, the dataset in question was utilized to train models that intelligently detect intruders [35] and to find anomalies [36]. The problem of protection of the heterogeneous Internet of Things was discussed in [37]. Similarly, in [38], the dataset tested a system to protect the Internet of Things from rare or completely new attacks. It was also applied to validate the high-speed railway sensor defense [39]. In [40], a dataset was used to create a system to protect the Internet of Things from DoS or DDoS-type attacks. The dataset was also utilized to test an anomaly discovery model for IoT [41] and used to prove the properties of novel deep-learning models [42, 43]. The study [44] presents an NIDS model based on a soft voting method for detecting intrusion.