# ML-Based 5G Network Slicing Security:
## 4 Machine Learning Based Network Slicing
Considering use cases such as throughput, availability, reliability, scalability, and latency in terms of quality of service (QoS) and quality of experience (QoE), respectively, 5G networks tend to provide such flexibility and use cases. Since virtual slice allocation in network slicing over a physical network over a shared pool of resources becomes very complex, an ML-based approach can be modeled to solve this problem. To select the best suitable slice, [PERSON] et al. [59] use different ML algorithms such as Random Forest, Support Vector Machine (SVM), K-Nearest Neighbors (KNN), Decision Tree over the Unicauca-Version-2 public dataset (7 days data, containing 87 attributes), and simulation performed with an NVIDIA GPU. The results show that slice selection strategy in the Random Forest and KNN algorithms give more accurate results than SVM and Decision Tree algorithms to obtain a high QoS and Service Level Agreement (SLA). Figure 8: Network functions and relevant ML techniques. To overcome the challenges which affect the performance of network slicing, various ML and hybrid learning models are applied for effective slicing. [PERSON] et al. [46] proposed glowworm swarm-based deer hunting optimization algorithms (GS- DHOA), which are two meta-heuristic optimization algorithms. They combined these two algorithms to optimize weight function. First, they collected the data from different 5G networks, with attributes such as device type, bandwidth, duration, modulation type, packet delay, and packet loss ratios. Then they carried out the optimal weight feature extraction (OWFE) using the proposed GS-DHOA model; next, they performed slice classification in which they classified the slices based on eMBB, mMTC, and URLLC with respect to the devices, with the help of a hybrid classifier--a hybrid of Deep Belief Network (DBN) and an NN. Another approach to making slice selection more efficient and accurate while handling network load balancing and avoiding slice failure is using a Deep Learning NN. The load efficiency, availability, efficient utilization of resources, and network are also to be considered while slicing the selection. A model called DeepSlice uses KPIs to analyze the network traffic and predict the device type. It also manages the efficient use of resources, allocation, and load balancing. It aims for proper selection of slices, slice prediction with adequate resource allocation, traffic management, slice management, and new slice allotment in case of a slice or network failure. Their model also identifies the traffic pattern and predicts the future patterns to avoid forthcoming failure [40]. With the emergence of the 5G network and its popularity and ability to serve an abundance of services, and with the rise in the complexity of the network compared to previous generation networks, ML approaches have become a necessary part of 5G [65]. The self-organizing networks (SONs) in 5G and network slicing need to be integrated with SDN and NFV to build a comprehensive architecture and experimental framework, using ML and Big Data techniques to develop more intelligent capabilities for the future to satisfy the emerging requirements and to assure intelligence, automation, faster management, and optimization [65]. ML approaches have been used to ameliorate network security, as well as access control, authentication, anti-jamming offloading and malware detection in 5G networks to protect users' data and to maintain privacy [71]. Another application of 5G in cellular and IoT networks is to manage the resources within the network. [PERSON] et al. [72] give a comprehensive survey on management and allocation of resources using ML and DL techniques and bringing intelligence to IoT networks. In V2X communication through the 5G wireless network, to reduce the increasing complexity of the network slicing, various ML approaches are used to automate the deployment of slices and network operations derived from the historical data of the vehicular network [73].