Consumption of agricultural products with pesticide residue is risky and can negatively affect health. This study proposed a nondestructive method of detecting pesticide residues in chili pepper based on the combination of visible and near-infrared (VIS/NIR) spectroscopy (400-2498 nm) and deep learning modeling. The obtained spectra of chili peppers with two types of pesticide residues (acetamiprid and imidacloprid) were analyzed using a one-dimensional convolutional neural network (1D-CNN). Compared with the commonly used partial least squares regression model, the 1D-CNN approach yielded higher prediction accuracy, with a root mean square error of calibration of 0.23 and 0.28 mg/kg and a root mean square error of prediction of 0.55 and 0.49 mg/kg for the acetamiprid and imidacloprid data sets, respectively. Overall, the results indicate that the combination of the 1D-CNN model and VIS/NIR spectroscopy is a promising nondestructive method of identifying pesticide residues in chili pepper.