{"id":19082992,"url":"https://github.com/cbhihe/classify_sound_mobile","last_synced_at":"2026-05-16T00:07:49.625Z","repository":{"id":41423767,"uuid":"266607162","full_name":"Cbhihe/classify_sound_mobile","owner":"Cbhihe","description":"Deep NN transfer learning applied to classify sound on the fly from your mobile phone. ","archived":false,"fork":false,"pushed_at":"2020-05-24T19:16:52.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T06:25:02.372Z","etag":null,"topics":["javascript","mobile-app","neural-network","sound-classification","tensorflow","transfer-learning"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cbhihe.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-24T19:07:11.000Z","updated_at":"2022-10-19T17:44:08.000Z","dependencies_parsed_at":"2022-09-21T08:23:10.431Z","dependency_job_id":null,"html_url":"https://github.com/Cbhihe/classify_sound_mobile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cbhihe/classify_sound_mobile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cbhihe%2Fclassify_sound_mobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cbhihe%2Fclassify_sound_mobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cbhihe%2Fclassify_sound_mobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cbhihe%2Fclassify_sound_mobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cbhihe","download_url":"https://codeload.github.com/Cbhihe/classify_sound_mobile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cbhihe%2Fclassify_sound_mobile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283956244,"owners_count":26922671,"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","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","mobile-app","neural-network","sound-classification","tensorflow","transfer-learning"],"created_at":"2024-11-09T02:45:31.088Z","updated_at":"2025-11-12T00:31:17.352Z","avatar_url":"https://github.com/Cbhihe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# classify_sound_mobile\n\n## Build a custom audio classifier to be trained using TensorFlow.js.\n\nSource:\nhttps://codelabs.developers.google.com/codelabs/tensorflowjs-audio-codelab/index.html#0\n\nAll that follows can be done either on a laptop or on a smartphone and was\nadapted from Google codelab.\n\nWe use transfer learning to make a model that classifies short sounds\nwith relatively little training data. The pre-trained model for speech cmd\nrecognition is based on the TensorFlow Speech Commands Dataset. For more\ninformation about it and the underlying Deep NN model, visit:\n    https://www.tensorflow.org/tutorials/sequences/audio_recognition\nWe train a new model on top of the pretrained model to recognize your own\ncustom sound classes.  We test the transferred model\nby making sounds and using it to control a slider in the browser.\n\nThe Speech Command Recognizer is a JavaScript module that enables recognition\nof spoken commands comprised of simple isolated English words from a small\nvocabulary. The default vocabulary includes the following words:\n digits from \"zero\" to \"nine\",\n \"up\", \"down\",\n \"left\", \"right\",\n \"go\", \"stop\",\n \"yes\", \"no\",\nas well as the additional categories of \"unknown word\" and \"background noise\".\nIt uses the web browser's WebAudio API. It is built on top of TensorFlow.js\nand can perform inference and transfer learning entirely in the browser,\noptionally using WebGL GPU acceleration.\n\nFirst, load and run a pre-trained model that can recognize 20 speech\ncommands. Then using the microphone, build and train a simple neural\nnetwork that recognizes your sounds and makes the slider go left or right.\n\n## Objective\n - load a pre-trained speech command recognition model\n - make real-time predictions using the microphone\n - train and use a custom audio recognition model using the\n   browser microphone\n\n## To know more\n - about the 'Speech Command Recognizer', visit:\n   https://github.com/tensorflow/tfjs-models/tree/master/speech-commands\n - about the theory,  read the article by P. Warden (2018): \"Speech commands: A\n   dataset for limited-vocabulary speech recognition\"s, located at:\n        https://arxiv.org/pdf/1804.03209.pdf\n - consider watching a video (as a refresher) by 3blue1brown ats:\n        https://www.youtube.com/watch?v=aircAruvnKk\n   or this other video on Deep Learning in Javascript by Ashi Krishnan, at:\n        https://www.youtube.com/watch?v=SV-cgdobtTA\n\n## Trials:\nTo run the webpage, simply open 'index.html' in a web browser. If you use\nthe cloud console, simply refresh the preview page. If you work from a\nlocal file, to access the microphone you will have to start a web server\nand use http://localhost:port/.\nTo start a simple webserver on port 8000, issue the following cmd in terminal:\n   \u003e /usr/bin/python3 -m SimpleHTTPServer\n\nDownloading the model may take a few seconds.\nAs soon as the model loads, you should see a word at the top of the page.\nThe model was trained to recognize the numbers 0 through 9 and a few additional\ncommands such as \"left\", \"right\", \"yes\", \"no\", etc.\nSpeak one of those words. Does it get your word correctly? Play with the\n'probabilityThreshold' which controls how often the model fires -- 0.75 means\nthat the model will fire when it is more than 75% confident that it hears a\ngiven word.\n\nTo collect examples for each command, make a consistent sound repeatedly (or\ncontinuously) while pressing and holding each button for 3-4 seconds. You\nshould collect ~150 examples for each label. For example, snap your fingers\nfor \"Left\", whistle for \"Right\", and alternate between silence and talk for\n\"Noise\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbhihe%2Fclassify_sound_mobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbhihe%2Fclassify_sound_mobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbhihe%2Fclassify_sound_mobile/lists"}