## 3 Results
### Model Performance Evaluation
#### 3.2.2 Performance Results
Sensitivity (true positive rate) and specificity (true negative rate) are critical metrics for evaluating model performance, particularly in the context of pollution detection. Sensitivity measures the model's ability to correctly identify positive instances, while specificity gauges its ability to correctly identify negative instances. By analyzing the confusion matrices, we can identify areas where sensitivity and specificity need improvement. For instance, if sensitivity is high and specificity is lower, this indicates a need to reduce false positives. The confusion matrices for SVM, k-NN, and Random Forest are presented in Table 2. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Class**} & **True Negative** & **False** & **False Negative** & **True Positive** \\  & & **(TN)** & **Positive (FP)** & **(FN)** & **(TP)** \\ \hline SVM & Oil spill & 7 & 5 & 58 & 280 \\  & Wastewater & 1 & 8 & 33 & 308 \\  & Debris & 1 & 4 & 13 & 332 \\ \hline k-NN & Oil spill & 15 & 5 & 80 & 250 \\  & Wastewater & 7 & 2 & 58 & 283 \\  & Debris & 4 & 5 & 68 & 273 \\ \hline RF & Oil spill & 1 & 2 & 47 & 300 \\  & Wastewater & 2 & 3 & 40 & 305 \\  & Debris & 1 & 1 & 14 & 334 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Confusion matrices for SVM, k-NN, and Random Forest. In the context of oil spill detection, the SVM model demonstrates high accuracy, particularly for true positives. However, it is not without flaws, showcasing instances of misclassification involving both false positives and false negatives. For wastewater and debris, the model exhibits commendable performance, with a strong emphasis on true positives and minimal false positives in the case of debris. The k-NN model, while slightly trailing behind SVM in terms of oil spill detection accuracy, maintains a balanced performance with a mix of true positives and false positives. In wastewater detection, it demonstrates good overall performance, and in debris identification, it mirrors the performance of SVM, exhibiting high values for true positives and low values for false positives. The Random Forest model emerges as a standout performer, showcasing high accuracy and robust performance across all metrics for oil spill detection. Its consistency in delivering good performance, especially for true positives, and outstanding accuracy with minimal misclassifications in debris identification positions it as a formidable choice. In an overarching evaluation, the Random Forest model consistently outperforms both SVM and k-NN across all pollution classes. Its strength lies in its ability to excel in correctly identifying pollution instances (high true positive rate) while simultaneously minimizing false identifications (low false positive rate). To calculate sensitivity and specificity from the confusion matrix, we used the following formulas:  
\[\text{Sensitivity (True Positive Rate)}=\text{TP}/(\text{TP}+\text{FN}) \tag{1}\]  
\[\text{Specificity (True Negative Rate)}=\text{TN}/(\text{TN}+\text{FP}) \tag{2}\]  
Based on the confusion matrix from Table 2, the sensitivity and specificity for each model was calculated (Table 3), and it can be observed that SVM is best used for wastewater and debris detection; k-NN manages debris detection well, but less than SVM, while RF is good for oil spill detection. For all three models, SVM, k-NN, and RF, the sensitivity values ranged from approximately 0.801 to 0.962 across different pollution classes. This suggests that the models perform well in correctly identifying instances of pollution when they are present. The specificity values vary across models and pollution classes, ranging from approximately 0.111 to 0.444. Lower specificity values show that the models may exhibit a higher rate of false positives, incorrectly identifying non-polluted areas as polluted. Balancing sensitivity and specificity is crucial in pollution detection.