# Predicting the External Corrosion Rate of Buried Pipelines Using a Novel Soft Modeling Technique
## 2 Materials and Methods
### ELM Algorithm  
The extreme learning machine (ELM) algorithm is a new algorithm proposed by researcher [PERSON] in 2004 to improve the single-hidden-layer feedforward neural network. The ELM algorithm has advantages for problems involving multi-classification, high dimensionality, and predictions [48].  
Figure 2: Flowchart of the PSO algorithm.  
The ELM model has the same network structure as the single-hidden-layer feedforward neural network (SLFN) [49]. ELM uses random input layer weights and biases only in the training phase. The output layer weights are then computed by the generalized inverse matrix theory [50]. In this model, \(m\) represents the number of nodes in the input layer, \(M\) represents the number of nodes in the hidden layer, and \(n\) represents the number of nodes in the output layer. The activation function required for the network connection during training in the hidden layer is represented by \(g(x)\), and \(b_{i}\) represents the threshold value within a neuron [51]. With \(N\) different sets of samples \((x_{i},t_{i})\), where \(1\leq i\leq N\), the ELM network structural model can be depicted as shown in Figure 3.  
Where: \(x_{i}=[x_{i1},x_{i2},x_{i3},\cdots,x_{im}]^{T}eR^{m}\), \(t_{i}=[t_{i1},t_{i2},t_{i3},\cdots,t_{in}]^{T}eR^{n}\)  
Mathematical representation of ELM model structure:  
\[\sum_{i=1}^{M}\beta_{i}g(\omega_{i}\cdot x_{i}+b_{i})=o_{j},j=1,2,\cdots,N \tag{19}\]  
where \(\omega_{i}=[\omega_{i1},\omega_{i2},\omega_{i3},\cdots,\omega_{im}]\) represents the input weight vector of the input layer node and the \(i\) hidden layer node in the network model, \(\beta_{i}=[\beta_{i1},\beta_{i2},\beta_{i3},\cdots,\beta_{in}]^{T}\) represents the output weight vector of the \(i\) hidden layer node and the output layer node in the network model, and \(o_{i}=[o_{i1},o_{i2},o_{i3},\cdots,o_{in}]^{T}\) represents the network model output value.  
The cost function of the ELM model is given by Equation (20):  
\[E(S,\beta)=\sum_{j=1}^{N}\|o_{j}-t_{j}\| \tag{20}\]  
where \(S=(\omega_{i},b_{i},i=1,2,\cdots,M)\) contains the network model input weights and thresholds for the hidden layer nodes. The purpose of ELM model learning is to find the optimal \(S\), \(\beta\), such that the error between the model's predicted structure and the measured values is minimized and noted as \(min(E(S,\beta))\).  
The expression for \(min(E(S,\beta))\) can be further written as per Equation (21):  
\[min(E(S,\beta))=\min_{\omega_{i},b_{i},\beta}H\|(\omega_{1},\cdots,\omega_{M}, b_{1},\cdots,b_{M},x_{1},\cdots,x_{N})\beta-T\| \tag{21}\]  
where \(H\) is the output matrix of the hidden layer in the prediction model, \(\beta\) is the weight matrix of the output in the prediction model, and \(T\) is the target value matrix in the prediction model, and \(H,\beta,T\) are defined as follows:  
Figure 3: Schematic of the ELM network structural model.  
\[H(\omega_{1},\cdots,\omega_{M},b_{1},\cdots,b_{M},x_{1},\cdots,x_{N})=\begin{bmatrix} g(\omega_{1}x_{1}+b_{1})\cdots g(\omega_{M}x_{1}+b_{M})\\ \vdots\\ g(\omega_{1}x_{N}+b_{1})\cdots g(\omega_{m}x_{N}+b_{M})\end{bmatrix}_{N\times M} \tag{22}\]  
\[\beta=\begin{bmatrix}\beta_{1}^{T}\\ \vdots\\ \beta_{M}^{T}\end{bmatrix}_{M\times N},\;T=\begin{bmatrix}t_{1}^{T}\\ \vdots\\ t_{N}^{T}\end{bmatrix}_{N\times N} \tag{23}\]  
The ELM predictive model is a process of solving for the ideal solution in nonlinear variation. The essence of the training process is to solve for the least squares solution, as shown in Equation (24):  
\[\hat{\beta}=H^{+}T \tag{24}\]  
where \(H^{+}\) is the inverse of the generalization of the matrix \(H\).