During growth, pecan nuts may develop internal "hollow" defects, affecting quality. In this study, near-infrared spectroscopy technology was utilized to conduct rapid and nondestructive detection of hollow defects in pecan nuts. Six preprocessing methods, eight classification models, and two characteristic wavelength selection methods were used. Three voting methods, namely hard voting, soft voting, and weighted soft voting, were employed to further enhanced the ability to identify hollow defects in pecan nuts. The results indicate that normal pecan nuts exhibit higher absorbance than hollow ones, facilitating differentiation. The hollow pecan nut dataset achieves superior model performance after standard normal variate (SNV) preprocessing combined with competitive adaptive reweighted sampling (CARS) variable selection. Voting methods significantly improve defect identification, with soft voting outperforming hard voting and weighted soft voting yielding the best results. Among the voting methods, the weighted soft voting combination of logistic regression (LR), random forest (RF), adaptive boosting (ADB), and linear discriminant analysis (LDA) achieves the best results, the accuracy in cross-validation is 86.44 %, and the accuracy, specificity, and sensitivity in testing set are 87.11 %, 97.56 %, and 69.01 %, respectively. The detection method in this study can provide technical support for pecan nut quality assurance.