基于神经网络的分类
Every day we hear different sounds and it is part of our life. Humans can differentiate between sounds easily but how cool it will be if computer can also classify the sounds into categories.
每天我们听到不同的声音,这是我们生活的一部分。 人类可以轻松地区分声音,但是如果计算机也可以将声音分类,声音将多么酷。
In this blog post, we’ll learn techniques for classifying urban sounds into categories using machine learning with neural networks. The dataset is taken from a competition in analytics vidya called Urban Sound. This dataset contains 8732 labelled sound excerpts of urban sounds from 10 classes: air_conditioner, car_horn, children_playing, dog_bark, drilling, enginge_idling, gun_shot, jackhammer, siren, and street_music.
在此博客文章中,我们将学习使用神经网络机器学习将城市声音分类的技术。 该数据集取材自名为Urban Sound的分析vidya竞赛。 该数据集包含来自10个类别的城市声音的8732个标记的声音摘录:空调,汽车喇叭,儿童游戏,狗吠,钻探,enginge_idling,gun_shot,手提钻,警笛和street_music。
I will use the python librosa library to extract numerical features from audio clips and use those features to train a neural network model.
我将使用python librosa库从音频片段中提取数字特征,并使用这些特征来训练神经网络模型。
First, let us get all the required libraries,
首先,让我们获取所有必需的库,
import IPython.display as ipdimport osimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport librosafrom tqdm import tqdmfrom sklearn.preprocessing import StandardScalerfrom keras.models import Sequential