Hyperspectral imaging technology is a promising technique for nondestructive quality evaluation of dried products. In order to realize real-time, online inspection of quality of dried products, it is necessary to determine a few important wavelengths from hyperspectral images for developing a multispectral imaging system. This study presents a binary firework algorithm (BFWA) for selecting the optimal wavelengths from hyperspectral images for moisture evaluation of dried soybean. Hyperspectral images over the spectral region 400–1000 nm, were acquired for 270 dried soybean samples, and mean reflectance was calculated from hyperspectral images for each wavelength. After selecting 12 important wavelengths using BFWA, a moisture prediction model was developed using partial least squares regression (PLSR). The PLSR model with BFWA achieved a prediction accuracy of R p = 0.966 and R M S E P = 5.105 % , which is better than those of successive projections algorithm ( R p = 0.932 and R M S E P = 7.329 % ), and the uninformative viable elimination algorithm ( R p = 0.928 and R M S E P = 7.416 % ). The results obtained by BFWA were more stable, with a smaller standard deviation of R p and R M S E P than those of the genetic algorithm. The BFWA method provides an effective mean for optimal wavelength selection to predict the quality of soybeans during drying.