Abstract:A portable nondestructive testing device was developed based on near infrared spectroscopy technology, which was used to evaluate the viability of various peanut seeds. With a near-infrared spectrometer as its core component, the device offered advantages such as low cost and rapid detection, enabling efficient non-destructive viability assessment of peanut seeds across multiple varieties and states. It was found that during seed aging, nutritional components such as fat and moisture were significantly consumed, showing a strong correlation with seed viability. In order to improve detection accuracy, competitive adaptive re-weighted sampling (CARS) algorithm was used to accurately identify characteristic wavelengths of water and fat, which were mainly distributed in the ranges of 1 000~1 150 nm,1 250~1 350 nm and 1 400~1 500 nm. On this basis, quantitative prediction models of moisture and fat content were established. For moisture content, the SNV pretreatment model achieved a high correlation coefficient of 0.948 6 and a low RMS of only 0.292 7% on the prediction set. For fat content, SG-MSC pretreatment still produced the correlation coefficient of prediction set of 0.852 1 and a root mean square error of 2.569 9. On this basis, the sparse partial least squares discriminant analysis (SPLS-DA) model was introduced to establish a peanut seed viability discriminant model. Results showed that the improved model significantly improved the classification accuracy for seeds under various conditions. The classification accuracies for Luhua No. 8, Lili Hong, Luori Hong, and Xiaobaisha varieties reached 91.20%,90.80%,90.00% and 90.00%, respectively, an average increase of 15.60 percentage points compared with models not considering characteristic wavelengths. Specifically, seeds were determined to be nonviable when fat content was less than 45% and moisture content was below 4%. This method was particularly helpful in distinguishing mildly aged seeds and low-viability seeds that are difficult to accurately identify through traditional spectral classification methods. A Matlab-based peanut seed detection software was developed to achieve “ one-click operation ” for rapid seed viability detection,providing users with a convenient testing experience. The non-destructive testing device developed provided a method for quickly and accurately evaluating peanut seed viability, and had a wide application potential in seed quality control, breeding selection and agricultural production.