## 2 Materials and Methods
### Data Analysis
#### 2.4.2 Partial Least Squares Regression (PLSR) and Finding Effective Wavelengths  
Non-destructive methods based on full-range spectroscopy are impractical due to their high cost and time consumption. Consequently, identifying and minimizing the effective wavelength range is essential. This study initially applied a partial least squares regression (PLSR) model to the complete dataset. To evaluate the model's performance, data were randomly partitioned into calibration (70%) and prediction (30%) sets. Model validation employed the coefficient of determination (R\({}^{2}\)), root mean square error (RMSE), and ratio of performance to deviation (RPD) as metrics (Equations (4)-(6)). \[\text{R}^{2}=1-\frac{\sum_{i=1}^{\text{N}}(\text{p}_{\text{i}}-\text{d}_{\text{ i}})^{2}}{\sum_{i=1}^{\text{N}}(\overline{\text{p}}_{\text{i}}-\text{d}_{ \text{i}})^{2}} \tag{4}\]  
\[\text{RMSE}=\sqrt{\frac{\sum_{i=1}^{\text{N}}(\text{d}_{\text{i}}-\text{p}_{ \text{i}})}{\text{N}}} \tag{5}\]  
\[\text{RPD}=\frac{\text{SD}}{\text{RMSE}} \tag{6}\]  
where \(\text{d}_{\text{i}}\) and \(\text{p}_{\text{i}}\) represent the actual and predicted values, respectively, of the i-th component, \(\overline{\text{p}}\) is the average of the predicted values, N is the number of components, \(SD=\sqrt{\frac{1}{\text{1-N}}}\sum_{i=1}^{N}\left(d_{i}-d_{average}\right)^{2}\) is the standard deviation of the measured data, and average is the mean of the reference (measured) data values. The RPD was calculated, and the performance of the regression (estimation) system was classified based on the recommendation value ranges provided [39]. In essence, an RPD value less than 1 indicates a very weak and inaccurate model. If RPD falls between 1 and 1.4, the model is considered weak. A suitable model for evaluation and prediction has an RPD between 1.4 and 1.8. For quantitative accurate predictions, an RPD between 1.8 and 2 is required. A very good model exhibits an RPD between 2 and 2.5, while an RPD greater than 2.5 signifies a great model. Subsequently, hybrid models combining support vector machines (SVM) with genetic algorithms (GA), particle swarm optimization (PSO), ant colony optimization (ACO), and imperialistic competitive algorithm 1 (ICA) were employed to identify optimal wavelengths [40]. SVM is a robust classification technique that constructs a hyperplane to segregate data points into distinct classes. This hyperplane is positioned to maximize the margin between the closest data points of each class, termed support vectors [41]. SVM is a prominent machine learning (ML) algorithm renowned for its efficacy in discerning intricate patterns within complex datasets, surpassing other ML methods [42]. Applications of SVM encompass handwriting recognition, counterfeit credit card detection, speaker identification, and facial recognition [43]. Genetic algorithms (GAs) are heuristic search and optimization techniques inspired by the process of natural evolution. They have been successfully applied to a wide range of complex real-world problems. Originally conceived based on [PERSON]'s principle of evolution through natural selection, GAs employ a highly abstracted version of these processes to evolve solutions to given problems [44]. Swarm-based algorithms have emerged as a potent family of optimization techniques, drawing inspiration from the collective behaviors observed in social animals. Particle swarm optimization (PSO) is a prominent example, wherein a set of potential solutions, termed particles, navigate the parameter space. Their trajectories are influenced by both their individual performance and that of their neighbors. This swarm concept, rooted in the collaborative actions of animals like birds, fish, ants, bees, and termites, underpins the study of multi-agent distributed intelligence systems. Swarms comprise homogeneous, simple agents executing relatively basic tasks and interacting locally with peers and their environment.