# Confidence Learning for Semi-Supervised Acoustic Event Detection
## 2 Proposed System
### C-Saed  
#### 2.2.1 Stage One: Multi-Task SAED Model (MT-SAED)  
To get reliable confidence, we added a branch to train confidence in MT-SAED, as illustrated in Figure 1. When solving the issue of simultaneously generating AED predictions and their corresponding confidence without the confidence label, we draw on the successful experience in the field of out-of-distribution detection [24]. The motivation is equivalent to a special test that permits giving hints. Candidates are allowed to ask for hints according to their confidence of the questions. Furthermore, a certain penalty is carried out in order to prevent candidates from tending to ask for hints for all questions. To obtain the highest score, candidates must improve their ability to answer questions and self-assess at the same time. MT-SAED is constructed based on the baseline model. There are four outputs in the baseline model, the frame-level output \(y_{ft}\) and clip-level output \(y_{ct}\) of the teacher model, and the frame-level output \(y_{fs}\) and clip-level output \(y_{cs}\) of the student model. For each clip, frame-level outputs \(y_{ft}\) and \(y_{fs}\) are T \(\times\) C vectors containing probabilities for each frame, and clip-level outputs \(y_{ct}\) and \(y_{cs}\) are 1 \(\times\) C vectors only containing probabilities for the clip, where T,C are the number of frames and types. A power pooling [25] is adopted between frame-level outputs and clip-level outputs. To make the model self-assessment, we add a confidence branch in parallel with the original class prediction branch. The confidence branch, which shares the same structure with the frame-level classification branch, applies a fully-connected layer followed by sigmoid. The confidence branch generates corresponding confidence values \(c\) for the classification results of each sound event at every frame. Output \(c\) takes values between 0 and 1. If the model is  
Figure 1: The top of the figure shows that a sound event system with an extra confidence branch. The sound event model receives the input spectrogram and outputs frame-level prediction probabilities and the corresponding frame-level confidence values. The bottom of the figure illustrates the process of the generation of new probabilities with output probabilities, targets, and confidence value. confident about the classification, output \(c\) will be closer to 1. Conversely, if the model is uncertain about the correctness of classification predictions, the value of \(c\) will be closer to 0. A crucial issue of confidence is how to achieve the training of two tasks with just the classification labels. Following the main idea of giving hints, we construct a new frame-level output of student model \(y^{\prime}_{fs}\) with the label \(t_{f}\) and two outputs \(y_{fs}\) and \(c\):  
\[y^{\prime}_{fs}=(1-c)\times t_{f}+c\times y_{fs}. \tag{1}\]  
The outputs of the student model \(y^{\prime}_{fs}\) and \(y_{cs}\) are in comparison with strong labels \(t_{f}\) and \(t_{c}\) utilizing the binary cross entropy (BCE) loss, as illustrated in Figure 2. The classification loss can be written as  
\[ \begin{split} L_{class}&=L_{class},+L_{class_{c}}\\ &=L_{BCE}(y^{\prime}_{fs},t_{f})+L_{BCE}(y_{cs},t_{c}).\end{split}  \tag{2}\]  
Outputs \(y_{fs}\) and \(y_{cs}\) are compared with the outputs \(y_{ft}\) and \(y_{ct}\) by applying the mean square error (MSE) loss. The consistency loss is  
\[L_{con}=L_{MSE}(y_{ft},y_{fs})+L_{MSE}(y_{ct},y_{cs}). \tag{3}\]  
Training with \(L_{class}\) and \(L_{con}\) loss functions, the network will be lazy at learning the differences between classes. Instead, the model tends to make \(c\) approach 0 and  
Figure 2: Framework C-SAED: Stage one introduces a muti-task system that can generate frame-level classification predictions and corresponding confidence estimates. The pseudo-labels and confidence for weakly labeled data and unlabeled data are produced and applied in stage two. The power pooling function is adopted in the first stage.