A robust audio-visual speech recognition system designed for multi-speaker environments and noisy cocktail party scenarios. The model combines lip reading and audio processing to achieve superior performance in challenging acoustic conditions with background noise and speaker interference.
The evaluation script script/evaluation.py provides comprehensive evaluation capabilities for the AVSR Cocktail model on multiple datasets with various noise conditions and interference scenarios.
Quick Start
Basic evaluation on LRS2 test set:
python script/evaluation.py --model_type avsr_cocktail --dataset_name lrs2 --set_id test
Encoder: Pre-trained AV-HuBERT large model (nguyenvulebinh/avhubert_encoder_large_noise_pt_noise_ft_433h)
Decoder: Transformer decoder with CTC/Attention joint training
Tokenization: SentencePiece unigram tokenizer with 5000 vocabulary units
Input: Video frames are cropped to the mouth region of interest using a 96 × 96 bounding box, while the audio is sampled at a 16 kHz rate
Training Data
The model is trained on multiple large-scale datasets that have been preprocessed and are ready for the training pipeline. All datasets are hosted on Hugging Face at nguyenvulebinh/AVYT and include:
Preprocessed: All audio-visual data is pre-processed and ready for direct input to the training pipeline
Multi-modal: Each sample contains synchronized audio and video (mouth crop) data
Labeled: Text transcriptions for supervised learning
The training pipeline automatically handles dataset loading and loads data in streaming mode. However, to make training faster and more stable, it's recommended to download all datasets before running the training pipeline. The storage needed to save all datasets is approximately 1.46 TB.
Training Process
The training script is available at script/train.py.
Multi-GPU Distributed Training:
sh
1# Set environment variables for distributed training
2export NCCL_DEBUG=WARN
3export OMP_NUM_THREADS=1
4export CUDA_VISIBLE_DEVICES=0,1,2,3
56# Run with torchrun for multi-GPU training (using default parameters)
7torchrun --nproc_per_node 4 script/train.py
89# Run with custom parameters
10torchrun --nproc_per_node 4 script/train.py \
11 --streaming_dataset \
12 --batch_size 6 \
13 --max_steps 400000 \
14 --gradient_accumulation_steps 2 \
15 --save_steps 2000 \
16 --eval_steps 2000 \
17 --learning_rate 1e-4 \
18 --warmup_steps 4000 \
19 --checkpoint_name avsr_avhubert_ctcattn \
20 --model_name_or_path ./model-bin/avsr_cocktail \
21 --output_dir ./model-bin
Model Output:
The trained model will be saved by default in model-bin/{checkpoint_name}/ (default: model-bin/avsr_avhubert_ctcattn/).
Configuration Options
You can customize training parameters using command line arguments:
Dataset Options:
--streaming_dataset: Use streaming mode for datasets (default: False)
Training Parameters:
--batch_size: Batch size per device (default: 6)
--max_steps: Total training steps (default: 400000)