# Deep-Feature-Based Approach to Marine Debris Classification
## 3 Experiments
### Evaluation Metrics  
To evaluate the performance of marine debris classifiers, we use four quantitative metrics commonly used for multiclass classification problems: accuracy, precision, recall, and F1-score [67]. Suppose a given data set \(\mathcal{D}\) contains \(K>2\) different classes encoded with numbers \(1,2,\dots,K\). Let \(C_{i,j}\) denote the number samples classified as class \(j\), which actually belong to class \(i\). The \(K\times K\) matrix \(C=[C_{i,j}]\) is known as the **confusion matrix**. The overall **accuracy** of a model gives the proportion of correctly classified data points and it is calculated as  
\[Accuracy=\frac{\sum\limits_{i=1}^{K}C_{i,i}}{n}, \tag{3}\]  
where \(n\) denotes the cardinality of \(\mathcal{D}\). Since accuracy weighs more highly populated classes and thus strong errors on classes with just a few examples are hard to identify, we complement accuracy scores with precision, recall, and F1 metrics scores. We introduce the following notation:  
* \(TP^{\left(i\right)}\) (_True Positive_): number of correctly classified instances of class \(i\), i.e., \(C_{i,j}\);
* \(FP^{\left(i\right)}\) (_False Positive_): number of instances falsely classified as class \(i\), \(FP^{\left(i\right)}=\sum\limits_{ \begin{subarray}{c}j=1\\ j\
eq i\end{subarray} }^{K}C_{j,i}\); \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Layer** & **Kernel Size** & **Filters** & **Stride** & **Input Size** \\ \hline Conv & \(3\times 3\) & 64 & 1 & \((224,224,3)\) \\ Conv & \(3\times 3\) & 64 & 1 & \((224,224,64)\) \\ MaxPool & \(3\times 3\) & - & 2 & \((224,224,64)\) \\ Conv & \(3\times 3\) & 128 & 1 & \((111,111,64)\) \\ Conv & \(3\times 3\) & 128 & 1 & \((111,111,128)\) \\ MaxPool & \(3\times 3\) & - & 2 & \((111,111,128)\) \\ Conv & \(3\times 3\) & 512 & 1 & \((55,55,128)\) \\ GlobalAvgPool & - & - & - & \((55,55,512)\) \\ Softmax & - & - & - & \((1,512)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Simple neural network model architecture with \(\approx 855K\) trainable parameters. \(FN^{\,(i)}\) (_False Negative_): number of instances classified as \(j\
eq i\) actually belonging to class \(i\), \(FN^{\,(i)}=\sum\limits_{ \begin{subarray}{c}j=1\\ j\
eq i\end{subarray} }^{K}C_{i,j}\). Precision corresponding to the class \(i\) is calculated as  
\[Precision^{(i)}=\frac{TP^{\,(i)}}{TP^{\,(i)}+FP^{\,(i)}}, \tag{4}\]  
while corresponding recall is given by  
\[Recall^{(i)}=\frac{TP^{\,(i)}}{TP^{\,(i)}+FN^{\,(i)}}. \tag{5}\]  
Precision measures the ability of a model to return only relevant instances, while recall expresses the model's ability to find all relevant instances in a dataset. **F1-Score** of the \(i\)-th class combines corresponding precision and recall scores by calculating their harmonic mean resulting in  
\[F1\text{-}score^{(i)}=\frac{2 Precision^{(i)}Recall^{(i)}}{Precision^{(i)}+Recall ^{(i)}}. \tag{6}\]  
Obtained per class metrics are aggregated in overall _macro_ scores computed as simple arithmetic means in the following way  
\[Score^{(macro)}=\frac{1}{K}\sum\limits_{i=1}^{K}Score^{(i)}, \tag{7}\]  
where _Score_ is either _Precision_, _Recall_, or \(F1\)-_score_. Sometimes \(F1\text{-}score^{(macro)}\) is calculated as \(F1\text{-}score^{(macro)}=\frac{2 Precision^{(macro)}Recall^{(macro)}}{Precision^{(macro)}+Recall^{(macro)}}\)[67; 68]. However, we use \(F1\text{-}score^{(macro)}\) rather than \(F1\text{-}score^{(macro)2}\), since it is more robust toward the error type distribution [68] and it is also implemented in Python's sklearn library [61]. Macro scores do not take the class imbalance into account. Additionally, weighted scores are computed to address the uneven data distribution. Weighted scores find the average of class-wise scores weighted by the number of class instances as follows:  
\[Score^{(weighted)}=\frac{1}{n}\sum\limits_{i=1}^{K}n_{i}Score^{(i)}, \tag{8}\]  
where \(n_{i}\) denotes the support for class \(i\).