# Machine Learning-Based Satellite Routing for SAGIN IoT Networks
## 3 Model Design
### Extended ELM Model Structure Design  
The flow chart for the extended ELM model is shown in Figure 8. In the raw data, there will be some missing and null values. These data are first analyzed, then they will be standardized to transform symbol-type data into numbers. Then, the blockage in the communication link is divided into six categories according to its value. To finish the data preparation procedure, the SMOTE algorithm is utilized to process the imbalanced data. Data may be loaded into the ELM model's expanded version. The complete connection layer, which consists of two 128 neural units, is followed by the original ELM model. The ELM model consists of an input layer, a hidden layer in the center, and a six-neuron output layer to output the predicted six blockage categories. The ELM is a single-hidden-layer neural network algorithm, which can be used for the establishment of regression and classification models [21]. Compared with the traditional single hidden layer feed-forward neural network, the input weight and the offset are random. The corresponding output weights are obtained through calculation. Therefore, to ensure learning accuracy, the ELM algorithm has low computational complexity and a good general performance. Assume that the training sample is represented by \(\{(X_{i},T_{i})\}\), where \(X_{i}\) is the model's input vector and \(T_{i}\) is the model's output vector. The number of neural units in the input layer of the ELM model is \(N\), the number of neural units in the hidden layer is \(L\), and the number of neural units in the output layer is \(M\). The formulas for the ELM model are  
\[H\beta=T \tag{4}\]  
\[H=\left[ \begin{array}{c}g(\omega_{1}\times x_{1}+b_{1})\cdots g(\omega_{L} \times x_{1}+b_{L})\\ g(\omega_{1}\times x_{2}+b_{1})\cdots g(\omega_{L}\times x_{2}+b_{L})\\ \vdots\ldots\vdots\\ g(\omega_{1}\times x_{N}+b_{1})\cdots g(\omega_{L}\times x_{N}+b_{L})\\ \end{array} \right]_{N\times L}\beta=\left[ \begin{array}{c}\beta_{1}^{T}\\ \beta_{2}^{T}\\ \vdots\\ \beta_{L}^{T}\end{array} \right]_{L\times M}T=\left[ \begin{array}{c}t_{1}^{T} \\ t_{2}^{T}\\ \vdots\\ t_{N}^{T}\end{array} \right]_{N\times M} \tag{5}\]  
\[g(x)=\frac{1}{1+e^{-x}} \tag{6}\]  
The ELM model consists of an input layer, hidden layer, and output layer. \(\omega_{i}\) represents the weight between the input layer and \(\beta\) is the hidden layer, \(b_{i}\) is the bias of the hidden layer, and \(g(x)\) is the sigmoid function, which is used as the activation function of the neural unit in the hidden layer. Through the activation function, the results of \(\omega_{i}\times x_{i}+b_{i}\) mapping form a matrix, which is called the feature mapping matrix \(H\). When the network  
Figure 8: Flow chart of extended ELM model. is generated, \(\omega_{\rm i}\) and \(b_{\rm i}\) will be randomly generated. Then, with the increase in the number of iterations, \(\omega_{\rm i}\) and \(b_{\rm i}\) will be gradually adjusted to make the model more accurate. The model combines the matrix H with the vector \(\beta\) multiplication, the resulting matrix as the output of the model, denoted as T.  
\[\hat{\beta}=\mathbf{H}^{\dagger}\mathbf{T} \tag{7}\]  
The above formula is transformed into the least square solution of the solution \(\hat{\beta}\), the Moore-Penrose generalized inverse of matrix H is \(\rm H^{\dagger}\). The Moore-Penrose generalized inverse of matrix H is \(\rm H^{\dagger}\). ELM has been widely used in many fields because of its fast training speed, good interpolation ability, and approximation ability. However, the ELM model also has some problems. When faced with a large-scale, unbalanced, and noisy dataset, its performance is not stable. Therefore, we propose a new model to enhance stability. The network is built using the Python-based open-source artificial neural network framework Keras. The data are input into two full connection layers with 128 nerve units, and the data are pre-trained. Because the data are shuffled after each training, the training and verification sets are resampled.