Background Pineapples are a popular tropical fruit with economic value, and determining the optimum ripeness of pineapples to assess their quality is crucial for harvesting, marketing, production, and processing.Objective In this study, spectral information and soluble solid content (SSC) of pineapple ripening stages (unripe, ripe, and overripe) were analyzed by 400-1000 nm hyperspectral imaging (HSI) in order to determine the best classification model of pineapple ripening.Methods Four different preprocessing methods, i.e., standard normal variate (SNV), multiplicative scatter correction (MSC), normalization, and Savitzky-Golay (SG) smoothing, in combination with successive projection algorithms (SPA), and bootstrapping soft shrinkage (BOSS) for feature wavelength extraction, were used to compare the full wavelength and the two types of feature extraction support vector machine (SVM), extreme learning machine (ELM), K-nearest neighbors (KNN), and random forest (RF), four supervised machine learning classifiers for maturity classification.Results For pineapple ripeness classification, SNV preprocessing RF showed the best results with 94.44% accuracy at both full wavelength and 28 wavelengths selected in SPA. A total of 33 wavelengths selected from BOSS achieved a test accuracy of 97.22% by RF.Conclusion These results demonstrate the potential of near-infrared hyperspectral imaging (NIR-HSI) as a non-destructive, fast, and correct tool for pineapple ripeness identification. The method can be applied to classify and grade marketed pineapple fruits to address pineapple quality issues related to uneven ripeness.Highlights The visible and near-infrared hyperspectral imaging (VIS-NIR-HSI) system combining machine learning and wavelength selection successfully classified pineapple ripening stages, an approach that could improve the ability to classify pineapples at the ripening stage in large packaging companies. In addition, finding key wavelengths or features that can be classified corresponding to pineapple ripening stages has the advantage of developing a low-cost, fast, and effective multispectral imaging system compared to the NIR-HSI system.