{"id":13435967,"url":"https://github.com/lincolnhard/dog-bark-detector","last_synced_at":"2025-03-18T12:30:47.003Z","repository":{"id":61803209,"uuid":"149557486","full_name":"lincolnhard/dog-bark-detector","owner":"lincolnhard","description":"Detect dog bark from spectrogram classification using sndfile-tools and darknet","archived":false,"fork":false,"pushed_at":"2018-09-21T06:46:33.000Z","size":2171,"stargazers_count":28,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-03T10:56:48.824Z","etag":null,"topics":["aed","cnn","darknet","dog","spectrogram"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lincolnhard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-20T05:44:02.000Z","updated_at":"2024-09-21T17:57:59.000Z","dependencies_parsed_at":"2022-10-21T12:45:19.351Z","dependency_job_id":null,"html_url":"https://github.com/lincolnhard/dog-bark-detector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincolnhard%2Fdog-bark-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincolnhard%2Fdog-bark-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincolnhard%2Fdog-bark-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincolnhard%2Fdog-bark-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lincolnhard","download_url":"https://codeload.github.com/lincolnhard/dog-bark-detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244222116,"owners_count":20418450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aed","cnn","darknet","dog","spectrogram"],"created_at":"2024-07-31T03:00:41.419Z","updated_at":"2025-03-18T12:30:46.985Z","avatar_url":"https://github.com/lincolnhard.png","language":"C","funding_links":[],"categories":["Software"],"sub_categories":["Machine Learning"],"readme":"# dog-bark-detector\n\nDetect dog bark from CNN based spectrogram classification\n\n## Requirement\n\nDataset:  \n[Urbansound](https://urbansounddataset.weebly.com/urbansound.html) (training/testing set)  \n[ESC-50](https://github.com/karoldvl/ESC-50) (testing set)  \n[Freiburg 106](http://www.csc.kth.se/~jastork/pages/datasets.html) (training set, negative samples)    \n\n3rdparty libraries:  \n[libsndfile](http://www.mega-nerd.com/libsndfile/#Download)  \n[fftw3](http://www.fftw.org/download.html)  \n[opencv](https://github.com/opencv/opencv)  \n[darknet](https://github.com/pjreddie/darknet)  \n[portaudio](http://www.portaudio.com/download.html)\n\n\n\n## Preprocessing\n\n```\n# To slice audio files into 2 secs duration clips, and store them into new .wav files\n# Note that this will take up to 25 GB on your disk\n\npython preprocessing.py --urbansound_dir [folder UrbanSound] --esc50_dir [folder ESC-50] --kitchen106_dir [folder building_106_kitchen/building_106_kitchen]\n\n# Generate spectrograms\n# Edit makefile, specify your darknet header/lib location\n\nmake\n./create_spectrogram [folder UrbanSound] [folder ESC-50] [folder building_106_kitchen/building_106_kitchen]\n```\n\n\n## Training\n\nEdit [Your darknet folder]/examples/classifier.c\nIn function **void train_classifier(...)**, change **args.type** from **CLASSIFICATION_DATA** to **OLD_CLASSIFICATION_DATA**, and rebuild darknet, since we don't want darknet augments input data for us.\n\nEdit **cfg/dogbark.data**, specify your training and validation set list.\n```\n# Training\n./darknet classifier train cfg/dogbark.data cfg/dogbark.cfg\n# Testing\n./darknet classifier valid cfg/dogbark.data cfg/dogbark.test.cfg backup/dogbark.backup\n```\n#### Urbansound top-1 accuracy should be around 95%\n#### ESC-50 Top-1 accuracy should be around 80%\n\n\n## Visualize\nTest from file:\n```\n./classification_from_file [sound file] [win secs] [step secs] [export image height] [cfg file] [weights file]\n# For example:\n#./classification_from_file sound/dogtest.wav 2.8 0.1 200 cfg/dogbark.test.cfg weights/dogbark_32.weights\n```\nTest from microphone:\n```\n./classification_from_mic [win secs] [step secs] [export image height] [cfg file] [weights file]\n# For example:\n./classification_from_mic 2.5 0.02 200 cfg/dogbark.test.cfg weights/dogbark_32.weights\n```\n\n![peek 2018-09-21 14-14](https://user-images.githubusercontent.com/16308037/45864322-3c63d400-bdac-11e8-836b-f0ab147f532b.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flincolnhard%2Fdog-bark-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flincolnhard%2Fdog-bark-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flincolnhard%2Fdog-bark-detector/lists"}