百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

crnn-audio-classification

> 编程语言
开源

PyTorch 使用 Curvolutional 经常网络进行 UrbanSound 分类

391 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

PyTorch 使用 Curvolutional 经常网络进行 UrbanSound 分类

PyTorch Audio Classification: Urban Sounds

Classification of audio with variable length using a CNN + LSTM architecture on the UrbanSound8K dataset.

Example results:

Contents

  • Models
  • Inference
  • Training
  • Evaluation
  • To Do

Dependencies

  • soundfile: audio loading
  • torchparse: .cfg easy model definition
  • pytorch/audio: Audio transforms

Features

  • Easily define CRNN in .cfg format
  • Spectrogram computation on GPU
  • Audio data augmentation: Cropping, White Noise, Time Stretching (using phase vocoder on GPU!)

Models

CRNN architecture:

Printing model defined with torchparse:

…

Usage

Inference

Run inference on an audio file:

bash
./run.py /path/to/audio/file.wav -r path/to/saved/model.pth 

Training

bash
./run.py train -c config.json --cfg arch.cfg
Augmentation

Dataset transforms:

bash
Compose(
    ProcessChannels(mode=avg)
    AdditiveNoise(prob=0.3, sig=0.001, dist_type=normal)
    RandomCropLength(prob=0.4, sig=0.25, dist_type=half)
    ToTensorAudio()
)

As well as time stretching:

TensorboardX

Evaluation

bash
./run.py eval -r /path/to/saved/model.pth

Then obtain defined metrics:

bash
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 34/34 [00:03<00:00, 12.68it/s]
{'avg_precision': '0.725', 'avg_recall': '0.719', 'accuracy': '0.804'}
10-Fold Cross Validation
Arch Accuracy AvgPrecision(macro) AvgRecall(macro)
CNN 71.0% 63.4% 63.5%
CRNN 72.3% 64.3% 65.0%
CRNN(Bidirectional, Dropout) 73.5% 65.5% 65.8%
CRNN(Dropout) 73.0% 65.5% 65.7%
CRNN(Bidirectional) 72.8% 64.3% 65.2%

Per fold metrics CRNN(Bidirectional, Dropout):

Fold Accuracy AvgPrecision(macro) AvgRecall(macro)
1 73.1% 65.1% 66.1%
2 80.7% 69.2% 68.9%
3 62.8% 57.3% 57.5%
4 73.6% 65.2% 64.9%
5 78.4% 70.3% 71.5%
6 73.5% 65.5% 65.9%
7 74.6% 67.0% 66.6%
8 66.7% 62.3% 61.7%
9 71.7% 60.7% 62.7%
10 79.9% 72.2% 71.8%

To Do

  • commit jupyter notebook dataset exploration
  • Switch overt to using pytorch/audio
  • use torchaudio-contrib for STFT transforms
  • CRNN entirely defined in .cfg
  • Some bug in 'infer'
  • Run 10-fold Cross Validation
  • Switch over to pytorch/audio since the merge
  • Comment things

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonaudioaudio-classificationconvnetcrnn

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言