# Advancing Visible Spectroscopy through Integrated Machine Learning and Image Processing Techniques
## 3 Methodology
These Rrs spectra are functions of wavelength, representing the measured light intensity at different wavelengths. Tristimulus values are then determined through integrating Rrs with standard colorimetry two-degree Colour Matching Functions (CMFs), which serve as weighting functions based on the sensitivity of human vision to different wavelengths. For each sensor used in the study, such as SeaWiFS, MODIS, MERIS, OLCI, Landsat, and MSI, weights (M) are precalculated based on CMFs and the central wavelengths of each sensor's spectral bands. These sensors typically have narrow spectral bands, ensuring the accurate measurement of Rrs at specific wavelengths. Subsequently, the offset for hue angles is determined by comparing the reconstructed sensor spectrum with the original hyperspectral spectrum. This comparison ensures the accuracy of hue angle calculations across different sensors. For instruments with broad spectral bands, such as the MSI on Sentinel-2 or MODIS 500-m product, which have a varying detection efficiency within each band described using the Spectral Response Function (SRF), a similar approach is followed. Weights are precalculated based on the mean wavelength of each band, and Rrs is derived by folding IOCCG and field spectra with the sensor's SRF. This process allows for the determination of hue angles from the derived Rrs values, which are then compared with the original hyperspectral data to assess accuracy. In summary, the dataset, hue values, and corresponding wavelengths are generated through a meticulous process involving the correction of Rrs spectra, integration with CMFs, the pre-calculation of weights based on sensor characteristics, and the folding of spectra with sensor SRFs to derive Rrs values for each sensor band, ultimately allowing for the accurate determination of hue angles. In this study, a total of 241 data were used, with variations across different materials and their corresponding hue values being calculated. A breakdown of the dataset distribution for each light source could provide further insight into the distribution and composition of the samples. The hue value represents the colour information extracted from an image, while the dominant wavelength corresponds to the peak wavelength of the emitted light. This dataset serves as the foundation for establishing a mathematical relationship between hue values and dominant wavelengths. To model this relationship, polynomial regression is initially applied to the dataset. To model the relationship between the independent variable X (representing the hue value) and the dependent variable y (representing the hue value of an image), we initially employed polynomial regression on the dataset. Polynomial regression is a statistical technique utilised to fit a polynomial function to observed data points, allowing us to capture potentially nonlinear relationships between variables. In the provided code snippet that is Table 2, the dataset is divided into training and testing sets using the \"train_test_split\" function, where X and Y represent the independent and dependent variables, respectively, with a test size of 20% and a specified random state for reproducibility. In this study, polynomial regression models with degrees ranging from 2 to 5 are constructed and evaluated. However, upon analysis, it is observed that these models exhibit significant errors and fail to adequately capture the underlying patterns in the data. Recognising the need for a more flexible and expressive model, a 6 th-degree polynomial regression model is subsequently employed. The decision to increase the polynomial degree is motivated by the desire to capture higher-order relationships and finer details