Dendroctonus valens is one of the main invasive pests in China, causing serious economic and ecological damage. Early detection and control of D. valens can help prevent further outbreaks. Based on unmanned aerial vehicle (UAV) thermal infrared and hyperspectral data, we compared the spectral characteristics of Pinus sylvestris var. mongolica in three states (healthy, early-infested, and dead), and constructed a classification model based on the random forest algorithm using four spectral datasets (reflectance, first derivative, second derivative, and spectral vegetation index) and one temperature parameter dataset. Our results indicated that the spectral differences between healthy and early-infested trees mainly occur in the near-infrared region, with dead trees showing different characteristics. While it was effective to distinguish healthy from early-infested trees using spectral data alone, the addition of a temperature parameter further improved classification accuracy across all datasets. The combination of the spectral vegetation index and temperature parameter achieved the highest accuracy at 93.75%, which is 3.13% higher than using the spectral vegetation index alone. This combination also significantly improved early detection precision by 13.89%. Our findings demonstrated the applicability of UAV-based thermal infrared and combined hyperspectral datasets in monitoring D. valens early-infested trees, providing important technical support for the scientific prevention and control of D. valens.