{"id":19346654,"url":"https://github.com/tomfran/urban-sound-classification","last_synced_at":"2025-07-16T14:33:53.111Z","repository":{"id":46055165,"uuid":"380474275","full_name":"tomfran/urban-sound-classification","owner":"tomfran","description":"UrbanSound8K dataset classification using MLP and CNN","archived":false,"fork":false,"pushed_at":"2021-11-17T10:16:21.000Z","size":8507,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T05:39:47.218Z","etag":null,"topics":["audio-classification","cnn","keras","machine-learning","neural-network","python","tensorflow","urbansound8k"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomfran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-26T10:25:14.000Z","updated_at":"2024-05-10T11:39:56.000Z","dependencies_parsed_at":"2022-09-23T07:10:29.554Z","dependency_job_id":null,"html_url":"https://github.com/tomfran/urban-sound-classification","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomfran/urban-sound-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfran%2Furban-sound-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfran%2Furban-sound-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfran%2Furban-sound-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfran%2Furban-sound-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomfran","download_url":"https://codeload.github.com/tomfran/urban-sound-classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfran%2Furban-sound-classification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265518475,"owners_count":23780967,"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":["audio-classification","cnn","keras","machine-learning","neural-network","python","tensorflow","urbansound8k"],"created_at":"2024-11-10T04:11:28.007Z","updated_at":"2025-07-16T14:33:53.044Z","avatar_url":"https://github.com/tomfran.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Urban sound classification\n\nThe goal of the project is to build a neural network capable of classification on the [Urban Sound 8k dataset](https://urbansounddataset.weebly.com/urbansound8k.html).\u003cbr\u003e\nAn in depth overview of the project is present on the [project report](https://github.com/tomfran/urban-sound-classification/blob/main/report/report.pdf).\n\n## Project structure\nThe project folder is structured as follows:\n- **data/** contains processed and raw data. To reproduce results using the dataset, \nput the folds folders inside **data/raw/audio**, then put the metadata file inside **data/raw/metadata**\n- **models/** contains trained models, namely the scaler and pca used in the project\n- **notebooks/** contains the Jupyter notebooks used execute the code\n- **src/** contains **data**, **model** and **utils** sub-folders, with code regarding the different parts \nof the project\n- **report/** contains the project report written in Latex\n\n## Requirements\nLibraries used in the project are the following: *pandas*, *numpy*, *matplotlib*, *tensorflow*, *librosa*, *dask*, *keras_nightly*, *keras*, *scikit_learn*\n \nYou can install them using the following command\n```[shell]\npip install -r src/requirements.txt\n```\n\n## Methodology\nThe methodology followed in the project can be seen in the various jupyter notebooks.\n\n### Feature extraction and dataset creation\nIn the [first notebook](https://github.com/tomfran/urban-sound-classification/blob/main/notebooks/01_dataset.ipynb) audio features are extracted using Librosa library and scaling \nis applied. \u003cbr\u003e\nIn the [second notebook](https://github.com/tomfran/urban-sound-classification/blob/main/notebooks/02_dataset_extended_cnn.ipynb), more features are extracted and PCA feature selection is exploited to reduce the dataset dimensionality.\nAlso, audio as an image is extracted from the dataset for later training a CNN.\n\n### Cross validation on the training sets\nTo understand what training set is best suited for the project, \ncross validation is performed on the initial, scaled, extended and pca dataset obtained at the previous step.\nThe results are presented in the [third notebook](https://github.com/tomfran/urban-sound-classification/blob/main/notebooks/03_cross_validation_mlp.ipynb).\n\n### Hyperparameter tuning \nAfter selecting the best dataset from the cross validation results, \na Random Search is performed to optimize the network hyperparameters, \ndetails about results as well as test set evaluation can be found on the [fourth notebook](https://github.com/tomfran/urban-sound-classification/blob/main/notebooks/04_hyperparameter_tuning_mlp.ipynb).\n\n### CNN training and tuning\nThe [last notebook](https://github.com/tomfran/urban-sound-classification/blob/main/notebooks/05_cnn.ipynb) presents the results using a convolutional neural \nnetwork on the image dataset obtained in the second notebook.\nThis notebook was executed on Google Colab for performance reasons.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomfran%2Furban-sound-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomfran%2Furban-sound-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomfran%2Furban-sound-classification/lists"}