Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
推しと始めるMIR
Search
てーとく
February 13, 2020
Programming
0
760
推しと始めるMIR
アイドルのファンになったことをきっかけに機械学習の分野の一つであるMIR(音楽情報検索)に入門したので、MIRについて紹介しつつ作ったものの話とかをゆるふわにしようと思います!
てーとく
February 13, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
Discord Bot with AI -for English learners-
xin9le
1
120
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
760
良いユニットテストを書こう
mototakatsu
4
1.6k
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
Haze - Real time background blurring
chrisbanes
1
500
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
快速入門可觀測性
blueswen
0
310
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
3
920
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
610
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
94
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Building Adaptive Systems
keathley
38
2.3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Navigating Team Friction
lara
183
15k
Optimizing for Happiness
mojombo
376
70k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Practical Orchestrator
shlominoach
186
10k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Transcript
ਪ͠ͱ࢝ΊΔMIR ͯʔͱ͘ (@tetoku_sakana) 2020-02-13 #stapy54
͜Μͳײ͡ͰਐΈ·͢ • ࣗݾհ • MIRͱ • MIRͷ࣮ྫհ • MIRͷ࢝Ίํ
୭ • ͯʔͱ͘ (@tetoku_sakana) • WebΤϯδχΞ • nao_y ͞Μͷ͓༠͍ͰࢀՃͤ͞ ͍ͯͨͩ͘͜ͱʹͳΓ·ͨ͠
None
ਪ͠ࣄ ᶃ • ΦαΧφϝʔλʔ • @osakanameter • ΦαΧφͷMVͷ࠶ੜճ ϑΥϩϫʔͷՄ ࢹԽ௨
• ެࣜϗʔϜϖʔδͷߋ৽ ใχϡʔεͷ৴
ਪ͠ࣄ ᶄ • ΦαΧφΞʔΧΠϒ • ΦαΧφʹ·ͭΘΔ ΠϯλϏϡʔهࣄͳ ͲΛ·ͱΊͨαʔϏ ε
ͦΜͳ͜ΜͳͰ MIRʹೖ͠·ͨ͠ʂ
MIR
None
None
MIR • Music Information Retrieval • ԻָใݕࡧԻָใॲཧͱ༁͞ΕΔ • ݕࡧ͋Μ·Γؔͳ͍ •
ػցֶश×Իָ • (ओʹඇੜܥͷ) Իָؔ࿈ͷ૯শ
MIRͷλεΫ (Ұྫ) • ԻָԻָใ (ௐςϯϙɺίʔυ) ͷݕ ग़ɾਪఆ • Իָͷࣗಈྨ (δϟϯϧงғؾͳͲ)
• ࣖίϐͷࣗಈԽ • ԻָͰԻָΛݕࡧ
MIRͷख๏ • Content-based • ԻָՎࢺͳͲɺָۂσʔλΛѻ͏ • Context-based • ΞʔςΟετͷհจͳͲɺָۂҎ֎ͷपล σʔλΛѻ͏
pythonͱMIR • librosa • madmom • essentia
import librosa >>> filepath = librosa.util.example_audio_file() >>> y, sr =
librosa.load(filepath, offset=30, duration=5) >>> librosa.feature.mfcc(y=y, sr=sr) # MFCCͷऔಘ array([[ -5.229e+02, -4.944e+02, ..., -5.229e+02, -5.229e+02], [ 7.105e-15, 3.787e+01, ..., -7.105e-15, -7.105e-15], ..., [ 1.066e-14, -7.500e+00, ..., 1.421e-14, 1.421e-14], [ 3.109e-14, -5.058e+00, ..., 2.931e-14, 2.931e-14]])
ΦαΧφͷۂ͍͠…
ΦαΧφͷதͰ Ұ൪ָ͍͠ۂʁ
ϚεϩοΫࢦ
None
• Elias Pampalk et al., Proceedings of the ACM Multimedia
2002 • ָۂྨࣅΛࣗݾ৫ԽϚοϓ(SOM)Λͬ ͯՄࢹԽ Content-based Organization and Visualization of Music Archives
Իڹ৺ཧֶΛߟྀͨ͠ɺௌײ্ͷloudnessͷม ԽΛಛྔͱͯ͠நग़͢Δ “Rhythm Patterns”ͱͯ͠ఏҊ͞ΕͯΔಛྔநग़ख๏
None
ϚεϩοΫࢦ͕ ࢉग़Ͱ͖ͦ͏ʂ
ॲཧ֓ཁ 1. STFTΛ͔͚ͯ(ରईͷ) εϖΫτϩάϥϜ Λऔಘ 2. (1) ΛϒϩοΫʹׂ͠(rolling window)ɺͦ ΕͧΕ࣌ؒ࣠ํʹSTFTΛ͔͚ͯέϓετϩ
άϥϜΛऔಘ 3. (2) ʹରͯ͠60ύʔηϯλΠϧΛٻΊΔ
None
None
def minmax(pattern): return (pattern - pattern.min()) / (pattern.max() - pattern.min())
# ࡶ def mathrock_index(pattern): pattern = pattern.sum(axis=0) pattern = minmax(pattern) * 100 pattern = np.diff(pattern) return np.percentile(pattern, q=90) def calc_lfp(filename): cent = CentSpectrum(win_length=2048, hop_length=512) D = librosa.amplitude_to_db(cent.proc(filename)) D_normalized = cent.normalize(D) lfp = LogarithmicFluctuationPattern(hop_length=256) return lfp.proc(D_normalized)
None
MIRͷ࢝Ίํ
MIRͷ࢝Ίํ • MIREXISMIRͷจ • ipynb • musicinformationretrieval.com • ΟʔϯՊେͷnbviewer
MIRͷ࢝Ίํ • SpotifyͷAPIΛ͏ • Audio Features for a Track •
Audio Analysis for a Track
{ "danceability": 0.735, "energy": 0.578, "key": 5, "loudness": -11.84, "mode":
0, "speechiness": 0.0461, "acousticness": 0.514, "instrumentalness": 0.0902, "liveness": 0.159, "valence": 0.624, "tempo": 98.002, "type": "audio_features", "id": "06AKEBrKUckW0KREUWRnvT", "uri": "spotify:track:06AKEBrKUckW0KREUWRnvT", "track_href": “https://api.spotify.com/v1/tracks/…", "analysis_url": “https://api.spotify.com/v1/audio-analysis/…”, "duration_ms": 255349, "time_signature": 4 }
None
·ͱΊ • ใগͳ͍͚ͲMIRͷෑډ͍ • ϥΠϒϥϦlibrosa͕͓͢͢Ί • SpotifyͷAPI͓͢͢Ί • ΦαΧφྑ͍
ਪ͠ۦಈ։ൃ Ұॹʹ࢝ΊͯΈ·͠ΐ͏ ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʙ