Abstract
Code-switching, also called code-mixing, is the linguistics phenomenon where in casual settings, multilingual speakers mix words from different languages in one utterance. Due to its spontaneous nature, code-switching is extremely low-resource, which makes it a challenging problem for language and speech processing tasks. In such contexts, Code-Switching Language Identification (CSLID) becomes a difficult but necessary task if we want to maximally leverage existing monolingual tools for other tasks. In this work, we propose two novel approaches toward improving language identification accuracy on an English-Mandarin child-directed speech dataset. Our methods include a stacked Residual CNN+GRU model and a multitask pre-training approach to use Automatic Speech Recognition (ASR) as an auxiliary task for CSLID. Due to the low-resource nature of code-switching, we also employ careful silver data creation using monolingual corpora in both languages and up-sampling as data augmentation. We focus on English-Mandarin code-switched data, but our method works on any language pair. Our best model achieves a balanced accuracy of 0.781 on a real English-Mandarin code-switching child-directed speech corpus and outperforms the previous baseline by 55.3%.
Introduction
In multilingual communities, speakers often engage in code-switching (or code-mixing), spontaneously swapping between languages within a single conversation or even a single sentence. While humans navigate this linguistic fluidity with ease, it presents a significant hurdle for modern speech processing systems. Most state-of-the-art tools are optimized for "clean" monolingual data; consequently, when they encounter utterances that blend languages—such as starting in English and concluding in Mandarin—performance typically degrades.
The core challenge addressed in this research is Code-Switching Language Identification (CSLID). This task involves identifying the specific language being spoken in every segment of an utterance. CSLID is a critical precursor to downstream tasks like Automatic Speech Recognition (ASR), as it allows for the routing of audio segments to appropriate monolingual models. This is particularly difficult in low-resource scenarios, such as child-directed speech in Singapore, where data is scarce and dialectal variations are common.
Methodology
The researchers proposed two primary architectural strategies to tackle the CSLID problem:
- Residual CRNN: This "stacked" model utilizes a Residual Convolutional Neural Network (CNN) to extract robust features from audio spectrograms, followed by a Bidirectional Gated Recurrent Unit (bi-GRU) to capture the temporal dependencies of the speech signal.
- Multitask Learning (MTL): This approach employs a Conformer encoder with dual "heads." One head is dedicated to ASR as an auxiliary task, while the other performs Language Identification. The underlying hypothesis is that learning to recognize the phonetic content (what is being said) provides the model with richer representations to determine the language (which language is being used).
Gradual Fine-Tuning (GFT)
To overcome the scarcity of authentic code-switched data, the authors generated "silver data" by mixing monolingual English and Mandarin recordings. They implemented a Gradual Fine-Tuning schedule, initially training on large, out-of-domain datasets and progressively shifting the data ratio toward the target "in-domain" child-directed speech.
Datasets
The study leveraged a diverse set of monolingual and code-switched corpora:
- Monolingual: LibriSpeech (US English), AISHELL (Mandarin), and the National Speech Corpus (Singaporean English).
- Code-Switched: SEAME (English-Mandarin conversational speech).
- Target Domain: MERLIon, a specialized dataset of English-Mandarin child-directed speech from Singapore. This dataset is notably imbalanced, featuring a roughly 4:1 ratio of English to Mandarin segments.
Results and Discussion
The experimental results yielded several key insights:
- Performance Breakthrough: The best-performing model—the Residual CRNN combined with Gradual Fine-Tuning—achieved a Balanced Accuracy (BAC) of 0.781 on the MERLIon test set. This represents a substantial 55.3% improvement over the challenge baseline (BAC 0.503).
- Specialization vs. Scale: Surprisingly, massive foundation models like OpenAI’s Whisper (BAC 0.649) and Meta’s XLSR (BAC 0.099) struggled with the CSLID task in this specific context. The researchers' smaller, specialized CRNN model significantly outperformed these billion-parameter models, demonstrating that parameter-efficient, task-specific architectures can be superior for niche, low-resource tasks.
- Data Balance is Crucial: A critical finding was that maintaining a balanced dataset (equal parts English and Mandarin) during the pre-training phase was more vital for final performance than having data that perfectly matched the target domain's characteristics.
- ASR as a Teacher: The MTL approach confirmed that using ASR as an auxiliary task forces the model to extract higher-level linguistic features, enhancing robustness against noise and domain shifts.
Conclusion and Future Work
This work demonstrates that effective CSLID can be achieved through clever architectural design and strategic data management, even in low-resource settings. While the current system shows remarkable improvements, the authors identified several areas for future exploration. These include addressing compute constraints to allow for larger batch sizes, expanding the scope to include other prevalent languages in the Singaporean context (like Malay or Tamil), and investigating up-sampling techniques for minority classes. The team also plans to explore fine-tuning larger Pre-trained Language Models (PLMs) to determine if they can eventually surpass the performance of specialized architectures.
Summary updated