Narrow-leaved weeds present a longstanding challenge in rice cultivation due to their substantial physical similarity, which limits the effectiveness of conventional RGB imaging methods. This study aims to employ Vis-NIR spectral imaging to distinguish rice from barnyard grass and off-type rice at seedling stage. Following seedling preparation, hypercubes were acquired on days 15, 18, and 22 post-sowing using a line-scan hyperspectral imaging system with a wavelength range of 400 to 950 nm. Preprocessing involved the removal of initial and final spectral noisy bands, alongside smoothing via a Savitzky-Golay filter. Data mining, specifically Principal Component Analysis (PCA) and genetic algorithm (GA), were utilized to identify the optimal wavelengths for classification using Artificial Neural Network (ANN). Utilizing all 425 wavelengths as features achieved an overall accuracy (OA) of 96.00 %. The PCA indicated that the first nine principal components accounted for 99.1 % of the spectral information (OA = 94.88 %). The GA identified eight optimal wavelengths: 637.4, 651, 685.9 and 691.8, 711.3, 715.2, 733.7 and 849.9 nm (OA = 97.21 %). To assess the model’s robustness across seedling ages, its capability was evaluated to detect seedlings four days younger without significant reduction in OA (97.11 %). When images were captured at 15 days post-sowing, the model’s OA was 93.37 %. To transition the hyperspectral system for commercial applications of crop-monitoring, a four-band combination of wavelengths (651, 691.8, 715.2, and 849.9 nm) was selected (OA = 95.6 %). The results of this study provide valuable insights for the development of commercial drone-based monitoring systems as well as ground-based systems in seedling banks or paddy fields.