앞서, librosa, pyaudio 라이브러리를 활용하여 마이크로부터 audio를 실시간으로 추출, time/frequency domain에서 audio를 분석하는 방법에 대해 살펴보았다. 사물놀이 악기들의 소리를 주파수 Spectrum, Mel Spectrum 등에서 분석해보았으나 각각의 악기들이 가지고 있는 고유한 주파수의 영역이 넓어 분류하기가 어려웠다. 대안으로 사물놀이 공연 전체의 beat/tempo 또는 pitch에 매칭하는 방법을 생각해보았다.

 

이러한 관점에서 Google의 tensorflow model hub를 살펴보던 중 SPICE(Self-Supervised Pitch Estimation)이라는 모델을 찾았다. SPICE는 monophonic audio의 fundamental frequency를 추정하는 모델, pitch 추정 모델,이다. SPICE는 annotated data가 없을 때 pitch 추정 모델을 훈련하는 방식을 제안하였으며, 사람이 일반적으로 absolute pitch보다 relative pitch를 훨씬 쉽게 추정할 수 있다는 observation에서 영감을 받았다고 한다. (그래서 모델 구조 또한 그 영감을 반영하고 있다.) Deep learning 기반의 Pitch Estimation(예. CREPE) 알고리즘과 다른 점은 Annotated data가 없을 때, 즉 unlabeled data를 다루기 위하여 self-supervised learning 기법을 사용한 점이다.

* Self-supervised learning 기법에 대한 설명은 아래 참조를 확인

 

SPICE의 간략한 모델 architecture는 아래 그림과 같다. 모델의 Input은 Constant Q Transform으로 변환한 CQT 프레임이다. SPICE의 저자는 Constant Q Transform(CQT)이 다음과 같은 장점이 있다고 하였다.

Indeed, the CQT filter bank computes a wavelet transform [16], and wavelets can be effectively used to represent the class of locally periodic signals. 

앞서 말한 바와 같이 저자가 받은 영감을 모델에 그대로 반영하고 있다.

먼저, 2개의 CQT 프레임(pitch가 shifted된 frame과 아닌 frame)이 shared weighted를 갖는 2개의 Encoder에 input으로 넣어진다. Loss는 Encoder의 출력 간 차이가 상대적인 pitch 차이에 비례하도록 설계됐다. 즉, self-supervised learning에서 Pretext task(논문에서는 auxiliary task로 표현)에 해당하는게 바로 이 pitch difference를 추정하는 것이다.

Downstream task는 input 프레임에서 절대 pitch 값을 추정하는 pitch estimation이라고 할 수 있다. 더 상세한 내용은 저자의 논문을 읽어보기를..

Gfeller, Beat, et al. "SPICE: Self-supervised pitch estimation." IEEE/ACM Transactions on Audio, Speech, and Language Processing 28 (2020): 1118-1128.

 

Simplified SPICE Model Architecture

구글에서는 SPICE를 Freddie METER에 실제로 사용 중에 있다고 한다.

https://freddiemeter.withyoutube.com/

 

 

Constant-Q Transform 참조

출처 : http://marte.dongguk.edu/files/research_444455285-Spectrum%20Analysis_Constant%20Q%20filter%20(5).pdf 

 

 

 

Self-Supervised Learning 참조

self-supervised learning이란 Labeling 작업에 들어가는 노력 및 비용을 해결할 수 있는 방법 중 하나.

Unlabeled dataset을 input으로 받아 사용자가 정의한 문제(pretext task)를 network가 학습하게 하여 데이터 자체에 대한 이해도를 높이고, pretext task에서 나온 pre-training된 network를 궁극적으로 사용자가 풀고자 하는 문제인 downstream task에 transfer learning 하는 방법

출처 : http://dmqm.korea.ac.kr/activity/seminar/284

Self-Supervised learning - 그림 또한 위 글에서 발췌함

 

- Reference

https://blog.tensorflow.org/2020/06/estimating-pitch-with-spice-and-tensorflow-hub.html

https://ai.googleblog.com/2019/11/spice-self-supervised-pitch-estimation.html

 

http://dmqm.korea.ac.kr/activity/seminar/284

https://greeksharifa.github.io/self-supervised%20learning/2020/11/01/Self-Supervised-Learning/

https://hoya012.github.io/blog/Self-Supervised-Learning-Overview/

https://github.com/jason718/awesome-self-supervised-learning

 

'Research > Projects' 카테고리의 다른 글

30주년 연구 중간점검과 간단한 뒤풀이  (0) 2021.08.27
pyaudio  (0) 2021.06.21

+ Recent posts