Aflatoxin contamination can occur in a wide variety of agricultural products pre- and post-harvest, posing potential severe health hazards to human and livestock. However, current methods for detecting aflatoxins are generally based on wet chemical analyses, which are time-consuming, destructive to test samples and require skilled personnel to perform, making them impossible for large-scale non-destructive screening and on-site detection. In this study, we utilized the visible/near-infrared (Vis/NIR) spectroscopy over the spectral range of 400-2500 nm to detect contamination of shelled commercial peanut kernels with the predominant aflatoxin B1 (AFB1). Our results indicated the usefulness of Vis/NIR spectroscopy combined with the chemometric techniques of partial least squares discriminant analysis (PLS-DA) and least squares support vector machine (LS-SVM) in identifying the AFB1 contamination of peanut kernels. Both PLS-DA and LS-SVM methods provided satisfactory classification results using the full spectral information over the ranges of 410-1070 (I), 1120-2470 nm (II) and I+II. Based on the classification threshold of 20 ppb, the best PLS-DA prediction results using the full spectra yielded the average accuracy of 87.9% and overall accuracy of 88.6%. With 100 ppb as the classification threshold, the best PLS-DA model using the full spectra achieved the average accuracy of 94.0% and overall accuracy of 91.4%. Using the full spectra, the best average accuracies recorded by LS-SVM were 90.9% and 98.0%, with the classification thresholds of 20 and 100 ppb, respectively. Correspondingly, the best overall accuracies by LS-SVM were 90.0% and 97.1%. In addition, the simplified models of CARS-PLS-DA and CARS-LS-SVM also demonstrated good prediction capability in identifying the AFB1 contamination from peanut surface. Based on both classification thresholds of 20 and 100 ppb, the best CARS-PLS-DA and CARS-LS-SVM prediction results were ≥ 90.0% in both average accuracy and overall accuracy. Most importantly, the computation complexity and the employed data dimensionality were significantly reduced by using the simplified models.