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
790
推しと始めるMIR
アイドルのファンになったことをきっかけに機械学習の分野の一つであるMIR(音楽情報検索)に入門したので、MIRについて紹介しつつ作ったものの話とかをゆるふわにしようと思います!
てーとく
February 13, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
オープンソースソフトウェアへの解像度🔬
utam0k
13
2.6k
明日から始めるリファクタリング
ryounasso
0
140
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
1
430
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.9k
私はどうやって技術力を上げたのか
yusukebe
43
18k
ALL CODE BASE ARE BELONG TO STUDY
uzulla
2
240
Catch Up: Go Style Guide Update
andpad
0
220
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
Software Architecture
hschwentner
6
2.3k
[Kaigi on Rais 2025] 全問正解率3%: RubyKaigiで出題したやりがちな危険コード5選
power3812
0
110
Go Conference 2025: Goで体感するMultipath TCP ― Go 1.24 時代の MPTCP Listener を理解する
takehaya
9
1.7k
Your Perfect Project Setup for Angular @BASTA! 2025 in Mainz
manfredsteyer
PRO
0
170
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.8k
Navigating Team Friction
lara
190
15k
How to train your dragon (web standard)
notwaldorf
96
6.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
54
3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Side Projects
sachag
455
43k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
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͓͢͢Ί • ΦαΧφྑ͍
ਪ͠ۦಈ։ൃ Ұॹʹ࢝ΊͯΈ·͠ΐ͏ ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʙ