## 3 Artificial Intelligence Approach
### Unsupervised ML
#### 3.2.1 Cluster Analysis  
A cluster analysis is a statistical method of grouping objects into classes based on the characteristic features of objects with the aim of maximizing their similarity within one class and minimizing similarity between classes. Major techniques in cluster analysis can be divided into hierarchical and non-hierarchical methods [135]. Hierarchical clustering structures data in a tree-like fashion, called a dendrogram, which can provide a way of visually showing the relations between data points at a higher level of similarity. Thistechnique finds wide application in the field of food safety. The specifics of the technique followed [PERSON] et al. (2024), who, using hierarchical clustering, classified bread pixels into visible-near-infrared spectra and estimated the proportion of wholemeal flour. This technique has proved useful in identifying effectively those pixels related to flour content in heterogeneous food samples [136]. It also showed that when UMAP was combined with hierarchical clustering, both adulterants were suitably identified in food matrices [137].  
K-means clustering has assigned data points to a predefined number of clusters based on their features, with the objective of minimizing variance within each cluster [135]. K-means was used to classify Pleurotus evrngii into quality grades during post-harvest storage based on HSI data. The method simplified the work of quality control by clustering the samples efficiently, which provided much assistance in product grading and classification [138]. It was also applied along with self-organizing maps to classify Iranian rice varieties, which proved effective in clustering similar products, with very high accuracy (values of 16.896, 15.7161, and 18.920 in the best total sum of distances of three different varieties) during authenticity verification [139].  
FCM clustering is an extension of the traditional clustering method where a sample can be associated with more than one cluster and holds membership values for each cluster. Basically, this has an advantage under situations with data structures that overlap [140]. An experiment could be observed in the work on chia seeds' storage, where NIR-HSI was implemented together with FCM to observe the polyunsaturated fatty acid degradation and build up free fatty acids under the storage conditions [141]. Its capability for the detection of slight changes in composition with time, along with appropriate chemometric techniques like PLRS, made FCM precisely predict the concentrations of the fatty acids and hence demonstrated its capability with regard to food quality and safety during storage.  
Density-Based Spatial Clustering of Applications with Noise (DBSCAN) finds density separates areas of data, with noise tolerance, and therefore it can be applied to datasets that have outliers [135]. [PERSON] et al. (2022) and [PERSON] et al. (2023), respectively, used DBSCAN to remove the outliers in HSI data before further processing. These pre-processing steps enhanced the later models to find the grain type and mixing ratios with higher accuracy. The ability of DBSCAN to identify core samples and label outliers adds significant reliability in unsupervised classification models, especially in the case of food analysis [142; 143]. Each one of these clustering methods has its foods and unique advantages relative to quality and safety, be it in differentiating ingredients or identifying adulterants and the authentication of products. It is within cluster analytics techniques that food scientists can then confer effective data management for complex data arising from HSI and other advanced sensing technologies.