## 4 Discussion  
This study explored the capability of HSI imaging in the VIS-NIR range to predict apples' pH and MC in a non-destructive manner. Considering large data size is one of the main challenges in analyzing HSI data, data reduction techniques are recommended to capture the most informative trends for model development. Feature selection algorithms were utilized to select ten optimum wavelength features in addition to the maturity stage for developing calibration models. Statistical and machine learning techniques such as PLSR, MLR, kNN, DT, and ANN models were used to develop predictive models. The maturity stage inherently influences the MC and pH of the apple, thus, it is expected to play a vital role in the developed predictive model. Moreover, our analy  
Figure 4: Scatter plot of the original and predicted values of target variables and the best linear regression line developed by (**a**) MLR and (**b**) PLSR models. The dark blue region depicts the 95% confidence interval, while the light blue region represents the 95% prediction interval. sis highlighted the importance of five wavelengths (694.22, 689.93, 689.93, 696.36, and 692.07 nm) in predicting the apple MC. These wavelengths are associated with the functional groups that are important in determining water, sugar, and cellulose. The selected spectral bands for MC prediction were found to be concentrated between 666-702 nm, which is consistent with previous studies [13; 47] that have identified these wavelengths as being informative for moisture content. Similarly, for pH prediction, the optimal wavelengths (694.22, 692.07, 466.86, 468.89, and 472.89 nm) were identified through feature selection. The spectral bands in this range are associated with functional groups such as carboxylic acids and amino acids that are important in determining pH. Specifically, the wavelengths between 464-499 nm and between 683-694 nm contained significant information for pH prediction. Overall, these results suggest that the selected features are closely related to the chemical composition of apples, and their inclusion in the predictive models can improve the accuracy of moisture content and pH predictions. Among the models above, ANN provided the best performance with the prediction of MC and pH with \(R\)-values of 0.868 and 0.383, respectively. The obtained results have three main contributions in HSI-based apple quality monitoring: (1) ANN could outperform the commonly used PLSR predictive model in analyzing data, (2) VIS-NIR HSI is a promising non-destructive tool for predicting Pink Lady apples MC, but it lacks the desired accuracy for predicting the pH content, (3) integrating the findings of the present work with other relevant works, one can consider VIS-NIR HSI system as a single tool to predict apple firmness, SSC [33], phenolic content, antioxidant activity, ascorbic acid [4] and MC content. Indeed, this study has highlighted some limitations in the prediction accuracy of pH values using the five applied machine-learning methods for the Pink Lady apples. The performance shortfall can be attributed to several factors, among which the relatively narrow data range observed for pH levels in the apple samples is a significant contributor. Moreover, the penetration depth of the utilized wavelength range into the apple tissue, specific to the studied variety, may have been limited. This likely resulted in a less comprehensive set of spectral data for accurate pH prediction, underscoring the impact of wavelength selection on the efficacy of HSI applications. In addition to these aspects, the suitability of the employed machine learning algorithms must be scrutinized. While these algorithms have shown effectiveness across a multitude of tasks, they may not be optimally tailored to predict pH levels derived from HSI data. It is plausible that more advanced machine learning models will better navigate the intricacy and variability of hyperspectral data, offering enhanced performance.