To address the shortcomings in many traditional spectral feature extraction algorithms in practical application of low modeling accuracy and poor stability, this paper introduces the “Boruta algorithm-based local optimization process“ based on the traditional simulated annealing algorithm and proposes the “two-step simulated annealing algorithm (TSSA)”. This algorithm combines global optimization and local optimization. The Boruta algorithm ensures that the feature extraction results are all strongly correlated with the dependent variable, reducing data redundancy. The accuracy and stability of the algorithm model are significantly improved. The experimental results show that compared with the traditional feature extraction method, the accuracy indexes of the inversion model established by using the TSSA algorithm for feature extraction were significantly improved, with the determination coefficient R2 of 0.9654, the root mean square error (RMSE) of 3.6723 μg/L, and the mean absolute error (MAE) of 3.1461 μg/L.