Skip to content

๐Ÿค– ๋”ฅ๋Ÿฌ๋‹์„ ์ด์šฉํ•œ ์ผ์ƒ์ƒํ™œ ์†Œ๋ฆฌ ๋ถ„๋ฅ˜ ๋ฐ ์•Œ๋ฆผ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ : Soundee ML ๐Ÿค–

Notifications You must be signed in to change notification settings

CapstoneDesign2020/Soundee-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

52 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Soundee Machine Learning ๐Ÿค–

์†Œ๋ฆฌ๋ฅผ ๋ณด๋‹ค Soundee

์ฒญ๊ฐ ์žฅ์• ์ธ์„ ์œ„ํ•œ ๋”ฅ๋Ÿฌ๋‹์„ ์ด์šฉํ•œ ์ผ์ƒ์ƒํ™œ ์†Œ๋ฆฌ ๋ถ„๋ฅ˜ ๋ฐ ์•Œ๋ฆผ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

๐Ÿ’ป 2020 IT Media Engineering CapstoneDesign Project

๊ธฐํš์˜๋„

์‚ฌ๋ฌผ ์ธํ„ฐ๋„ท์ด ํ™œ์„ฑํ™”๋˜์–ด ์ƒํ™œ์— ๋งŽ์€ ๋ถ€๋ถ„๋“ค์ด ํŽธ๋ฆฌํ•ด์กŒ์ง€๋งŒ, ์ฒญ๊ฐ์žฅ์• ์ธ์€ ์ด ํŽธ๋ฆฌํ•จ์— ์†Œ์™ธ๋œ ๊ฒƒ์ด ํ˜„์‹ค์ด๋‹ค. ์†Œ๋ฆฌ๋ฅผ ๋“ฃ์ง€ ๋ชปํ•˜๋Š” ๋†์ธ๋“ค์€ ๋ƒ‰์žฅ๊ณ ๋ฅผ ์˜ค๋ž˜ ์—ด์–ด๋†จ์„ ์‹œ ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ๋ณด์Œ, ์žŠ์–ด๋ฒ„๋ฆฌ๊ณ  ๋„์ง€ ๋ชปํ•œ ๋“œ๋ผ์ด๊ธฐ, ๋ฌผ์†Œ๋ฆฌ ๋“ฑ์˜ ์†Œ๋ฆฌ๋ฅผ ์ธ์ง€ํ•˜์ง€ ๋ชปํ•œ๋‹ค. ๋†์ธ์—๊ฒŒ๋„ ์ด๋ฅผ ๊ฐ์ง€ํ•˜๊ณ  ์ธ์‹ํ•  ์ˆ˜ ์žˆ๋Š” ์‹œ์Šคํ…œ์ด ํ•„์š”ํ•˜๋‹ค.

์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋ณธ ํ”„๋กœ์ ํŠธ๋Š” ๊ฐ€์ •์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์†Œ๋ฆฌ๋ฅผ ์ธ์ง€ํ•˜์—ฌ ๋ถ„๋ฅ˜ํ•˜์—ฌ ํ˜„์žฌ ๋ฐœ์ƒํ•œ ์†Œ๋ฆฌ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์•Œ๋ ค์ฃผ๋ฉฐ ์†Œ๋ฆฌ ์ •๋ณด์— ๋Œ€ํ•œ ํ†ต๊ณ„ ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•˜๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๊ธฐํšํ•˜์˜€๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋†์ธ์ด ์ธ์ง€ํ•˜์ง€ ๋ชปํ•˜๋Š” ์œ„ํ—˜๊ณผ ๋‚ญ๋น„๋ฅผ ๋ฏธ๋ฆฌ ์˜ˆ๋ฐฉํ•˜์—ฌ, ๋†์ธ์—๊ฒŒ ์ข€ ๋” ์•ˆ์ „ํ•˜๊ณ  ํŽธ๋ฆฌํ•œ ์ƒํ™œ์„ ์ œ๊ณตํ•˜๊ณ ์ž ํ•œ๋‹ค.

์ž‘ํ’ˆ์†Œ๊ฐœ

๋ฌด์ง€ํ–ฅ์„ฑ ๋งˆ์ดํฌ๋ฅผ ํ†ตํ•ด ์ผ์ƒ ์†Œ๋ฆฌ๋ฅผ ๊ฐ์ง€ํ•œ๋‹ค. PC์— ์—ฐ๊ฒฐํ•œ ๋งˆ์ดํฌ๋กœ ์ˆ˜์ง‘ํ•œ ์Œํ–ฅ ๋ฐ์ดํ„ฐ๋ฅผ ์„œ๋ฒ„์— ์†ก์‹ ํ•˜๊ณ , ์„œ๋ฒ„๋Š” ์ˆ˜์‹ ํ•œ ์†Œ๋ฆฌ๋ฅผ ๋”ฅ๋Ÿฌ๋‹์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ์Œํ–ฅ ์˜ˆ์ธก ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ํ†ตํ•ด ์˜ˆ์ธก ๊ฒฐ๊ณผ๋ฅผ ์•ˆ๋“œ๋กœ์ด๋“œ ์š”์ฒญ์— ๋”ฐ๋ผ ๊ธฐ๊ธฐ์— ์†ก์‹ ํ•œ๋‹ค. ์•ˆ๋“œ๋กœ์ด๋“œ ๊ธฐ๊ธฐ๋Š” ์ˆ˜์‹ ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ํ‘ธ์‹œ์•Œ๋ฆผ๊ณผ ํ†ต๊ณ„ ๋“ฑ ๋‹ค์–‘ํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ์ œ๊ณตํ•˜์—ฌ ์ฒญ๊ฐ์žฅ์• ์ธ์„ ์œ„ํ•œ ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•œ๋‹ค.

๋ณธ ํ”„๋กœ์ ํŠธ๋กœ ์‚ฌํšŒ๊ฐ€ย ์ƒ๊ฐํ•ด๋ณด์ง€ย ๋ชปํ•œย ์ฒญ๊ฐ์žฅ์• ์ธ์˜ย ์ผ์ƒ์ƒํ™œ์˜ย ๋ถˆํŽธํ•จ์—ย ๋Œ€ํ•œย ๋ฌธ์ œ๋ฅผย ์ œ๊ธฐํ•˜์—ฌย ์ด์—ย ๋Œ€ํ•œย ๊ด€์‹ฌ๊ณผย ํ•ด๊ฒฐ๋ฐฉ์•ˆ์˜ย ๋งˆ๋ จ์„ย ๋„๋ชจํ•œ๋‹ค. ๋”๋ถˆ์–ดย ์•ž์œผ๋กœ์˜ย 4์ฐจย ์‚ฐ์—…ย ๊ธฐ์ˆ ์˜ย ๋ฐœ์ „์ดย ๋น„์žฅ์• ์ธ์˜ย ํŽธ๋ฆฌํ•จ๋ฟ๋งŒ์ดย ์•„๋‹Œ, ์žฅ์• ์ธ์˜ย ์ ‘๊ทผ์„ฑ์„ย ๊ณ ๋ คํ•ด์•ผํ•œ๋‹ค๋Š”ย ์‚ฌํšŒ์ ย ์ธ์‹์„ย ํ™•์‚ฐ์‹œํ‚ค๋Š”๋ฐ ๋„์›€์ด ๋  ๊ฒƒ์ด๋ผ ์˜ˆ์ƒํ•œ๋‹ค.

Architecture


ํ”„๋กœ์„ธ์Šค : ์ „์ฒ˜๋ฆฌ(Librosa) โ†’ feature ์ถ”์ถœ โ†’ 2D ์ด๋ฏธ์ง€ํ™” โ†’ CNN Resnet โ†’ endpoint ์ƒ์„ฑ

class ์ข…๋ฅ˜ :

  • 0 = baby (์•„๊ธฐ ์šธ์Œ ์†Œ๋ฆฌ)
  • 1 = siren (์‚ฌ์ด๋ Œ ์†Œ๋ฆฌ)
  • 2 = motor (๋“œ๋ผ์ด๊ธฐ, ์ฒญ์†Œ๊ธฐ ๋“ฑ ๋ชจํ„ฐ ์†Œ๋ฆฌ)
  • 3 = water (๋ฌผ ๋–จ์–ด์ง€๋Š” ์†Œ๋ฆฌ)

๋ฌด์ง€ํ–ฅ์„ฑ ๋งˆ์ดํฌ๋กœ ์ผ์ƒ ์†Œ๋ฆฌ ๊ฐ์ง€ ํ›„ ์Œํ–ฅ ๋ฐ์ดํ„ฐ์—์„œ Mel-Spectogram ํŠน์ง• ๋ฒกํ„ฐ๋ฅผ ์ถ”์ถœํ•˜์—ฌ Convolutional Neural Network (CNN) ๋ชจ๋ธ์˜ Resnet ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ง„ํ–‰ํ•œ๋‹ค. ์„œ๋ฒ„์—์„œ ์†Œ๋ฆฌ์— ๋Œ€ํ•œ ๋ถ„์„์„ ์ง„ํ–‰ํ•œ ํ›„ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ์•ˆ๋“œ๋กœ์ด๋“œ์—์„œ ์‹ค์‹œ๊ฐ„์œผ๋กœ 5 ์ดˆ๋งˆ๋‹ค ํ™•์ธํ•˜์—ฌ ์‚ฌ์šฉ์ž์—๊ฒŒ ์•Œ๋ฆผ ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•œ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋‚ญ๋น„๋ฅผ ์ค„์ด๊ณ  ์œ„ํ—˜์— ๋Œ€์ฒ˜ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค. ์ฒญ๊ฐ ์žฅ์• ์ธ์˜ ์†Œ๋ฆฌ์— ๋Œ€ํ•œ ์ ‘๊ทผ์„ฑ์„ ๋‹ค์–‘ํ•œ ์ธก๋ฉด์œผ๋กœ ๊ณ ๋ คํ•ด ์•ผ ํ•œ๋‹ค๋Š” ์‚ฌํšŒ์  ์ธ์‹์„ ํ™•์‚ฐ์‹œํ‚ค๊ณ ์ž ํ•œ๋‹ค.

์ „์ฒ˜๋ฆฌ

  • ์–ด๋Š ์ •๋„ ์ •์ œ ๋˜์–ด์žˆ๋Š” Kaggle ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ, ์Œํ–ฅ ๋ฐ์ดํ„ฐ ๊ธธ์ด๋ฅผ 5 ์ดˆ๋กœ ์ •ํ•˜๊ณ  ๊ทธ ์ด์ƒ์ด๋ฉด ์ž˜๋ผ์ฃผ๋Š” ๋ฐฉ์‹์œผ๋กœ ์ •๊ทœํ™” ์ง„ํ–‰

feature ์ถ”์ถœ ๋ฐ 2D ์ด๋ฏธ์ง€ํ™”

  • ์ฐธ๊ณ ํ•œ ๋…ผ๋ฌธ์— ๋”ฐ๋ผ 1 ๋‹จ๊ณ„๋กœ mel-spectrogram, 2 ๋‹จ๊ณ„ filter banks ๋กœ ํ•˜์—ฌ ํŠน์ง• ๋ฒกํ„ฐ๋ฅผ ์ถ”์ถœํ•จ

  • ๋…น์Œํ•œ 16kHz ์˜ ์ž…๋ ฅ ์˜ค๋””์˜ค ๋ฐ์ด ํ„ฐ๋ฅผ 40ms ์œˆ๋„์šฐ ๋‹จ์œ„๋กœ 0.01์ดˆ ๋งˆ๋‹ค frequency๋ฅผ ๋ฝ‘์€ melspectogram์„ ์ถ”์ถœํ•˜์˜€์œผ๋ฉฐ ์ด์— ๋Œ€ํ•˜์—ฌ mel๊ฐ’์„ ์–ป์–ด๋‚ด๊ธฐ ์œ„ํ•œ filter bank๋ฅผ ์ ์šฉํ•˜์—ฌ 2 ์ฐจ์› ์ž…๋ ฅ ์ด๋ฏธ์ง€ ๋ฐ์ดํ„ฐ๋ฅผ ๊ตฌ์„ฑ

  • ๋งŒ๋“ค์–ด์ง„ ์ด๋ฏธ์ง€

    water class

    data2-water-4062

CNN ๋ชจ๋ธ ํ•™์Šต

  • Resnet ๊ตฌ์กฐ 50๊ฐœ์˜ layer๋กœ ํ•™์Šต ์ง„ํ–‰
  • ํŒŒ๋ผ๋ฉ”ํ„ฐ ๊ตฌ์„ฑ์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค
    num_layers = 50
    image_shape = '3,256,256'
    num_training_samples = 7550
    num_classes = 4
    epochs = 20
    top_k = '2'
    train_instance_type='ml.p3.2xlarge'
    

About

๐Ÿค– ๋”ฅ๋Ÿฌ๋‹์„ ์ด์šฉํ•œ ์ผ์ƒ์ƒํ™œ ์†Œ๋ฆฌ ๋ถ„๋ฅ˜ ๋ฐ ์•Œ๋ฆผ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ : Soundee ML ๐Ÿค–

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published