# Identification of Coal Geographical Origin Using Near Infrared Sensor Based on Broad Learning
## 3 Experimental Methods
### Proposed PSO-BL Model  
The BL model is significantly affected by the relevant parameters of its structure. Hence, in order to improve the performance of the BL model, we employ the PSO algorithm to search for the optimal parameters. PSO is a classic global optimization strategy that is based on the flocking behaviour and social co-operation of birds [35]. In this experiment, we denote \(N_{1}\) as the number of windows for feature mapping, \(N_{2}\) as the number of nodes in each window and \(N_{3}\) as the number of enhancement nodes. During the BL model construction, we find that the classification performance is largely dependent on the selection of these three parameters, \(N_{1}\), \(N_{2}\) and \(N_{3}\). The PSO algorithm is applied here to obtain the optimal values of these three parameters. The fitness function of the optimization process is defined as follows,  
\[f_{fitness}=\frac{1}{10}\sum_{k=1}^{10}bl_{k}[n_{1},n_{2},n_{3}], \tag{8}\]  
where \(bl_{k}[n_{1},n_{2},n_{3}]\) is the test accuracy of the \(k^{\text{th}}\) BL model when the parameters equal \(n_{1},n_{2},n_{3}\). In order to reduce the random error, we calculate the BL model 10 times and return the mean of the accuracy as the fitness value. Figure 4 demonstrates the optimization process of the proposed BL with PSO. During the PSO optimization process, we initialize a swarm of 50 particles. In this study, the dimension of parameters' particles \(d\) is set as three, which represents the number of parameters to optimize. We denote \(p_{best,h}^{d}(t)\) as the best solution that particle \(h\) has obtained until generation \(t\), and \(p_{gbest}^{d}(t)\) is the best solution of all particles. Similarly, the velocity \(V_{h}^{d}(t)\) and \(X_{h}^{d}(t)\) denote that the velocity and position of the particle \(h\) have obtained generation \(t\). In our study, it should be noted that the optimal parameters are the number of mapping features and enhancement nodes, which must be a positive integer. Similarly, the optimal velocity is also an integer. In each generation, we update velocity by the following formula,  
\[\begin{split} V_{h}^{d}(t+1)=& round[wv_{h}^{d}(t) +c_{1}r_{1}(p_{best,h}^{d}(t)-p_{h}^{d})+\\ & c_{2}r_{2}(p_{gbest}^{d}(t)-p_{h}^{d}(t)]\end{split} \tag{9}\]  
where \(r_{1}\) and \(r_{2}\) are random numbers between [0,1] and \(c_{1}\), \(c_{2}\) are two positive acceleration constants chosen as 1.4962, which is commonly selected in the PSO algorithm. The _round_is the function to round the number to the nearest integer. \(w\) is the dynamic inertia weight, which is expressed as:  
\[w=w_{\text{max}}-(w_{\text{max}}-w_{\text{min}})*(t/M)^{2}, \tag{10}\]  
where \(w_{max}=0.9\), \(w_{min}=0.25\), \(t\) is the current generation and \(M\) is the max generations, which equals 40. The position is updated as follows,  
\[p_{h}^{d}(t+1)=p_{h}^{d}(t)+V_{h}^{d}(t). \tag{11}\]During the optimal process, we heuristically assume that the velocity \(V_{h}^{d}\) when \(d=1,\ldots,3\) is in the range of \([-10,10]\), \([-10,10]\) and \([1000,-1000]\), respectively, the corresponding position \(p_{h}^{d}\) is in the range of \([1,50]\), \([1,50]\) and \([10,10,000]\). The major steps of the proposed PSO-BL algorithm are summarized in Algorithm 1.  
```
Input: Input data set Output:\(p_{\mathit{gbest}}^{d}(t)\) and the fitness value of \(p_{\mathit{gbest}}^{d}(t)\)  Initialize the PSO model, the velocity \(V_{h}^{d}(t)\) and position \(p_{h}^{d}(t)\) for\(t=1;t\leq 40;t++\)do  calculate the fitness value of the position \(p_{h}^{d}(t)\) according to Formula (8);  find \(p_{\mathit{best},h}^{d}(t),p_{\mathit{gbest}}^{d}(t)\);  update the position and velocity according to Formula (9),(11);  update the inertia weight according to Formula (10);  end for return \(p_{\mathit{gbest}}^{d}(t)\) and the corresponding fitness value;
```  
**Algorithm 1**The proposed PSO-BL algorithm.