Medium-Sized Lake Water Quality Parameters Retrieval Using Multispectral UAV Image and Machine Learning Algorithms: A Case Study of the Yuandang Lake, China

: Water quality monitoring of medium-sized inland water is important for water environment protection given the large number of small-to-medium size water bodies in China. A case study was conducted on Yuandang Lake in the Yangtze Delta region, with a surface area of 13 km 2 . This study proposed utilising a multispectral uncrewed aerial vehicle (UAV) to collect large-scale data and retrieve multiple water quality parameters using machine learning algorithms. An alternate processing method is proposed to process large and repetitive lake surface images for mapping the water quality data to the image. Machine learning regression methods (Random Forest, Gradient Boosting, Backpropagation Neural Network, and Convolutional Neural Network) were used to construct separate water quality inversion models for ten water parameters. The results showed that several water quality parameters (COD Mn , temperature, pH, DO, and NC) can be retrieved with reasonable accuracy (R 2 = 0.77, 0.75, 0.73, 0.67, and 0.64, respectively), although others (NH 3 - N, BGA, TP, Turbidity, and Chl-a) have a determination coefﬁcient (R 2 ) less than 0.6. This work demonstrated the tremendous potential of employing multispectral data in conjunction with machine learning algorithms to retrieve multiple water quality parameters for monitoring medium-sized bodies of water.


Introduction
Inland waters, such as lakes, reservoirs, and rivers, are important supplies of freshwater for humans.Since human populations are typically located near water bodies, the water bodies are prone to pollution from intensive human activities and environmental changes.Pollutants from agricultural activities and industrial waste cause an overabundance of nutrients in the water, resulting in eutrophication.Eutrophication leads to excessive growth of simple plants and causes algae blooms, which ruin the aquatic ecological system by consuming a considerable amount of dissolved oxygen and resulting in the death of aquatic creatures and plants.Eutrophication has and continues to represent a severe threat to sources of water supply, fisheries, and recreational water bodies because of the pervasive extent of water quality degradation brought on by nutrient enrichment.Thus, water quality monitoring has become an important strategy for water environment protection to reduce eutrophication.Water quality is monitored according to the Environmental Quality Standards for Surface Water [1] in China by assessing the chemical constituents and conditions of the water bodies at the required temporal and spatial gaps.The water quality parameters and concentrations stated in the standard are the most often employed evaluation measurements to characterise the water quality of inland bodies.
for building high-quality orthomosaic maps [20].Due to the existing limitations of UAVs, data collection and processing are more challenging for medium-sized lakes.Hence, our research proposed the use of multispectral UAV remote sensing data for medium-sized lake water quality monitoring and investigated the inversion of multiple water parameters using machine learning algorithms for inland water monitoring.
The main innovations and contributions of our research work are as follows: (1) systematic data collection and data processing using multispectral UAV was proposed for effective and efficient monitoring of medium-sized water bodies.(2) using band equations derived from multispectral UAV images to retrieve multiple water parameters, including Chl-a, temperature, pH, DO, EC, blue-green algae (BGA), Turbidity, NH 3 -N, TP, and COD Mn .

Materials and Methods
A systematic multispectral UAV remote sensing data collection and processing workflow for medium-sized lake is introduced in this work, and four machine learning models: RF, GB, BP, and CNN, are utilised to retrieve ten water quality parameters.This chapter discussed the data collection and processing for multispectral UAV and in situ water data, as well as the employed machine learning models.

Study Area
The study area was Yuandang Lake (31.0634 • N, 120.8901 • E), located in Suzhou, Jiangsu Province, China, and connected to three rivers that flow in and out of the lake.The surface area of the lake is roughly 13 km 2 , which is a reasonable representation of medium-sized lakes.Based on the satellite images of the lake from 2019 to 2021, it is observed that there were algae blooms occurring throughout the months of August and September.Temperature increment during the summer season caused the occurrence of algae bloom, which will have a major impact on the water ecosystem and generate serious environmental problems.The Yuandang Lake is one of the important lakes in the Yangtze Delta region, which is essential for economic, ecological, and social benefits and is a habitat for many species.In the overall development strategy in the Yangtze Delta region, the water quality of the lake needs to be monitored and improved to support the development of green economy.Thus, it is vital to monitor the water quality of the Yuandang lake, and study is undertaken for the entire region of the lake.Figure 1 depicts the geographic location of the study region.
been investigated thoroughly for medium-sized water bodies due to extensive and prolonged data collection, as well as distinct data processing techniques.UAV remote sensing data collection is constrained by the flight duration, weather and the data requirement for building high-quality orthomosaic maps [20].Due to the existing limitations of UAVs, data collection and processing are more challenging for medium-sized lakes.Hence, our research proposed the use of multispectral UAV remote sensing data for medium-sized lake water quality monitoring and investigated the inversion of multiple water parameters using machine learning algorithms for inland water monitoring.
The main innovations and contributions of our research work are as follows: (1) systematic data collection and data processing using multispectral UAV was proposed for effective and efficient monitoring of medium-sized water bodies.(2) using band equations derived from multispectral UAV images to retrieve multiple water parameters, including Chl-a, temperature, pH, DO, EC, blue-green algae (BGA), Turbidity, NH3-N, TP, and CODMn.

Materials and Methods
A systematic multispectral UAV remote sensing data collection and processing workflow for medium-sized lake is introduced in this work, and four machine learning models: RF, GB, BP, and CNN, are utilised to retrieve ten water quality parameters.This chapter discussed the data collection and processing for multispectral UAV and in situ water data, as well as the employed machine learning models.

Study Area
The study area was Yuandang Lake (31.0634°N, 120.8901°E), located in Suzhou, Jiangsu Province, China, and connected to three rivers that flow in and out of the lake.The surface area of the lake is roughly 13 km 2 , which is a reasonable representation of medium-sized lakes.Based on the satellite images of the lake from 2019 to 2021, it is observed that there were algae blooms occurring throughout the months of August and September.Temperature increment during the summer season caused the occurrence of algae bloom, which will have a major impact on the water ecosystem and generate serious environmental problems.The Yuandang Lake is one of the important lakes in the Yangtze Delta region, which is essential for economic, ecological, and social benefits and is a habitat for many species.In the overall development strategy in the Yangtze Delta region, the water quality of the lake needs to be monitored and improved to support the development of green economy.Thus, it is vital to monitor the water quality of the Yuandang lake, and study is undertaken for the entire region of the lake.Figure 1

Data Collection
Based on the algae bloom period studied using satellite images, data collection was conducted on 5, 8, and 10 August 2022.The collected data of this study consists of around 1 k UAV photos, 4 k water quality data points, and 60 water samples.

UAV Multispectral Image Collection
In this study, DJI P4 Multispectral UAV is used to capture high-resolution multispectral photographs.The drone is capable of collecting blue, green, red, red-edge, near-infrared bands, and RGB images simultaneously using its six 1/2.9-inchCMOS sensors.The image resolution of the multispectral bands and RGB was 1600 × 1300 pixels captured with a 5.74 mm focal lens.The cameras are mounted on a 3-axis gimbal, which provides stabilisation when taking photos.The flight plan was determined using the DJI GS Pro, which can be used to plan a route automatically based on the flight area, flight altitude, front overlap ratio, and side overlap ratio.Due to the large surface area of the lake, the operational altitude of the UAV was set at a maximum altitude of 500 m while both the front and side overlap degree was set at 15% to enable efficient data collection of the entire lake.The resulting ground sampling distance after the setting is around 25.9 cm/pixel.In addition to flight altitude and overlapping ratio, sun glint or water flares are the most influential factor in the UAV water quality inversion.Based on multiple trial flight tests, the acquired photo is more susceptible to sun glint effect when the sun incidence angle is larger than 60°.Thus, in order to eliminate water reflection, all images were taken between 9.00-11.00and 14.00-17.00local time, where the sun incidence angle was between 30°-60°.Since large-scale data collection required longer operation time, weather forecasts had to be checked on a regular basis to

Data Collection
Based on the algae bloom period studied using satellite images, data collection was conducted on 5, 8, and 10 August 2022.The collected data of this study consists of around 1 k UAV photos, 4 k water quality data points, and 60 water samples.

UAV Multispectral Image Collection
In this study, DJI P4 Multispectral UAV is used to capture high-resolution multispectral photographs.The drone is capable of collecting blue, green, red, red-edge, near-infrared bands, and RGB images simultaneously using its six 1/2.9-inchCMOS sensors.The image resolution of the multispectral bands and RGB was 1600 × 1300 pixels captured with a 5.74 mm focal lens.The cameras are mounted on a 3-axis gimbal, which provides stabilisation when taking photos.The flight plan was determined using the DJI GS Pro, which can be used to plan a route automatically based on the flight area, flight altitude, front overlap ratio, and side overlap ratio.Due to the large surface area of the lake, the operational altitude of the UAV was set at a maximum altitude of 500 m while both the front and side overlap degree was set at 15% to enable efficient data collection of the entire lake.The resulting ground sampling distance after the setting is around 25.9 cm/pixel.In addition to flight altitude and overlapping ratio, sun glint or water flares are the most influential factor in the UAV water quality inversion.Based on multiple trial flight tests, the acquired photo is more susceptible to sun glint effect when the sun incidence angle is larger than 60 • .Thus, in order to eliminate water reflection, all images were taken between 9.00-11.00and 14.00-17.00local time, where the sun incidence angle was between 30 • -60 • .Since large-scale data collection required longer operation time, weather forecasts had to be checked on a regular basis to ensure low precipitation and wind speed throughout the day.Each collected image will have precise coordinates stored in the image metadata, utilising the onboard Real-Time Kinematic (RTK) technology for further processing.DJI also provides extra information such as flight yaw, pitch, and roll in the image metadata to simplify image processing.
The collected multispectral data are displayed as digital numbers (DN) in the image.A calibration plate is required for radiometric calibration to obtain an accurate reflectance image.Hence, during each data collection, a set of calibration plate photos is also collected, as shown in Figure 2. The calibration plates constitute 25%, 50%, and 75% reflectance surfaces for precise calibration.For every planned path and coverage area, a set of 6 photos will be generated same as in Figure 2. The collected multispectral data are displayed as digital numbers (DN) in the ima A calibration plate is required for radiometric calibration to obtain an accurate reflecta image.Hence, during each data collection, a set of calibration plate photos is also c lected, as shown in Figure 2. The calibration plates constitute 25%, 50%, and 75% refl tance surfaces for precise calibration.For every planned path and coverage area, a set o photos will be generated same as in Figure 2.

In Situ Water Data Collection
Data collection of water quality parameters was carried out in two different ways: using a YSI EXO2 Multiparameter Sonde handheld meter and (2) collecting water samp for laboratory testing and analysis.Both methods have been used in water quality mo toring previously [10,14].
The route for recording water quality parameters is depicted in Figure 3 with in and outer regions, and approximately 1.5-2 k data points are collected each time contin ously for about three hours.The route is planned based on the observation from the s ellite image that the harmful algae bloom will first emerge in the outer region of the la and gradually grow to the inner region.The handheld meter is equipped with sensors measuring seven parameters: pH, BGA, Chl-a, EC, DO, temperature, and Turbidity v ues, each of them important for monitoring and evaluating water quality.In addition that, GPS location of every data point is also recorded.

In Situ Water Data Collection
Data collection of water quality parameters was carried out in two different ways: (1) using a YSI EXO2 Multiparameter Sonde handheld meter and (2) collecting water samples for laboratory testing and analysis.Both methods have been used in water quality monitoring previously [10,14].
The route for recording water quality parameters is depicted in Figure 3 with inner and outer regions, and approximately 1.5-2 k data points are collected each time continuously for about three hours.The route is planned based on the observation from the satellite image that the harmful algae bloom will first emerge in the outer region of the lake and gradually grow to the inner region.The handheld meter is equipped with sensors for measuring seven parameters: pH, BGA, Chl-a, EC, DO, temperature, and Turbidity values, each of them important for monitoring and evaluating water quality.In addition to that, GPS location of every data point is also recorded.
Figure 4 depicts the locations where the water sample was taken; 20 sampling points were evenly distributed across the lake to represent each subregion.The analysed water parameters are NH 3 -N, TP, and COD Mn , which are essential for determining the standards of lake eutrophication and popular indicators for organic pollution.Two 2.5-L bottles of water are collected at a depth of 50 cm at each sampling location for spectrophotometric analysis to determine the exact water quality concentration.Figure 4 depicts the locations where the water sample was taken; 20 sampling points were evenly distributed across the lake to represent each subregion.The analysed water parameters are NH3-N, TP, and CODMn, which are essential for determining the standards of lake eutrophication and popular indicators for organic pollution.Two 2.5-L bottles of water are collected at a depth of 50 cm at each sampling location for spectrophotometric analysis to determine the exact water quality concentration.

Data Processing
After data collection, both the UAV multispectral data and the in situ water data are processed according to the workflow shown in Figure 5, with the details outlined in the subsequent six sections.

Data Processing
After data collection, both the UAV multispectral data and the in situ water data are processed according to the workflow shown in Figure 5, with the details outlined in the subsequent six sections.

Data Processing
After data collection, both the UAV multispectral data and the in situ water data are processed according to the workflow shown in Figure 5, with the details outlined in the subsequent six sections.

UAV Multispectral Image Data Processing
The raw multispectral band images were prone to phase difference, lens distortion, and vignetting effect; all images were processed in accordance with the DJI's specific guidelines [33].The phase difference is caused by the multispectral cameras' different locations.DJI provided the relative optical centre of each camera in x and y coordinates, which correspond to the physical positions of the cameras for correction.Although the correction is not perfect, the phase difference between each band is reduced to some extent.Lens distortion is a common effect in every camera system; it can be corrected using the dewarp data in the image metadata.Furthermore, due to lens limitations, each multispectral band image suffers from vignetting.The vignetting effect is the difference in image intensity where the image centre appears to be brighter than the edge.The vignette is corrected using vignetting data from the metadata file.After the corrections, the reflectance value can be calculated accurately using the equation provided in the guideline.The image before and after correction is shown in Figure 6, where the phase difference and lens distortion effect can be observed before the correction.

UAV Multispectral Image Data Processing
The raw multispectral band images were prone to phase difference, lens distortion, and vignetting effect; all images were processed in accordance with the DJI's specific guidelines [33].The phase difference is caused by the multispectral cameras' different locations.DJI provided the relative optical centre of each camera in x and y coordinates, which correspond to the physical positions of the cameras for correction.Although the correction is not perfect, the phase difference between each band is reduced to some extent.Lens distortion is a common effect in every camera system; it can be corrected using the dewarp data in the image metadata.Furthermore, due to lens limitations, each multispectral band image suffers from vignetting.The vignetting effect is the difference in image intensity where the image centre appears to be brighter than the edge.The vignette is corrected using vignetting data from the metadata file.After the corrections, the reflectance value can be calculated accurately using the equation provided in the guideline.The image before and after correction is shown in Figure 6, where the phase difference and lens distortion effect can be observed before the correction.Furthermore, radiometric calibration is performed using a calibration plate to ensure the accuracy of the calculated reflectance value.This step is critical for large-scale image data collection because the data collection process took around 4-6 h, resulting in inconsistent image intensity due to variations in sun angles.Three calibration plates with different reflective surfaces were custom-made and sent to the lab to record the reflectance value of each wavelength from 420 to 1000 nm.The lab report is required in order to determine the true reflectance value of each multispectral band.A set of multispectral band images is captured before or after each data collection, with the calibration plates placed directly below the camera.The mean pixel value of each calibration plate is extracted from the captured images to plot the linear regression equation for each band together with the true reflectance value [34].The reflectance value of the image was obtained using the linear regression equation, and the corrected images were stitched together to form a panoramic photo of the entire lake.Due to the low feature point across all lake surface images, com-mercial software used for small-scaled water bodies are incapable of reconstructing the entire lake surface.This is because commercial software mainly uses feature points between each image to construct the mosaic image, but the lake water surface images in large-scale data collections lack consistent salient features, making it impossible for the algorithm to identify important information for reconstruction.Because no other image stitching or 3D reconstruction software can produce panoramic images from repetitive lake images, code is written to stitch the image using the image GNSS coordinates as well as position and orientation system (POS) of the drone.The positioning accuracy of RTK GNSS is around 1 cm horizontally and 1.5 cm vertically, which is sufficient for image stitching.Furthermore, radiometric calibration is performed using a calibration plate to ensure the accuracy of the calculated reflectance value.This step is critical for large-scale image data collection because the data collection process took around 4-6 h, resulting in inconsistent image intensity due to variations in sun angles.Three calibration plates with different reflective surfaces were custom-made and sent to the lab to record the reflectance value of each wavelength from 420 to 1000 nm.The lab report is required in order to determine the true reflectance value of each multispectral band.A set of multispectral band images is captured before or after each data collection, with the calibration plates placed directly below the camera.The mean pixel value of each calibration plate is extracted from the captured images to plot the linear regression equation for each band together with the true reflectance value [34].The reflectance value of the image was obtained using the linear regression equation, and the corrected images were stitched together to form a panoramic photo of the entire lake.Due to the low feature point across all lake surface images, commercial software used for small-scaled water bodies are incapable of reconstructing the entire lake surface.This is because commercial software mainly uses feature points between each image to construct the mosaic image, but the lake water surface images in large-scale data collections lack consistent salient features, making it impossible for the algorithm to identify important information for reconstruction.Because no other image stitching or 3D reconstruction software can produce panoramic images from repetitive lake images, code is written to stitch the image using the image GNSS coordinates as well as position and orientation system (POS) of the drone.The positioning accuracy of RTK GNSS is around 1 cm horizontally and 1.5 cm vertically, which is sufficient for image stitching.Figure 7 depicts panoramic image after stitching.Furthermore, radiometric calibration is performed using a calibration plate to ensure the accuracy of the calculated reflectance value.This step is critical for large-scale image data collection because the data collection process took around 4-6 h, resulting in inconsistent image intensity due to variations in sun angles.Three calibration plates with different reflective surfaces were custom-made and sent to the lab to record the reflectance value of each wavelength from 420 to 1000 nm.The lab report is required in order to determine the true reflectance value of each multispectral band.A set of multispectral band images is captured before or after each data collection, with the calibration plates placed directly below the camera.The mean pixel value of each calibration plate is extracted from the captured images to plot the linear regression equation for each band together with the true reflectance value [34].The reflectance value of the image was obtained using the linear regression equation, and the corrected images were stitched together to form a panoramic photo of the entire lake.Due to the low feature point across all lake surface images, commercial software used for small-scaled water bodies are incapable of reconstructing the entire lake surface.This is because commercial software mainly uses feature points between each image to construct the mosaic image, but the lake water surface images in large-scale data collections lack consistent salient features, making it impossible for the algorithm to identify important information for reconstruction.Because no other image stitching or 3D reconstruction software can produce panoramic images from repetitive lake images, code is written to stitch the image using the image GNSS coordinates as well as position and orientation system (POS) of the drone.The positioning accuracy of RTK GNSS is around 1 cm horizontally and 1.5 cm vertically, which is sufficient for image stitching.Figure 7 depicts panoramic image after stitching.The panoramic image, however, requires additional processing because it lacks accurate geographic coordinate information that can be used to combine with continuous water parameter data and water samples.Since a single GPS coordinate on each image centre is insufficient for the water data mapping, ArcGIS Pro is used to convert the panoramic image to a GeoTIFF file [35].By using some lakeside objects such as houses and landmarks as georeferencing ground control points, the image is transformed to the specific location and masked with a coordinate layer where each pixel is assigned a GPS coordinate value.

In Situ Water Data Processing
The aforementioned water data collection approaches with respect to Figure 4 in Section 2.2.2 yielded ten water quality parameters data with GPS coordinates.Since the data are collected while the boat is moving, occasionally, water weed and grass will intertwine with the handheld metre, requiring personnel to stop the boat to remove the intertwined grass, resulting in duplicate values.As part of the data cleansing process, duplicate values in the collected continuous measurements were deleted.Furthermore, because of the intertwined water weed and grass, abnormal values such as a sudden large increase in water parameters' concentration existed in the dataset, which would affect the model accuracy.Hence, anomaly detection is performed using the isolation forest (IF) algorithm to detect outliers autonomously.IF is an unsupervised model built based on decision trees that process the randomly subsampled data in a tree structure based on randomly selected features.IF algorithm labelled the anomaly values to be removed in the data processing state.

Mapping of UAV and Water Data
UAV data and water quality data were in the same coordinate system after processing; the value of five multispectral bands was recorded for each water data point using the mean pixel value with a window size of 20 × 20 pixels, as shown in Figure 5.The window size is decided using other research as a reference [11,12,36].A window size is required because the band data will deviate if they are obtained from a single pixel, whereas if the window size is too large, the band data will lose some features.During data collection, the sun glint effect was minimised but not eliminated completely in some images; thus, the reflected water region with sun glint is masked with black pixel value manually to be filtered out of the dataset.

Calculation of Band Indices
According to relevant studies, different band combinations were used in water quality inversion to improve the accuracy of the inversion model.Additionally, the band ratios approach can remove background noise and interference from rough water surfaces [37].Therefore, a total of 84 band indices were used in this study, as shown in Table 2.The band indices were constructed using five bands with the combination of band sums, band differences, band ratios, and other vegetation indices summarised in other studies [26,28,30].

Machine Learning Models
Random Forest (RF), Gradient Boosting (GB), Convolutional Neural Network (CNN), and Backpropagation Neural Network (BP) are chosen as water quality inversion algorithms because they are common models that have performed relatively well in previous research [36,38,39].
RF model, developed by Breiman, is a common machine learning algorithm that is used for both classification and regression problems [40].RF model consists of large number of decision trees that operate as an ensemble to generate a final output for a specific problem.The model first selects a subset of data points and features to construct individual decision tree for each sample.Each decision tree will generate an output, and the final output is decided based on majority voting or averaging.In decision trees, low correlation between trees is the key to producing accurate predictions.In order to achieve low correlation in RF model, it uses bagging method to allow each individual tree to randomly sample from the dataset with replacement, resulting in different trees.Feature randomness in an RF model forces each tree to select only from a random selection of features, resulting in more variation and eventually leading to lower correlation across the tree.The hyperparameter of the RF model can be tuned using randomised search in scikit-learn library.The chosen parameters are n_estimators (1400), min_samples_split (2), min_samples_leaf (1), max_features (auto), and max_depth (100) for the RF model used in this study.

Index
Formula Index Formula Index Formula GB model is also used for both classification and regression problems.Gradient Boosting is a variation of ensemble methods in which numerous weak models are created and combined to improve overall performance.GB model, like RF, is built of ensemble of decision trees, but the sequence of each tree is generated focusing on the prediction residuals of previous tree [41].GB model estimates the basis function non-parametrically and uses gradient descent to approximate the solution in function space.The hyperparameter of the RF model can be tuned using randomised search in scikit-learn library.The chosen parameters are n_estimators (800), learning_rate (0.01), loss (squared_error), and max_depth (5) for the RF model used in this study.Additionally, GB model has many variants, such as XGBoost, and it can combine with genetic algorithm (GA) for optimal global solution, which is called GA_XGBoost model [25].
CNN is a feedforward neural network that performs well in target recognition and regression.Examples of CNN models are AlexNet, VGG-16, Google Net, ResNet, and other classical Convolutional Neural Network models.Although the structures are complex and varied, the basic structures and principles are similar, and the models have an input layer, a hidden layer, and an output layer.The hidden layer of CNN is made up of convolutional layers, activation function layers, pooling layers, and fully connected layers.Convolution is the operation of extracting features by weighting and averaging the pixel points in the local area of the input image with the convolution kernel's weight coefficients, pooling is used to compress the extracted features, and the activation function adds nonlinear variations to the neural network model.To train the CNN model, the model undergoes continuous convolution and pooling to adjust the weight parameters of each CNN layer.The weight parameters are continuously adjusted until loss is minimised to better fit the features of the input data.The architecture layers of the CNN model used in this study is shown in Figure 8 with two convolutional blocks and one fully connected layer.The two convolutional blocks consist of a convolutional layer (Conv), a batch normalisation layer (Batch Norm) to speed up the training and a rectified linear unit (ReLU) which is an activation function layer.The dropout layer is placed before the fully connected layer to prevent overfitting, while the flattening layer converts the data into a one-dimensional array for inputting the data into the fully connected layer.The architecture does not include the pooling layer since the dimension reduction is not obvious for small images.The network architecture is relatively simple since research has shown that deep layers are not required for water quality inversion [12,36].
convolutional layers, activation function layers, pooling layers, and fully connected layers.Convolution is the operation of extracting features by weighting and averaging the pixel points in the local area of the input image with the convolution kernel's weight coefficients, pooling is used to compress the extracted features, and the activation function adds nonlinear variations to the neural network model.To train the CNN model, the model undergoes continuous convolution and pooling to adjust the weight parameters of each CNN layer.The weight parameters are continuously adjusted until loss is minimised to better fit the features of the input data.The architecture layers of the CNN model used in this study is shown in Figure 8 with two convolutional blocks and one fully connected layer.The two convolutional blocks consist of a convolutional layer (Conv), a batch normalisation layer (Batch Norm) to speed up the training and a rectified linear unit (ReLU) which is an activation function layer.The dropout layer is placed before the fully connected layer to prevent overfitting, while the flattening layer converts the data into a onedimensional array for inputting the data into the fully connected layer.The architecture does not include the pooling layer since the dimension reduction is not obvious for small images.The network architecture is relatively simple since research has shown that deep layers are not required for water quality inversion [12,36].BP neural network is a multi-layer feedforward network that generally consists of three layers: input layer, hidden layer (also known as intermediate layer), and output layer.The neurons in each layer are only fully connected with each other and the neurons in adjacent layers, with no connection between neurons in the same layer and no feedback connection between neurons in each layer, resulting in a hierarchical feedforward neural network system.Each neuron receives input signals from other neurons, and each signal is routed through a weighted connection.The neuron adds these signals together to obtain a total input value, which is then compared to the neuron's threshold and finally processed by an activation function to obtain the final output, which is passed on layer by layer as input to subsequent neurons.The purpose of the activation function is to introduce non-linearity into the model.Without an activation function, no matter how many layers the neural network has, it is ultimately limited to a linear mapping, resulting in the network's approximation capability being rather limited, and a simple linear mapping cannot solve the linear indistinguishability problem.Various features for retrieving the water quality parameters are processed through the input layer of the BP neural network, and the final prediction results are obtained through the output layer output.When the output layer of the BP neural network output results and its pre-set input value of the error is large, the BP neural network enters the backpropagation stage, and the neuron weights are updated until the output results and the expected result error meet certain BP neural network is a multi-layer feedforward network that generally consists of three layers: input layer, hidden layer (also known as intermediate layer), and output layer.The neurons in each layer are only fully connected with each other and the neurons in adjacent layers, with no connection between neurons in the same layer and no feedback connection between neurons in each layer, resulting in a hierarchical feedforward neural network system.Each neuron receives input signals from other neurons, and each signal is routed through a weighted connection.The neuron adds these signals together to obtain a total input value, which is then compared to the neuron's threshold and finally processed by an activation function to obtain the final output, which is passed on layer by layer as input to subsequent neurons.The purpose of the activation function is to introduce nonlinearity into the model.Without an activation function, no matter how many layers the neural network has, it is ultimately limited to a linear mapping, resulting in the network's approximation capability being rather limited, and a simple linear mapping cannot solve the linear indistinguishability problem.Various features for retrieving the water quality parameters are processed through the input layer of the BP neural network, and the final prediction results are obtained through the output layer output.When the output layer of the BP neural network output results and its pre-set input value of the error is large, the BP neural network enters the backpropagation stage, and the neuron weights are updated until the output results and the expected result error meet certain conditions.The number of features selected determines the number of input nodes of the BP model.After testing and refining the different hidden layers' architecture, the BP model utilised in this study has 6 hidden layers with node numbers of 14-14-15-15-15-15.

Accuracy Evaluation
The coefficient of determination (R 2 ), root mean square error (RMSE), and mean absolute error (MAE) were used to quantify the accuracy and performance of the model using new data (Equations ( 1)-(3), respectively).
where ŷi represents the predicted values of the water quality parameters, y i represents the measured values of the water quality parameters, and n is the number of sampling points.The value of R 2 ranges from 0 to 1.An R 2 value of 1 denotes perfect precision, whereas a score of 0 denotes the model's lowest prediction performance.The value range of RMSE is (0, +∞).High RMSE indicates that the model's predicted value has a high degree of deviation.MAE is the mean of the absolute value of the error between the predicted value and the observed value.A model with a high R 2 , low RMSE, and a low MAE is considered suitable for quantitative inversion.
The data set was divided into training and validation sets using random split sampling.In total, 80% of the inputting data were used for training the model, and 20% of the inputting data were used to assess the prediction accuracy of the model.In this study, all the above model operations were based on the anaconda platform, and the modeling of water quality parameters with the RF algorithms was implemented with the scikit-learn machine learning library, while the BP and CNN were implemented using MATLAB.

Results
This chapter presents descriptive statistics for the water data acquired in Section 2.2.2 and Pearson correlation analysis results for spectral indices with the ten water quality parameters in Table 2.The results of the machine learning regression models on retrieving ten water parameters are shown in the Section 3.

Data Analysis
Table 3 summarises the mean, maximum, minimum, and standard deviation of the concentrations of the water quality parameters samples of ammonia nitrogen, total phosphorous, and permanganate index in three sampling days with respect to Figure 4 in Section 2.2.2.
Based on Table 3, NH 3 -N ranged from 0.2658-1.1499mg/L within 5-10 August, with the mean and standard deviation of 0.6394 ± 0.2235 mg/L; the highest concentration was obtained on 5 August, TP ranged from 0.5809-1.1499mg/L with mean and standard deviation of 0.7967 ± 0.1512 mg/L.Based on the concentration of TP, a decreasing trend is observed in the concentration values.
TP ranged from 0.0676-0.1986mg/L within 5-10 August, with the mean and standard deviation of 0.1308 ± 0.0333 mg/L; the highest concentration was obtained on 10 August, TP ranged from 0.1016-0.1986mg/L with mean and standard deviation of 0.14998 ± 0.03414 mg/L.Based on the concentration of TP, an increasing trend is observed in the concentration values.
For COD Mn , it ranged from 3.4296-7.5345mg/L within 5-10 August, with the mean and standard deviation of 6.1657 ± 0.8656 mg/L; the highest concentration was obtained on 5 August where COD Mn ranged from 6.8058-7.5345mg/L with mean and standard deviation of 7.1753 ± 0.2098 mg/L.Table 4 summarises the mean, maximum, minimum, and standard deviation of the concentrations of the seven water quality parameters in three sampling days with respect to Figure 3 in Section 2.2.2.
Table 4 displays the statistical analysis results of seven water parameters' raw data.Turbidity and NC have the highest standard deviation among all water parameters, with NC having a similar standard deviation on each day and Turbidity having a significantly distinct standard deviation.Chl-a and BGA show similar data variations, while pH, DO, and temperature show little variations in the concentration.

Spectral Index and Water Quality Parameters Correlation Analysis
Pearson correlation analysis is performed to determine the most relevant features out of water parameters and spectral indices.Figure 9 shows the correlation coefficient between the NH 3 -N, TP, COD Mn , and 84 spectral indices.Among the three water parameters, COD Mn has the highest correlation coefficients with spectral indices, where the highest correlated spectral index is S2 with a 0.749 correlation value.S15 is the most correlated spectral index for TP, with a correlation value of −0.5121, and S58 is the most correlated spectral index for NH 3 -N.0.766 correlation coefficients.S53 is the most negatively correlated spectral index with BGA, with a correlation coefficient of −0.689 correlation coefficients.S36 is the most correlated spectral index for pH, with a correlation coefficient of −0.591.Whereas Chl-a has the lowest correlation with spectral indices, the highest correlation value is spectral index S31(=0.459).
Based on the analysis result, it can be observed that NH3-N, TP, BGA, and Chl-a show a weaker correlation with the features.Eventually, the highest correlated spectral indices were selected as variables to establish the inversion model.The correlation coefficient between temperature, DO, EC, and 84 spectral indices is shown in Figure 10.Water parameter temperature has the highest positive and negative correlation coefficients with spectral indices among the three parameters, where the highest positively correlated spectral index is S10 with a 0.579 correlation coefficient, while the highest negatively correlated spectral index is S76 with a −0.548 correlation coefficient.DO is more negatively correlated with spectral indices, with S22 having the largest negative correlation coefficient of −0.485.For EC water parameters, it is also more negatively correlated with spectral indices, with S3 having the highest correlation value of −0.516.The correlation coefficient between pH, Turbidity, BGA, Chl-a, and 84 spectral indices is shown in Figure 11.The correlation coefficients for these four water parameters indicate a similar trend, with Turbidity having the highest positive correlation coefficients.S4 is the most correlated spectral index with Turbidity, with a correlation coefficient of 0.766 correlation coefficients.S53 is the most negatively correlated spectral index with BGA, with a correlation coefficient of −0.689 correlation coefficients.S36 is the most correlated spectral index for pH, with a correlation coefficient of −0.591.Whereas Chl-a has the lowest correlation with spectral indices, the highest correlation value is spectral index S31(=0.459).

Results of Multivariate Regression Models
Table 5 shows the results of four multivariate regression models (RF, GB, BP, and CNN) using correlated spectral indices features in retrieving five water parameters: NH3-N, TP, CODMn, Chl-a, and BGA.According to the results, the RF model performed the best out of all models, while the CNN model performed the worst.On the training dataset, the RF model achieved around 0.88-0.95R 2 for all five parameters inversion; however, the R 2 of the testing dataset was lowest for Chl-a (R 2 = 0.33) while highest for CODMn (R 2 = 0.78) and moderate for NH3-N (R 2 = 0.51), TP (R 2 = 0.45), and BGA (R 2 = 0.43).On the training dataset, the GB model achieved around 0.65-0.95R 2 for all five parameters inversion; however, the R 2 of the testing dataset was lowest for Chl-a (R 2 = 0.32) and TP (R 2 = 0.32) while highest for CODMn (R 2 = 0.74) and moderate for NH3-N (R 2 = 0.55) and BGA (R 2 = 0.45).In comparison, the BP model achieved around 0.25-0.65R 2 in the training dataset and 0.15-0.52R 2 in the testing dataset for all five parameters.The worst-performing BP model was the inversion of the NH3-N (R 2 = 0.15) water parameter, while the best-performing model Based on the analysis result, it can be observed that NH 3 -N, TP, BGA, and Chl-a show a weaker correlation with the features.Eventually, the highest correlated spectral indices were selected as variables to establish the inversion model.

Results of Multivariate Regression Models
Table 5 shows the results of four multivariate regression models (RF, GB, BP, and CNN) using correlated spectral indices features in retrieving five water parameters: NH 3 -N, TP, COD Mn , Chl-a, and BGA.According to the results, the RF model performed the best out of all models, while the CNN model performed the worst.On the training dataset, the RF model achieved around 0.88-0.95R 2 for all five parameters inversion; however, the R 2 of the testing dataset was lowest for Chl-a (R 2 = 0.33) while highest for COD Mn (R 2 = 0.78) and moderate for NH 3 -N (R 2 = 0.51), TP (R 2 = 0.45), and BGA (R 2 = 0.43).On the training dataset, the GB model achieved around 0.65-0.95R 2 for all five parameters inversion; however, the R 2 of the testing dataset was lowest for Chl-a (R 2 = 0.32) and TP (R 2 = 0.32) while highest for COD Mn (R 2 = 0.74) and moderate for NH 3 -N (R 2 = 0.55) and BGA (R 2 = 0.45).In comparison, the BP model achieved around 0.25-0.65R 2 in the training dataset and 0.15-0.52R 2 in the testing dataset for all five parameters.The worstperforming BP model was the inversion of the NH 3 -N (R 2 = 0.15) water parameter, while the best-performing model was the inversion of BGA (R 2 = 0.52).CNN model, on the other hand, achieved around 0.20-0.67R 2 for the training dataset and 0.15-0.64R 2 for the testing dataset.The best-performing CNN model was for COD Mn (R 2 = 0.64).Overall, COD Mn has the best inversion result.
The best model for retrieving water parameter NH 3 -N is the GB model (R 2 = 0.55), whereas the best model for retrieving water parameter TP, COD Mn , and Chl-a is the RF model (R 2 = 0.45, R 2 = 0.78, and R 2 = 0.33); the best model for retrieving water parameter BGA is BP model (R 2 = 0.52).
Table 6 shows the results of four multivariate regression models (RF, GB, BP, and CNN) using correlated spectral indices features in retrieving five water parameters: Turbidity, pH, NC, DO, and temperature.According to the results, the RF model performed the best out of all models, while the CNN model performed the worst.On the training dataset, the RF model achieved around 0.90-0.96R 2 for all five parameters inversion; however, the R 2 of the testing dataset was lowest for Turbidity (R 2 = 0.34) while highest for pH (R 2 = 0.73), temperature (R 2 = 0.70), DO (R 2 = 0.67), and NC (R 2 = 0.64).On the training dataset, the GB model achieved around 0.77-0.90R 2 for all five parameters inversion; however, the R 2 of the testing dataset was lowest for Turbidity (R 2 = 0.30) while highest for temperature (R 2 = 0.75) and pH (R 2 = 0.67) and moderate for DO (R 2 = 0.62) and NC (R 2 = 0.59).In comparison, the BP model achieved around 0.36-0.68R 2 in the training dataset and 0.31-0.64R 2 in the testing dataset for all five parameters.The worst-performing BP model was the inversion of Turbidity (R 2 = 0.31), while the best-performing model was the inversion of temperature (R 2 = 0.64).The CNN model, on the other hand, achieved around 0.32-0.44R 2 for the training dataset and 0.35-0.40R 2 for the testing dataset.The best-performing CNN model was for NC (R 2 = 0.40).Overall, pH, NC, DO, and temperature have good inversion results.
The best model for retrieving water parameter Turbidity is the CNN model (R 2 = 0.34), whereas the best model for retrieving water parameter pH, NC, and DO is the RF model (R 2 = 0.72, R 2 = 0.64, and R 2 = 0.67); the best model for retrieving water parameter temperature is GB model (R 2 = 0.75).
Overall, the water parameters that achieved 0.6 R 2 or higher were COD Mn , temperature, pH, DO, and NC, with the R 2 of 0.77, 0.75, 0.73, 0.67, and 0.64.Turbidity and Chl-a have the lowest R 2 with only 0.34 and 0.33.

Discussion
Based on the results obtained from the previous chapter, this chapter discussed the findings of the Pearson correlation analysis, the machine learning model's performance compared with other studies, and the limitations of this study.

Correlated Features of Different Water Quality Parameters
The ten water quality parameters investigated in the study were NH 3 -N, TP, COD Mn , pH, BGA, Chl-a, EC, DO, temperature, and Turbidity.Based on previous studies, water quality parameters can be classified into two categories: optically active and optically inactive.Among the ten measured water parameters, optically active parameters include Chl-a, temperature, Turbidity, EC, and BGA, while optically inactive parameters include NH 3 -N, TP, DO, COD Mn , and pH [14,[42][43][44].
For optically active water parameters such as Chl-a, the Pearson correlation analysis revealed that Chl-a's most correlated spectral index is B2/B3, which is related to the green and red band, while BGA is most correlated with band ratios consisting of red, red edge, and NIR.Based on a prior study, the researcher used a similar band for global spatial regression modelling of Chl-a [45].It is mentioned by the researchers that in clear waters, blue and green spectral bands are commonly used for modelling because the phytoplankton controlled the properties in clear waters, whereas in turbid waters, the red and NIR spectral bands or the green-to-red band is used to avoid high absorption of non-algal particles.The lake chosen for the case study was the latter with turbid waters, so the results are consistent with previous findings.The most correlated spectral indicator for Turbidity is the red edge band, which contradicts findings using MODIS satellite that the red band is more sensitive to Turbidity [46].The most correlated spectral index is B2 − B3 for temperature and the red band for EC; there is no comparable study to compare the sensitive bands with.
Previous research has shown that optically sensitive parameters with significant optical properties allow for the identification of similar spectral bands [47], whereas for non-optical sensitive parameters, it is usually difficult to obtain accurate quantitative predictions of their concentrations and spatial distributions based on satellite remote sensing images and simple statistical analysis models.Hence, the correlated variables for non-optical sensitive parameters were inconsistent with the other finding [25,26].

Performance of ML Models in Water Quality Monitoring
The result of COD Mn , TP, NH 3 -N, Turbidity, and Chl-a can be used to compare with other studies [25,26,28].Two other studies employed the exact same multispectral UAV device as ours, but the flight altitude settings were substantially different, with one set at 150-160 m, one at 10 m, and ours at 500 m [26,28].At the same time, the other study employed a multirotor UAV with Rededge-MX multi-spectral camera flying at 160-165 m for image data collection [25].Table 7 displays the regression modelling results of several water parameters using different ML models.Our study has the best modelling result for COD Mn using the RF model with the R 2 of 0.778 with the RMSE of 0.304 mg/L.The best result for TP, NH 3 -N, Turbidity, and Chl-a was using the GA_XGBoost ML model [25].The author combined the characteristic of adaptive search from GA with the high efficiency and flexibility of XGBoost to obtain good modelling results.However, some of the remaining water parameters (temperature, pH, DO, NC, and BGA) obtained decent results (R 2 = 0.75, 0.73, 0.67, 0.64, and 0.52) but they are not comparable because UAV multispectral was not previously utilised to model those parameters.Although some of the water parameters are optically inactive, UAVs have the advantage of obtaining high-resolution data that can be used to improve the modelling of those parameters.This work validates the high accuracy of obtaining numerous optical and non-optical active parameters using ML algorithms; however, it does have certain limitations.Further research using various ML and Deep Learning models in conjunction with multispectral data is necessary.

Limitations
In this study, UAV is proven to be able to capture high temporal data with large spatial coverage, which is suitable for high-frequency data collection of medium-sized water bodies.Nevertheless, few relevant investigations have been undertaken, and related theories and approaches are still in their development.Accurate radiometric calibration for UAV multispectral images is still a difficult subject, especially when the survey area is large, resulting in varying imaging times and sun angle, making it difficult to capture the complex optical properties of the inland water bodies.Accurate calibration and processing of images are key to high-accuracy modelling results.Hence, more research is required to investigate the data processing of UAV multispectral photos captured over a long duration of time.Furthermore, the acquired water data contains outliers that must be eliminated in order for the trained model to generalise properly.This study employed the IF method to find outliers, but it suffered from unbalanced data and required a large amount of training data to perform well.As a result, more research is needed to determine the best outlier detection method for water quality inversion.

Conclusions
In this study, multispectral UAVs with high spatial and temporal characteristic is used to acquire spectral data for a medium-sized lake with a surface area of 13 km 2 .The multispectral data were collected and processed systematically, and different band equations were used to generate the spectral indices, with the optimal indices chosen for modelling based on Pearson correlation analysis.ML regression methods, including RF, GB, BP, and CNN, were used to construct separate water quality retrieval models for NH 3 -N, TP, COD Mn , pH, BGA, Chl-a, EC, DO, temperature, and Turbidity.Water parameters including R2, temperature, pH, DO, and NC (R 2 = 0.77, 0.75, 0.73, 0.67, and 0.64) all achieved satisfactory results, while NH 3 -N, BGA, TP, Turbidity, and Chl-a obtained poor results (R 2 = 0.55, 0.52, 0.45, 0.34, and 0.33).The feature variables derived from multispectral data demonstrate notable advantages in terms of water quality inversion for several water parameters and predicted water quality changes and spatial distributions more effectively and accurately, especially for water bodies at larger scales.Consequently, this study provides an efficient and practical way for monitoring optically active and inactive water parameters, and future research should strongly consider the adoption of multispectral UAVs to retrieve and monitor spatiotemporal changes in multiple water quality parameters of medium-sized water bodies.

Drones 2023, 7 ,
x FOR PEER REVIEW 5 o ensure low precipitation and wind speed throughout the day.Each collected image w have precise coordinates stored in the image metadata, utilising the onboard Real-Ti Kinematic (RTK) technology for further processing.DJI also provides extra informat such as flight yaw, pitch, and roll in the image metadata to simplify image processing.

Figure 2 .
Figure 2. Set of calibration plate images captured using DJI P4 Multispectral UAV: (a) RGB ima (b) Blue band image; (c) Green band image; (d) Red band image; (e) Red edge band image; (f) N band image.

Figure 2 .
Figure 2. Set of calibration plate images captured using DJI P4 Multispectral UAV: (a) RGB image; (b) Blue band image; (c) Green band image; (d) Red band image; (e) Red edge band image; (f) NIR band image.

Figure 3 .
Figure 3. Water quality sonde data collection route.

Figure 3 .
Figure 3. Water quality sonde data collection route.

Figure 3 .
Figure 3. Water quality sonde data collection route.

Figure 4
Figure4depicts the locations where the water sample was taken; 20 sampling points were evenly distributed across the lake to represent each subregion.The analysed water parameters are NH3-N, TP, and CODMn, which are essential for determining the standards of lake eutrophication and popular indicators for organic pollution.Two 2.5-L bottles of water are collected at a depth of 50 cm at each sampling location for spectrophotometric analysis to determine the exact water quality concentration.

Figure 10 .
Figure 10.Pearson Correlation of water parameters temperature, DO, and EC with 84 spectral indices.

Figure 10 .
Figure 10.Pearson Correlation of water parameters temperature, DO, and EC with 84 spectral indices.

Figure 10 .
Figure 10.Pearson Correlation of water parameters temperature, DO, and EC with 84 spectral indices.

Figure 11 .
Figure 11.Pearson Correlation of water parameters pH, Turbidity, BGA, and Chl-a with 84 spectral indices.

Figure 11 .
Figure 11.Pearson Correlation of water parameters pH, Turbidity, BGA, and Chl-a with 84 spectral indices.

Table 1
lists the central wavelength of each band.

Table 1
lists the central wavelength of each band.

Table 3 .
Statistical analysis of water samples measurements data of three days.N represents the number of sampling points.Units are mg/L.

Table 4 .
Statistical analysis of continuous water quality measurement data of three days.N represents the number of sampling points.

Table 5 .
Multivariate regression results between multispectral band-derived features and the corresponding water quality data of NH 3 -N, TP, COD, Chl-a and BGA.
* Highlighted in bold and underlined are the best model results on test dataset.

Table 6 .
Multivariate regression results between multispectral band-derived features and the corresponding water quality data of Turbidity, pH, NC, DO and temperature.

Table 6 .
Cont.Highlighted in bold and underlined are the best model results on test dataset. *

Table 7 .
Comparison of regression results with other studies.
* Highlighted in bold are the best model results.