The Beautiful Future

QUARTZNET: DEEP AUTOMATIC SPEECH RECOGNITION WITH 1D TIME-CHANNEL SEPARABLE CONVOLUTIONS 본문

논문

QUARTZNET: DEEP AUTOMATIC SPEECH RECOGNITION WITH 1D TIME-CHANNEL SEPARABLE CONVOLUTIONS

Small Octopus 2022. 6. 21. 16:50

NVIDIA, ICSSP2020

엔드투엔드 neural acoustic model for ASR.
multiple blocks with residual connections. each blocks consist of modules with 1D time-channel separable convolutional layers. BN, RELU. CTC loss. near state-of-the-art accuracy on LibriSpeech and Wall Street Journal. light-weight model.
this model can be effectively fine-tuned on new datasets.

ASR model을 light-weight하게 만들어보자. 1D time-channel separable convolution을 사용. 
기존 100 밀리언 파람에서 20 밀리언으로 줄었다. NVIDIA NeMo toolkit에 프리트레인 웨이트와 소스코드 있다.

light-weight models, SqueezeNet, ShuffleNet, EfficientNet. 이 논문은 MobileNet과 Xception과 관련이 있다.
depthwise seperable convolution. depthwise convolution and pointwise convolution.
[12] Sequence-to-Sequence Speech Recognition with Time-Depth Separable Convolutions, Interspeech 2019.
는 비슷한 접근 방법을 사용했다. encoder-decoder 구조 이며 time-depth separable(TDS) convolution을 사용했다.
time-frequency-channels(T x w x c) format. T는 time-step, w는 input width, c는 channel 수 이다.
TDS는 2D convolution이고 kx1 커널 크기를 가지며 Txw 에 convolution된다.
그리고 2개의 pointwise convolution 이루어진 fully-connected block은 wc  채널에 연산된다.  채널은 interleaved with layer-norm layers.
대조적으로 본 논문에서는 time-channel 형식으로 만들어서 시간축과 채널축의 convolution을 나누었다.
TDS는 k x c^2 + 2 x (wc)^2, QuartzNet k x c + c^2 파라미터를 가진다.
[13] State-of-the-art speech recognition using multi-stream self-attention with dilated 1d convolutions. 2019.
는 다일레이트된 셀프어테션의 멀티플 패러럴 스트림을 사용했다.
페러럴 스트림은 여러 다일레이션 레이트로 여러개의 해상도의 스피치 프레임을 가져온다.
그리고 각 스트림은 컨케트네이션되서 최종 임베딩된다. 최고 모델은 5개의 스트림 다일레이션 레이트 1,2,3,4,5 일 때이다.

MODEL AECHITECTURE
Basic model
[14] Jasper:An end-to-end convolutional neural acoustic model. 2019.
Jasper 구조에 기반을 두어서 설계했다. 컨볼루션 모델이고 CTC로스로 학습됨.
 QuartzNet의 노벨리티는 1D convolution을 1D time-channel separable convolution으로 대체한것이다.
1D time-channel separable convolution은 K 크기 커널을 가진 1D depth-wise convolution과 pointwise convolution으로 나눠서 볼수있다.
1D depth-wise convolution은 각 채널에 독립적으로 적용되지만 K time frames 전체에 적용된다.(커널 크기 = 타임 프레임). 
pointwise convolution은 매 하나의 time frame에 적용되지만 모든 채널에 적용된다.
1D convolution layer C1에서 시작한다. C1은 stride 2를 가진다.
각 블록 Bi는 Si번 반복한다. 그리고 블록간에 residual connection을 가지고 있다.
하나의 블록 Bi는 기본 모듈이 Ri번 반복되어 구성된다.
기본 모듈은 K-size depthwise convolutional layer, pointwise convolution, normalization layer, RELU로 구성된다.
블록이 쌓이고 전체 모델의 마지막 부분에는 3개의 convolution layer C2, C3, C4 를 쌓는다.  C4는 dilation 2를 가진다.

depthwise convolution은 채널에 독립적으로 적용되기때문에 전체 연산량에서 적은량을 차지하기때문에 
wav2letter [16] Letter-based speech recognition with gated convnets. 2017.
또는 [14] Jasper 보다3배는 큰 커널을 사용할수 있었다.
4 종류의 노말라이제이션 방법으로 실험하였다.
batchnormalization[17] Batch normalization: Accelerating deep network training by reducing internal covariate shift. 2015.
layer normalization [18] Layer normalization. 2016.
instance normalization [19] Instancenormalization: The missing ingredient for fast stylization. 2016.
group normalization [20] Group normalization,” Lecture Notesin Computer Science, p. 319, 2018.
결론은 batchnormalization 이 가장 안정적인 안정적인 학습을 보였고 가장 좋은 WER을 보였다.
Pointwise convolution with groups

Experiments
LibriSpeech and WSJ dataset.
transfer leaning를 LibriSpeech와 Common Voice[21]를 이용해 학습 후 작은 데이터셋으로 학습했다.
[21]  “Common voice,” https://voice.mozilla.org/en, 2019.

training from scratch보다 좋은 성능을 얻기위해. 작은 데이터셋은 WSJ dataset이다.
LibriSpeech
QuartzNet-15x5모델이 최고 성능을 보였다.
따로 학습된 LanguageModel [22] Transformer-XL: Attentive language models beyond a fixed-length context. 2019.
을 묶어서했을때 SOTA와 대등한 WER을 얻었다.
[27] Fully convolutional speech recognition, arXiv:1812.06864, 2018.
[23] Specaugment: A simple data augmentation method for automatic speech recognition, arXiv:1904.08779, 2019.
[12] Sequence-to-Sequence Speech Recognition with Time-Depth Separable Convolutions, Interspeech 2019.
[13] State-of-the-art speech recognition using multi-stream self-attention with dilated 1d convolutions, 2019.
[14] Jasper: An end-to-end convolutional neural acoustic model. 2019.


일반 convolution을 사용하는 모델에 비하여 매우 작기때문에 과적합에 덜 취약하다. 그래서 데이터 오그멘테이션과 웨이트 디케이만 학습할때 해줬다. 
augmentation 실험을 했다.
SpecAugment[23]
[24] Audio augmentation for speech recognition Interspeech2015.(SpecCutout and speed perturbation)
Cutout [25] Improved regularization of convolutional neural networks with cutout, 2017.
10% speed perturbation과 Cutout을 사용했을때 최고의 성능을 얻었다.
Cutout은 랜덤하게 작은 사각형 영역을 스페트로그램에서 아웃시키는 방법이다.
[26]Stochastic gradient methods with layerwise adaptive moments for training of deep networks 2019.
[26]은 NovoGrad optimizer에 대한 논문이고 이 옵티마이져을 이용하여 학습했다.
cosine annealing learning rate policy를 사용했다. 그리고 learning rate warmup을 하는것이 학습 초반 안정화에 도움이 되었다.
15x5모델을 400 epoch학습하는데 8개 Tesla V100 GPU 에서 5일정도 걸린다. 배치크기는 GPU당 32개로 학습했다.
메모리사용량을 줄이기 위해 mixed-precision training을 사용했다. [28] Mixed precision training. 2017.
학습시간을 4시간으로 줄였다. SuperPod with 32 DGX2 nodes with larger of epochs and global batch 16K.
Wall Stree Journel
[2] The design for the wall street journal based csr corpus. ACL, 1992.
QuartzNet-5x3 을 WSJ에 학습했다. train-si284를 학습에 nov93-dev를 벨리데이션에 사용했다.
그리고 nov92-eval를 테스트에 사용했다. GPU당 배치크기 32에 1200에폭을 학습했다.
드랍아웃 0.2, NovoGrad optimizer B1 = 0.95, B2=0.5, 1000 스텝 웜업 레이트 0.05, 웨이트 디케이 0.001.
인퍼런스할때 4-gram(beam size=2048, alpha=3.5, beta=1.5)과 Transformer-XL를 이 두 LM 모델을 사용했다.
이 두 LM 모델은 WSJ의 공식 데이터만을 이용해서 학습했다.
아래의 3개 모델과 비교했다.
1) RNN-CTC [30] - CTC model with 5 bidirectional LSTM layers, 500 cells in each layer;
2) ResCNN-LAS [31]: Listen-Attend-Spell model with deepresidual convLSTM encoder and LSTM decoder + label
smoothing;
3) Wav2Letter++ [29] - CTC model with 1D convolutional layers and instance norm.
[30] Towards end-to-end speech recognition with recurrent neural networks. ICML 2014.
[31] Towards better decoding and language model integration in sequence to sequence models. 2016.
[29] End-to-end speech recognition from the raw waveform. 2018.

Transfer Learning
QuartzNet 15x5 모델을 LibriSpeech와 Mozillar's Common Voice dataset에 학습 후 8시간 WSJ에 파인튜닝.

CONCLUSIONS AND FUTURE DIRECTIONS
new model with 1D time-channel separable convolutional layers.
Connectionist Temporal Classification에 기반한 모델이었지만 attention-based decoder와 묶어서 연구할 것이다.

 

코드 분석
인풋 프로세싱
오디오 윈도우를 20ms로 사용, 호프 길이를 10ms로 사용
실제로는 sampling rate 16000에 16000*0.02, 16000*0.01이 곱해져서
320, 160 크기로 사용됨, 총 PCM / 160 개의 time step이 생김.
STFT의 주파수가 512이기 때문에 반인 256개의 주파수를 추출
mel의 개수는 64개 결론적으로 64 x PCM / 160의 특징이 추출됨.
컨볼루션을 위새 PCM / 160을 16의 배수로 맞춰줌.

1D time-channel separable convolution 동작하는 메커니즘
입력은 batch x mel x 1 x time_step으로 들어감. 여기서 mel은 64로 고정되고 배치크기도 고정
1 x 64 x 1 x time_step 으로 고쳐쓸수 있음( batch :1 )

point-wise convolution 되어서 256으로 늘어남.
1 x 256 x 1 x time_step


 

 

 

Comments