In this paper, a quantitative analysis model is established with the help of hyperspectral imaging technology and the least squares method to study the biomass content in straw. The results show that the optimal selection of spectral dimensional data can be achieved through a competitive adaptive weighted sampling algorithm. In the experiment, the correlation coefficient of nitrogen in the verification set is 0.923 and the correlation coefficient of oxygen in the verification set is 0.876. Given that the prediction results of these two elements are relatively good and thus can be applied in practice. The practicality of other elements is poor. However, in the quantitative analysis model, the prediction results of these five elements are not satisfactory and the practicality is poor.