# Novel Approach in Vegetation Detection Using Multi-Scale Convolutional Neural Network
## 2 Materials and Methods
### Evaluation Metrics  
The evaluation metrics used to assess the performance of semantic segmentation models include global accuracy, mean accuracy, mean intersection over union (IoU), weighted IoU, and mean boundary F1 score (BF score). Global accuracy measures the overall proportion of correctly classified pixels across all classes in the dataset, providing a straightforward assessment of model performance.  
The global accuracy is given by  
\[Global\ Accuracy=\frac{Number\ of\ Correct\ Predictions}{Total\ Number\ of\ Predictions} \tag{6}\]  
In contrast, mean accuracy calculates the average accuracy for each individual class, offering insight into how well the model performs across different categories, which is particularly useful in cases of class imbalance. The mean accuracy can be expressed as  
\[Mean\ Accuracy=\frac{1}{C}\sum_{i=1}^{C}\frac{TP_{i}}{TP_{i}+FP_{i}} \tag{7}\]  
where \(C\) is the number of classes, \(TP_{i}\) is the true positives for class \(i\), \(FP_{i}\) is the false positives for class \(i\), and \(FN_{i}\) is the false negatives for class \(i\).  
The mean IoU metric quantifies the overlap between predicted and ground truth regions for each class, averaging the IoU scores to provide a comprehensive measure of segmentation accuracy.  
\[Mean\ IoU=\frac{1}{C}\sum_{i=1}^{C}\frac{TP_{i}}{TP_{i}+FP_{i}+FN_{i}} \tag{8}\]Weighted IoU takes this a step further by assigning different weights to classes based on their prevalence in the dataset, mitigating the impact of smaller classes on overall performance metrics.  
\[Weighted\ IoU=\sum_{i=1}^{C}w_{i}\cdot\frac{TP_{i}}{TP_{i}+FP_{i}+FN_{i}} \tag{9}\]  
where \(w_{i}\) is the weight assigned to class \(i\), which is determined by the number of pixels in that class. This weighting scheme is designed to address class imbalance issues common in semantic segmentation tasks. Classes with fewer pixels are given higher weights to ensure they contribute meaningfully to the overall IoU score, preventing the metric from being dominated by classes with a large number of pixels. Thus, the weight \(w_{i}\) for class \(i\) is calculated as  
\[w_{i}=\frac{1}{log(r+p_{i})} \tag{10}\]  
where \(r\) is a small constant (typically set to 1.02) to avoid division by zero, and \(p_{i}\) is the proportion of pixels belonging to class \(i\) in the dataset. This weighting scheme assigns higher weights to less frequent classes, helping to balance their contribution to the overall segmentation performance evaluation.  
Finally, the mean BF score evaluates how well the predicted boundaries align with the true boundaries of each class, correlating more closely with human qualitative assessments than traditional IoU metrics. The Mean BF Score can be expressed as  
\[Mean\ BF Score=\frac{(1+\beta^{2})\cdot(Precision\cdot Recall)}{\beta^{2}\cdot Precision +Recall} \tag{11}\]  
where \(\beta>0\) determines the weight given to recall relative to precision.  
Together, these metrics provide a robust framework for evaluating and comparing the effectiveness of segmentation models in various contexts.