TL;DR
This paper introduces Context-Aware Selective Label Smoothing (CASLS), a novel method to address the over-confidence problem in sequence recognition models (like speech and text). CASLS leverages contextual dependencies within sequences to selectively smooth predictions, leading to more reliable confidence scores and improved accuracy.
What Problem Does This Paper Address?
Deep neural networks (DNNs) excel at sequence recognition tasks such as scene text recognition and speech recognition. However, they often suffer from "over-confidence," meaning they assign high probabilities even to incorrect predictions. This is largely due to the standard cross-entropy loss function, which can lead to overfitting. While confidence calibration methods exist, most are designed for non-sequential data. Applying them directly to sequences is problematic because it ignores the crucial contextual dependencies between elements in a sequence. Existing sequence-specific methods also have limitations, such as not fully exploiting contextual information or overlooking class-specific prediction distributions. This paper aims to bridge this gap by proposing a calibration method that specifically accounts for sequential context and class-wise error patterns.
Methods
The core of the proposed solution is the Context-Aware Selective Label Smoothing (CASLS) method. It builds upon two key ideas:
- Selective Label Smoothing (SLS): Standard label smoothing (LS) applies a uniform smoothing factor to all classes. SLS, however, recognizes that some classes are inherently more prone to misprediction than others. It uses a confusion matrix derived from a support dataset to identify "error-prone" classes. Only these error-prone classes have their predictions smoothed, with the smoothing strength adaptively adjusted based on their error rates.
- Context-Aware Selective Label Smoothing (CASLS): This is an extension of SLS that further incorporates the contextual dependency within sequences. It constructs "context confusion matrices" that capture how predictions for a token are affected by the previous token. This allows for even more nuanced calibration, as the smoothing strategy is tailored not just to the class itself but also to its preceding context.
Additionally, the paper introduces a Sequence Alignment Strategy to handle misalignments (omissions or redundancies) between predicted and ground truth sequences, which can complicate confusion matrix construction. A "blank" class is used to facilitate alignment. Finally, an Adaptive Smoothing Strength mechanism adjusts the smoothing parameter based on the sequence length to mitigate the cumulative effect of smoothing.
Datasets
The proposed methods were evaluated on the following datasets:
- Scene Text Recognition (STR):
- Regular datasets: IIIT5K-Words, Street View Text (SVT), ICDAR 2003 (IC03), ICDAR 2013 (IC13)
- Irregular datasets: ICDAR 2015 (IC15), SVT-Perspective (SVTP), CUTE80 (CUTE)
- Support dataset: An ensemble of training datasets from IIIT5k, SVT, IC03, IC13, and IC15, used for deriving confusion matrices.
- Speech Recognition (SR):
- AISHELL-1 corpus: A Mandarin speech dataset containing approximately 170 hours of data.
- Support dataset: The validation set of AISHELL-1, used for obtaining prediction distributions.
Key Insights and Ideas
- Sequences are not just collections of independent tokens: The paper strongly emphasizes that the contextual relationships between tokens in a sequence are critical for accurate and reliable predictions, and thus for effective calibration.
- Not all errors are equal: Different classes have different error probabilities. Applying a uniform calibration strategy (like standard LS) is suboptimal; adaptive strategies that focus on error-prone classes are more effective.
- Context matters for errors: The likelihood of mispredicting a token is not only dependent on the token itself but also on what came before it. CASLS leverages this by analyzing context-specific error patterns.
- Calibration can improve accuracy: While calibration primarily aims to make confidence scores more reliable, the paper shows that their proposed methods can also lead to improvements in recognition accuracy.
Key Results
The CASLS method demonstrated state-of-the-art performance on both scene text recognition and speech recognition tasks.
- Scene Text Recognition:
- CASLS significantly reduced the Expected Calibration Error (ECE) and Brier Score (BS) compared to uncalibrated models, standard Label Smoothing (LS), and Temperature Scaling (TS). For instance, on the ASTER model, CASLS achieved an ECE of 1.17% compared to 3.10% for the uncalibrated model and 19.07% for LS.
- CASLS also showed improvements in accuracy, with about a 1.3% increase observed on the TVBA model.
- Speech Recognition:
- On the WeNet model, CASLS reduced ECE by 53% and BS by 17% compared to the uncalibrated model.
- On the ESPNet model, CASLS achieved a 55% reduction in ECE and a 19% reduction in BS.
- While Temperature Scaling (TS) sometimes achieved lower ECE/BS, CASLS provided the second-best calibration performance while also improving accuracy and Word Error Rate (WER).
Limitations and Future Work
- Limitations:
- The paper notes that while TS can achieve good calibration, it doesn't influence accuracy. In contrast, their proposed methods can improve accuracy.
- For speech recognition, the large number of classes (phonemes) made direct confusion matrix computation challenging, requiring a reduction in the number of classes considered.
- Future Work:
- The authors plan to further validate their method on more sequential recognition tasks.
- They intend to explore more advanced strategies for utilizing contextual information.
Summary updated