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
750
推しと始めるMIR
アイドルのファンになったことをきっかけに機械学習の分野の一つであるMIR(音楽情報検索)に入門したので、MIRについて紹介しつつ作ったものの話とかをゆるふわにしようと思います!
てーとく
February 13, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
[KR] Server Driven Compose With Firebase
skydoves
1
110
実践Dash - 手を抜きながら本気で作るデータApplicationの基本と応用 / Dash for Python and Baseball
shinyorke
2
220
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
3
150
AWS認定資格を受験するにあたり、気づいたこと・実践していたことのまとめ
satoshi256kbyte
1
120
Removing Corepack
yosuke_furukawa
PRO
9
1.1k
Go製CLIツールGatling Commanderによる負荷試験実施の自動化
okmtz
3
650
Flutterアプリを生成AIで生成する勘所
rizumita
0
240
RemixとCloudflare Stack におけるFile Upload
ossamoon
1
120
VS Code extension: ドラッグ&ドロップでファイルを並び替える
ttrace
0
150
ポケモンで考えるコミュニケーション / Communication Lessons from Pokémon
mackey0225
4
140
M5Stackボードの選び方
tanakamasayuki
0
200
pytest プラグインを開発して DRY に自動テストを書こう
inuatsu
2
240
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
42
6.5k
Being A Developer After 40
akosma
84
590k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
38
2.1k
Agile that works and the tools we love
rasmusluckow
327
21k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Adopting Sorbet at Scale
ufuk
73
8.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
31
2.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
We Have a Design System, Now What?
morganepeng
49
7.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
23
1.7k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
37
6.8k
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͓͢͢Ί • ΦαΧφྑ͍
ਪ͠ۦಈ։ൃ Ұॹʹ࢝ΊͯΈ·͠ΐ͏ ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʙ