## 3 Artificial Intelligence Approach
### Supervised ML
#### 3.1.1 Linear and Logistic Regression  
Linear regression is a straightforward method that calculates the dependence of a dependent variable on one or more independent variables. Where there is the presence of more than one independent variable, the concept of MLR extends to multiple predictors, which predict the variance in a dependent variable [98; 99]. However, MLR has generally been applied in a number of HSI uses to analyze sensory features of food products. However, due to its simplicity, MLR may not execute as well compared to nonlinear methods when dealing with complex datasets where the relationships among variables might not follow a strictly linear pattern [46]. For example, [PERSON] et al. (2024) suggested that a new combination of digital imaging and multivariate calibration techniques such as SPA-MLR be applied for color determination in sugar. This very promising technique provided high accuracy cost-effectively and non-destructively, apart from some possible traditional chemical analyses [100]. In this respect, the use of SPA-MLR witnesses the increasing application of sophisticated regression models in food-quality control applications. Combining MLR with other techniques can be investigated in further research.  
Similarly, [PERSON] et al. (2024) applied MLR for the prediction of oil content within corn kernels by using HSI and highlighting some of the innumerable uses within agricultural monitoring. This technique will provide a fast and non-destructive way; hence, MLR became very useful in field applications [101]. Further investigation in similar cases such as wheat, soybeans, and canola oils are required to evaluate the efficiency of MLR in oil content prediction.  
Partial least squares regression is a linear regression method that is applicable when the dataset possesses high dimensions and the predictors are collinear, or when the samples are outnumbered. It extracts latent variables with key predictive information, thus effective in complicated data analysis [102]. Food quality could be assessed by PLSR in combination with near-infrared hyperspectral imaging (NIR-HSI) to determine oil and fatty acid content in Brassica seeds [103] and textural properties in mozzarella cheese [104]. The results from these works showed the robustness of PLSR in handling complex datasets, which is useful in observing the quality of the food.  
While both MLR and PLSR add large value to hyperspectral data analysis, each has its strong points. MLR works best in simple, low-order linear data, while PLSR generally tends to perform better with high-dimensional, complex datasets. In choosing between the two methods in HSI applications, an understanding of the intricacies of each method will be important in the process.  
Logistic regression, by construction, is mainly used for binary classification. It estimates the conditional probability of an outcome given a set of input features; hence, it yields a direct solution to classification problems [105]. In a study, a fruit contaminant classifier using logistic regression is presented that exhibited very high sensitivity and accuracy [106]. Based on spectral data, this model achieved high predictions in physical hazards like branches or foreign objects, indicating the feasibility of this model in food safety applications in real time. For classifying pesticide residue levels in grapes by NIR spectra, logistic regression achieved accuracy above 97%. Its performance is pretty strong in these applications regarding the detection of agricultural hazards and will be valuable for hyperspectral data analysis in the context of food safety [107]. These studies represent that logistic regression has been very successful in food safety for the detection of foreign materials in foodstuffs and can also be studied in the case of detecting toxins on the surface of citrus and other fruits.