# Weakly Supervised U-Net with Limited Upsampling for Sound Event Detection
## 4 Experiments
### Performance Evaluation Metrics
(FP), and false negative (FN) [38], as shown in Table 7. From the sample counts in the TP, TN, FP, and FN bins, we can compute 3 different performance indexes as follows:  
\[precision = \frac{TP}{TP+FP} \tag{8}\] \[recall = \frac{TP}{TP+FN} \tag{9}\]  
where _precision_ is the ratio of correctly indicated samples to all _true_ predicted outputs and _recall_ is the ratio of correct samples to all _true_ ground truth labels. If _precision_ is higher, the output indicates that _true_ is more reliable. If _recall_ is higher, the samples with _true_ ground truth labels are less likely misclassified. Both _precision_ and _recall_ can be related to the accuracy of the predicted outputs, but in somewhat different manners. To obtain a balanced metric, the F1 score is computed by the harmonic mean of _precision_ and _recall_[38]:  
\[F1 = \frac{2}{\frac{1}{precision}+\frac{1}{recall}}=\frac{2 precision\cdot recall }{precision+recall} \tag{10}\]  
The performance metrics, precision, recall, and F1 scores are computed differently for audio tagging and sound event detection. In audio tagging tasks, the event is active, meaning that the corresponding event is present in the input recording. There is no consideration where the event starts or ends. Therefore, the label is _\"true\"_ if the generated sample of 10 s has the event. There are 41 audio event categories and 41 binary classifiers for those categories, and the individual performance metrics are computed by the following equation:  
\[precision_{AT}(c) = \frac{TP_{AT}(c)}{TP_{AT}(c)+FP_{AT}(c)} \tag{11}\] \[recall_{AT}(c) = \frac{TP_{AT}(c)}{TP_{AT}(c)+FN_{AT}(c)}\] (12) \[F1_{AT}(c) = \frac{2 precision_{AT}\cdot recall_{AT}}{precision_{AT}+recall_{AT}} \tag{13}\]  
where \(c\) is the class index and \(TP_{AT}(c),FP_{AT}(c),FN_{AT}(c)\) are computed using the ground truth audio tagging labels and the predicted labels by classifier \(c\). The computation is sample-based, for example  
\[TP_{AT}(c) = \sum_{k=1}^{K(c)}I(GT(c,k)=prediction(c,k)=true) \tag{14}\] \[FP_{AT}(c) = \sum_{k=1}^{K(c)}I(GT(c,k)=false\text{ and }prediction(c,k)=true)\] (15) Table 7.0  
where \(k\) is the generated sample index, \(GT(c,k)\) and \(prediction(c,k)\) are the true and predicted label for class \(c\) and sample \(k\), and \(I(\cdot)\) is an indicator function returning 1 if the given logical expression is true and 0 if false. \(K(c)\) is the number of audio samples for class \(k\), which is different for different classes ranging from 94 to 300, as shown in Section 4.1. The precision, recall, and F1 scores of 41 event classes were averaged to obtain a single, mean performance metric:Table 7.1 Table 7.2 (18) Table 7.3  
where \(m{{{\it{Pr}}}_{{\it{CT}}}}/m{{{\it{Rcl}}}_{{\it{AT}}}}/m{{{\it{F1}}}_{{\it{AT}}}}\) stand for \"mean precision/recall/F1 of multiple event tagging\", respectively. To compute the SED performance metrics, we adopted segment-based evaluation metrics [1]. The \(TP\), \(FP\), and \(FN\) of the SED outputs using segment-based evaluation are computed by:  
Table 7.4 Table 7.5 (21) Table 7.6  
where \(n\) is the analysis frame index, \(N(k)\) is the number of frames for generated sample \(k\), and \(GT(c,k,n)\) and \({{\it{prediction}}}(c,k,n)\) are the true and predicted label for class \(c\), sample \(k\), and frame \(n\). The segmented-based performance metrics for SED, \(m{{{\it{Pr}}}_{{\it{SED}}}}\), \(m{{{\it{Rcl}}}_{{\it{SED}}}}\), and \(m{{{\it{FI1}}}_{{\it{SED}}}}\), are obtained by substituting \({{\it{TP}}_{{\it{AT}}}}(c)\), \({{\it{FP}}_{{\it{AT}}}}(c)\), and \({{\it{FN}}_{{\it{AT}}}}(c)\) by \({{\it{TP}}_{{\it{SED}}}}(c)\), \({{\it{FP}}_{{\it{SED}}}}(c)\), and \({{\it{FN}}_{{\it{SED}}}}(c)\) in Equations (11)-(13) and (17)-(19).