## 3 Research Methodology
### Local Models' Training  
In this study, each IoT device goes through a systematic and personalized training program after careful system setup and thorough device selection. The server employs strategic configuration and initialization during the local training and update stage to introduce a new model. Subsequently, this model is distributed to individual IoT users, commencing a decentralized training procedure. Users, separate entities inside the IoT network, independently improve their local models by utilizing unique datasets. This reiterative process includes several rounds of updates, during which every device improves its local models based on unseen data and the response received from the federated global model. This involves updating the training data to minimize the loss function \(F\), as specified by the optimization equation:  
\[W_{p}^{*}=\text{argmin}_{w_{p}\in P}F,\quad p\in P \tag{3}\]  
In this context, \(W_{p}^{*}\) represents the optimal model parameters for a particular user \(p\) in the federated learning (FL) process. The use of localized training ensures that every IoT device, operating as an autonomous agent, may autonomously enhance its model. Consequently, the enhanced individual models together enhance the intelligence of the aggregate global model. Methods including differential privacy and secure cooperative computation are used to ensure validity. Stringent measures are used during this process to ensure the utmost privacy and integrity of the data. Once models have been trained, they are uploaded and methodically merged at the base station, which is a crucial step in federated learning in the IoT context. The models undergo training utilizing five deep learning approaches to improve analysis and simplify result comparison.  
1. Logistic regression (LR) The statistical deep learning method is utilized for binary classification to predict the likelihood of a routing assault using the IoT Routing Attack Dataset (IRAD). The logistic regression model is formally defined as follows: \[P(y=1|X)=\frac{1}{1+e^{-(\beta_{0}+\beta_{1}X_{1}+\beta_{2}X_{2}+...+\beta_{n}X _{n})}}\] (4)
2. K-nearest Neighbors (KNN) The KNN approach is a classification strategy that assigns a class to a data point based on the majority class of its nearest neighbor in the space of the feature. This approach is agnostic to any specific assumptions about the data distribution. The projected class for a certain data point, X, is mathematically defined by the class that appears most frequently among its k-nearest neighbors.
3. Support Vector Machine (SVM) SVM is an ML classification and regression analysis technique. It belongs to the supervised learning domain, which implies that it necessitates labeled data for model training. The objective is to ascertain a hyperplane that effectively partitions the data into definite classes. The SVM technique aims to mathematically identify the hyperplane (H) with the largest margin that can accurately divide the classes.  
Nave Bayes (NB) The NB method is a probabilistic approach that applies [PERSON] theorem and assumes attribute independence. It is commonly used for activities that need categorization. The Naive Bayes model is formally defined as follows:  
\[P(C_{k}|x)=\frac{P(x|C_{k})\cdot P(C_{k})}{P(x)} \tag{5}\]