This study investigates the application of near-infrared spectroscopy (NIR) for assessing drought resistance in seeds, aiming to offer a rapid and efficient method suitable for large-scale primary screening. NIR spectroscopy is utilized to analyze four key factors (water, sugars, amino acids content, and genes) associated with maize seed drought responses. Signature NIR bands indicative of drought resistance-related molecules are identified using the Competitive Adaptive Reweighted Sampling (CARS) technique. Furthermore, an Improved Discrete Bayesian Optimization Support Vector Machine (ID-BOA-SVM) classification model is developed to address issues related to sparse features in traditional Bayesian Optimization Support Vector Machines (BOA-SVM). To enhance classification performance, a stacking model integrating Random Forest (RF), ID-BOA-SVM, Logistic Regression (LR), and Gradient Boosted Decision Trees (GBDT) classifiers is constructed, ensuring robustness and minimizing overfitting risks. The model achieves satisfactory recognition accuracy (94.28% accuracy, 94% precision, 94.61% recall, and 94.23% F1-score) even under conditions of substantial interference and dataset variability. This research demonstrates that NIR spectroscopy-derived data can support genetic and physiological studies of drought-resistant seed varieties, facilitating a deeper understanding of drought resistance mechanisms and optimizing breeding strategies.