## 2 Materials and Methods
### Feature Selection Phase
#### 2.1.2 Feature Selection Using PSO-SVM  
This paper uses binary particle swarm optimization (PSO) [36] as feature selection for classification problems. In each iteration, the particles are optimized according totheir fitness and swarm fitness values. Using SVM to evaluate the fitness value of particle swarm optimization and by introducing a kernel function, the maximum edge hyperplane suitable for the classification problem structure is found in the high feature space, thereby improving the efficiency of the fitness value function.  
According to particle swarm optimization rules, we first set the required number of particles and then randomly generate an initial binary-coded string for each particle. For example, when using particle swarm optimization to analyze an eight-dimensional dataset \(S_{n}=[H_{1}H_{2}H_{3}H_{4}H_{5}H_{6}H_{7}H_{8}]\) (\(n=8\)) to select features, we can select any number of features less than n. We can randomly select three features (\(m=3\)), here \(S_{m}=[H_{1}H_{5}H_{7}]\) When calculating the adaptive value, these m features in each dataset represent the data dimension d, which is evaluated by SVM. When the sample size is large, the fitness value of SVM evolves according to the Holdout method. Moreover, the kernel function of SVM is radial basis function (RBF):  
\[K(x,y)=\exp\Bigl{(}-\gamma\|x-y\|^{2}\Bigr{)},y>0 \tag{5}\]  
For different classification problems, support vector machines need to set different parameters. \(\gamma\) and \(C\) are important. By properly adjusting these parameters, a better classification hyperplane can be obtained and the classification accuracy can be improved. This paper did not optimize the SVM parameter setting, but set the parameters as \(\gamma=2^{0}\) and \(C=2^{12}\) according to relevant literature. The optimization can be used as a direction for follow-up research.  
Each particle update is based on its adaptive value. The fitness function designed in this paper is shown in Equation (6):  
\[\text{fitness }=\omega_{1}\times\text{ accuracy }_{SVM}+\omega_{2}\times \bigl{(}\sum f_{i}\bigr{)}^{-1} \tag{6}\]  
where \(\omega_{1}\) represents the weight of classification accuracy; accuracy\({}_{SVM}\) represents the classification accuracy of SVM; \(\omega_{2}\) represents the weight of feature dimension; and \(f_{i}\) represents the relative offset of the \(i\)-th feature dimension in the mask, where \(f_{i}=1\) means the feature is retained and \(f_{i}=0\) means the feature is filtered. The actual problem determines \(\omega_{1}\) and \(\omega_{2}\). In this paper, \(\omega_{1}=0.2\), \(\omega_{2}=0.8\).  
The best fitness value updated by each particle is bpset, and the best fitness value in a group of bpset is gpset. Once we have ppset and gpset, we can track the location and velocity characteristics of ppset and gpset particles. Each particle is updated according to Equations (7) and (8):  
\[v_{id}^{t+1}=\omega v_{id}^{t}+c_{1}\times\text{ rand }()\times\bigl{(}pbest_{id}-x_{id}^{t} \bigr{)}+c_{2}\times\text{ rand }()\times\bigl{(}gbest_{id}-x_{id}^{t}\bigr{)} \tag{7}\]  
\[x_{id}^{t+1}=\left\{\begin{array}{ll}1&\text{rand }<sigmaid\bigl{(}v_{id}^{t+1}\bigr{)}\\ 0&\text{rand }\geqsigmaid\bigl{(}v_{id}^{t+1}\bigr{)}\end{array}\right. \tag{8}\]  
The updated features of the velocity value \(v_{id}^{t+1}\) are calculated by the function \(sigmaid(v_{id}^{t+1})\). If \(sigmaid(v_{id}^{t+1})\) is greater than the random number within (0,1), its position value \(H_{n}(n=1,2,\ldots,m)\) is represented as 1, and this feature should be retained in the next iteration. If \(sigmaid(v_{id}^{t+1})\) is less than \(H_{n}(n=1,2,\ldots,m)\) is represented as 0, then this feature will not appear in the next iteration.