## 3 Steel Truss Experiment
### Signal Recognition and Analysis
#### 3.3.2 Feature Selection and Parameter Optimization  
According to Section 2.2, a Random Forest model is constructed, and four parameters are optimized through a genetic algorithm: the number of trees \(n\), the maximum depth of each decision tree \(d\), the minimum number of samples required to split an internal node \(s\), and the maximum number of leaf nodes \(m\). The optimization ranges for these parameters are shown in Table 3. A population consisting of 100 individuals is created, with a crossover probability of 0.5, a mutation probability of 0.2, and a number of generations of 50. The \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Sample Type** & **Label** & **Training Samples** & **Testing Samples** \\ \hline Cicada sound & 1 & 280 & 120 \\ Construction noise & 2 & 280 & 120 \\ Wind sound & 3 & 280 & 120 \\ Thunder sound & 4 & 280 & 120 \\ Birdsong & 5 & 280 & 120 \\ Rain sound & 6 & 280 & 120 \\ Bolt loosening sound & 7 & 280 & 120 \\ Speech & 8 & 280 & 120 \\ Total & & 2240 & 960 \\ Total number of samples & & & 3200 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Sound sample information. fitness variation curve during the optimization process is shown in Figure 7. The blue curve represents the average fitness, which rises rapidly in the initial stage and stabilizes after about 10 generations, ultimately settling at a high level of approximately 0.99. This indicates that the overall fitness of the population has significantly improved during the evolutionary process. After optimization, the final values are \(n\) of 114, \(d\) of 60, \(s\) of 6, and \(m\) of 235. After obtaining the optimal parameters, random forest was used to evaluate the feature importance by calculating the importance index for all 40 features. Figure 7(a) shows the results, where the blue bars represent MFCC features, and the orange bars represent wavelet packet energy features. It can be observed that the contribution of MFCC features to the results is mainly concentrated in the first 12 features, while the contribution of the latter 12 features is relatively small. In contrast, the contribution of wavelet packet energy features is distributed relatively evenly across all frequency bands. After obtaining the importance indicators of each feature, all features are sorted by their contribution degree from largest to smallest, as shown in Figure 7(b). Figure 8: Feature importance assessment and ranking. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Parameter** & \(\mathbf{n}\) & \(\mathbf{d}\) & \(\mathbf{s}\) & \(\mathbf{m}\) \\ \hline Optimization scope & [50, 500] & [1, 200] & [2, 200] & [10, 500] \\ Optimal parameters & 114 & 60 & 6 & 235 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Optimization range and results of parameters. Figure 7: Genetic algorithm parameter optimization. To analyze the impact of the number of features on the model recognition results, the top-ranked features based on their importance index were sequentially selected and input into the random forest model for training. The training results are shown in Figure 9. It can be observed that as the number of input features increases, the change in recognition accuracy can be roughly divided into three stages: rapid increase (1-6), slow increase (7-15), and stabilization (16-40). When the feature index is 1, i.e., only the first feature is selected, the accuracy is less than 30%. Subsequently, the recognition accuracy rapidly increases with the increase in feature index. When the feature index is 6, the accuracy reaches 94.6%, and when the feature index is 15, it basically reaches the maximum value of 98.9%. After that, there is no significant increase in accuracy with the increase in the number of features. When using all 40 features for training, the accuracy is 98.6%, indicating that the features ranked lower have little impact on the recognition results and can be considered redundant features.