Hysteresis on the Loss: Rejecting Corrupted Label Segments in Sound Event Detection

Sound event detection means marking when each sound (a dog bark, running water, speech) starts and stops in a recording. Systems for this task are usually trained on labels that are wrong in characteristic ways. Some labels come from clip-level tags that give no timing. Others are frame-by-frame "pseudo-labels" produced by an earlier, weaker model. The per-frame classification losses used for this training are unforgiving: at every frame they push the network toward whatever label it is given, including labels that are wrong. We propose to find the wrong parts of the labels while training runs, and to stop learning from them.

The central choice is what counts as a "sample." Filtering methods that drop high-loss samples treat each training example as independent. In audio, though, label errors arrive as contiguous stretches: a boundary placed 300 ms too late, a spurious event, a missed one. We therefore track each frame's loss across training epochs and then run a hysteresis rule along the time axis over those persistent losses. A stretch of frames is down-weighted only if it contains at least one strongly suspicious frame, and the rejection extends outward while neighbouring frames stay moderately suspicious. The rule adapts to event length, so, unlike a fixed smoothing window, it has no built-in minimum duration. It should reject long mislabeled segments while leaving short, correctly labeled transients alone. Those short transients are exactly what current pipelines destroy.

Core Claim

Loss-based filtering for dense temporal labels should work on segments, not frames or whole clips. The best evidence that a segment is mislabeled is a loss that stays high across epochs and is spatially coherent in time. If that is true, three things should follow. First, applying hysteresis to epoch-accumulated frame losses should find corrupted label segments with higher precision than per-frame loss thresholds or fixed-window smoothing of losses. Second, down-weighting those segments during the pseudo-label training pass should improve event-based F1 on short classes without hurting long ones. Third, training-time rejection should beat simply cleaning the pseudo-labels before training.

Why This Gap Exists

Three strands of work motivate the proposal, and each stops short of it.

The failure itself is documented in weakly supervised sound event detection. The DCASE 2018 baseline, Large-scale weakly labeled semi-supervised sound event detection in domestic environments, trains a second pass on frame targets that assume a tagged event spans the whole clip, then median-filters the outputs. It reaches 0.0% event F1 on Cat, Dog and Speech. Towards Duration Robust Weakly Supervised Sound Event Detection shows that median filters erase events shorter than half the window. It replaces them at inference with double thresholding, a hysteresis rule with $\phi_{hi}=0.75$ and $\phi_{low}=0.2$, together with better pooling. We reuse its hysteresis idea but apply it to losses during training rather than to posteriors at test time. Its training loss is still computed against every target.

Loss filtering supplies the second strand. Dynamic Loss Decay based Robust Oriented Object Detection on Remote Sensing Images with Noisy Labels detects when a network shifts from learning general patterns to memorizing noise, using the second derivative of the training accuracy curve. After that point it exponentially down-weights high-loss instances. It works per bounding box in static images and has no notion of time. We borrow its trigger point and its soft decay, and replace its independent instances with temporal segments. The "action score" idea of summing loss over epochs, cited in the file's overview, separates noise that persists from examples that are merely difficult for a while. We use it as the per-frame suspicion statistic.

Constraints come from the third strand. Semi-supervised GMM and DNN acoustic model training with multi-system combination and confidence re-calibration finds a U-shaped utility curve. Keeping only the most confident data is uninformative, and the middle deciles help most. For our design this means aggressive rejection is dangerous. The rule must be conservative, soft, and applied only after the memorization point.

The closest discriminative-sequence work handles label noise differently. Bypass Temporal Classification adds a wildcard token to an alignment graph, which requires discrete tokens. Lead2Gold marginalizes over clean transcripts with an expensive beam search. Learning under Temporal Label Noise corrects losses through a time-varying noise matrix $Q(t)$ that is shared across the whole dataset, and it classifies whole windows. None of these rejects dense, recording-specific label segments.

Method

Let $\ell_{n,c,t}^{(e)}$ be the binary cross-entropy for clip $n$, class $c$, frame $t$ at epoch $e$. We keep an exponential moving average of this loss across epochs:

$$a_{n,c,t} \leftarrow \rho\, a_{n,c,t} + (1-\rho)\,\ell_{n,c,t}^{(e)},$$

where $\rho$ controls how much epoch history counts. We normalize $a$ within each class to percentiles, so a single threshold setting transfers across classes with very different base rates.

Along the time axis we then apply hysteresis. A segment is marked suspect if it contains a frame above the high percentile $h$. It extends in both directions while frames stay above the low percentile $l$. Frames inside suspect segments receive weight $w=\alpha^{k}$, where $k$ counts the epochs since the early-learning endpoint (detected as in Dynamic Loss Decay) and $\alpha<1$. All other frames keep weight 1. Before that endpoint, no frame is down-weighted.

The design has three parts. Epoch persistence separates noise from frames that are hard only for a while. Time hysteresis matches the contiguous shape of real labeling errors. The delayed soft decay reflects the U-shaped utility finding. The mechanism costs one stored array of frame losses per clip and a linear scan per epoch, far cheaper than Lead2Gold's beam search.

Research Program

The work has three stages.

The first stage is diagnostic. On data where label errors are known, we measure how well each suspicion rule recovers the corrupted frames. We then check whether the recovered frames are biased against short events.

The second stage is applied. We insert the rule into the pseudo-label training pass of standard semi-supervised detection pipelines and measure event-based F1 overall and by duration.

The third stage is analysis. We examine when rejection helps, how it interacts with inference-time double thresholding, and whether the early-learning trigger point is detected reliably on audio loss curves. That trigger was only validated on image detection.

Baselines

The naive reference point is the two-pass DCASE 2018 baseline from Large-scale weakly labeled semi-supervised sound event detection, which reports 14.06% event-based macro F1 (7.51% with labeled data only). We rerun it with double-threshold inference, so that gains cannot come from post-processing alone.

The strongest existing system on DCASE 2018 Task 4 in the file is the best fusion model of Towards Duration Robust Weakly Supervised Sound Event Detection. It reports 32.52% event-based macro F1, and its single $L^p$-pooling model reports a 4.02% duration gap between long and short events. It is the strongest competitor because it already fixes duration bias through pooling and hysteresis at inference, so it isolates whatever training-time rejection adds.

For DESED, the reference is the DCASE 2020 baseline at 37.8% event F1. We also note the separation-augmented system of Improving Sound Event Detection in Domestic Environments using Sound Separation, which reports 40.7% F1 and PSDS (polyphonic sound detection score) 0.570. That system is complementary rather than a competitor.

All methods share the same backbone, pooling, unlabeled data, epoch count and inference post-processing. Each receives the same hyperparameter search budget of twenty trials, tuned on the development set. Results are averaged over five seeds.

Beating the strongest baseline means two things. Event F1 must rise above our reproduction of the duration-robust single model by more than the seed standard deviation. The short-class F1 (Cat, Dog, Speech, Dishes) must not fall.

Ablations isolate the key ingredient. We compare per-frame thresholding with no time hysteresis, a fixed-window median over losses, a single-epoch snapshot instead of epoch persistence, hard masking instead of decay, and decay applied from the first epoch.

Why not just…?

Why not just smooth the outputs at test time? Post-hoc median filtering is the source of the 0.0% short-event results in the DCASE 2018 baseline. Double thresholding already fixes inference in the duration-robust work. Every one of our runs uses that same inference. Any gain we report therefore comes from what the network learned, not from post-processing.

Why not just train on clip labels with a good pooling layer and skip frame targets altogether? This is a real threat. Linear-softmax and $L^p$ pooling let the network choose its own active frames, and the duration-robust results show this is effective. If a single-pass pooling model matches our two-pass system, frame-level rejection is only a patch on a pass that should be removed. We run exactly this comparison. The proposal holds only if gated pseudo-label training beats the best pooling-only model under matched compute.

Why not just clean the pseudo-labels with double thresholding before the second pass? This is the most direct simple rival. It smooths the targets once, using the teacher's view, instead of rejecting segments using the student's persistent loss. We include it as a baseline. Our method should win because teacher errors that look confident are invisible to target smoothing, while the student's loss reveals them over epochs. If target cleaning performs equally well, we will report the simpler method as the answer.

Why not just drop the highest-loss frames, or model a noise matrix? Per-frame loss thresholds are the obvious form of the small-loss trick. Our synthetic study tests the specific risk that they reject correct short transients. A shared $Q(t)$, as in Learning under Temporal Label Noise, assumes all recordings follow the same noise schedule over time. SED boundary errors are specific to each recording, so we expect a shared schedule to fit them poorly. We test a class-wise forward-corrected loss as an additional baseline.

Proposed Experiments

The first experiment is controlled. We take DESED's synthetic, strongly labeled clips and corrupt the labels in three ways: onset and offset shifts of 100–500 ms, spurious events inserted into 10–40% of clips, and events deleted. We then score each suspicion rule by precision and recall on the corrupted frames, reported separately for events shorter and longer than 500 ms. The decisive check is that time hysteresis on persistent losses beats both per-frame thresholding and the fixed-window loss median on short-event precision. We expect the median to show the same duration bias measured for posteriors.

The second experiment uses real noise. We run the full semi-supervised pipeline on DCASE 2018 Task 4 and on DESED, reporting event-based macro F1 with the 200 ms collar, per-class F1, the duration gap, and PSDS on DESED. The decisive checks are three: F1 above the reproduced duration-robust single model, a smaller duration gap, and a clear win over pre-cleaned pseudo-labels.

The final check is whether the early-learning trigger transfers to audio. We plot rejection precision against the epoch at which decay starts. If the second-derivative trigger is off by more than a few epochs from the empirical optimum, we will replace it with a held-out criterion and report that change.