# Multi-Scale Features for Transformer Model to Improve the Performance of Sound Event Detection
## 4 Experimental Results
### Experimental Results  
To evaluate the proposed multi-scale Transformer model, we constructed two Transformer models: the basic Transformer model and the mean-teacher Transformer model, as shown in Figures 2 and 3, respectively. The basic Transformer model in Figure 2 was trained with only weakly labeled and strongly labeled data. The mean-teacher model in Figure 3 was trained using the entire training data, including the unlabeled data. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Basic Transformer Model** & **Mean-Teacher Model** \\ \hline \multirow{2}{*}{\# Training samples} & 3623 & 18,035 (\# weak = 1578, \\  & (\# weak = 1578, \# strong = 2045) & \# strong = 2045, \# unlabeled = 14,412) \\ \hline \multirow{2}{*}{Batch size} & 128 (weak = 64, strong = 64) & 128 (weak = 32, strong = 32, unlabeled = 64) \\ \hline \multirow{2}{*}{Batch iteration steps} & 3100 & 30,000 \\ \hline \multirow{2}{*}{Optimizer} & Adam (lr = 0.001, betas = 0.9, 0.98) & \\ \hline \multirow{2}{*}{
\begin{tabular}{c} Learning \\ Rate Scheduling \\ \end{tabular} } & StepLR & StepLR \\  & (step size = 1033, gamma = 0.1) & (step size = 10,000, gamma = 0.1) \\ \hline \multirow{2}{*}{Ramp-up Length} & - & 10,000 \\ \hline \multirow{2}{*}{Early-stopping Patience} & \multicolumn{2}{c}{10 Epochs} \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Network training configurations. First, we experimented with the basic Transformer model to investigate the effect of multi-scale features. In Table 3, we show the event-based SED results on the validation data with and without the multi-scale features (multi-scale Transformer vs. baseline Transformer). The results are shown with and without the application of post-processing. For post-processing, we applied median filtering to smooth the network output posterior that had been binarized with a constant threshold (0.5). The length of the median filter varied depending on the sound classes, which was found to improve the performance of the SED compared with a fixed-length filter [26]. To ensure the reliability of the test results, the F-scores and error rates (ERs) in the table were obtained by averaging the results after the experiments (training/testing) were performed 10 times in each condition. We varied the number of encoder blocks (NEB) in the Transformer model from 1 to 3 to investigate its effect on the performance. From the results in Table 3, we can see that the multi-scale Transformer generally outperforms the baseline Transformer irrespective of whether post-processing is applied, although the overall performance is much better when post-processing is applied. As the NEB varies, the performance of the baseline Transformer fluctuates significantly compared to the multi-scale Transformer, which shows stable F-scores across varying NEBs. This means that we can improve the robustness of the Transformer model using multi-scale features, which leads to performance improvement. The average F-score of the baseline Transformer over different NEBs without post-processing is 26.51% while the multi-scale Transformer achieves 27.79% leading to a 4.8% relative improvement in the F-score. Although the baseline Transformer attains a better F-score than the multi-scale Transformer when NEB = 2, the average F-score is worse because the performance is significantly degraded when NEB = 1 and 2. We observed similar results when using post-processing. We saw that the performance improvement is not sufficiently large in the ER. Table 4 shows the event-based SED results on the evaluation data of the basic Transformer model with and without the multi-scale features (multi-scale Transformer vs. baseline Transformer). We observed similar trends as those in Table 3. The average F-score of the baseline Transformer without post-processing was 31.29%, while that of the multi-scale Transformer was 34.26%, leading to a 9.49% relative improvement, which was larger than that on the validation data. We saw that the effect of multi-scale features manifested more when post-processing was not applied.