https://github.com/aryashah2k/quaclrs-quasi-supervised-audio-classification-by-learning-representations-from-spectrograms

RTML Research titled "QUACLRS: QUasi-supervised Audio Classification by Learning Representations from Spectrograms"

https://github.com/aryashah2k/quaclrs-quasi-supervised-audio-classification-by-learning-representations-from-spectrograms

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.4%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

RTML Research titled "QUACLRS: QUasi-supervised Audio Classification by Learning Representations from Spectrograms"

Basic Info
  • Host: GitHub
  • Owner: aryashah2k
  • License: gpl-3.0
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage: https://quaclrs.streamlit.app
  • Size: 4.24 GB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

QUACLRS: QUasi-supervised Audio Classification by Learning Representations from Spectrograms

This project implements multiple CNN architectures for audio spectrogram classification using the extended UrbanSound8K dataset. The implementation includes comprehensive training, evaluation, and visualization tools.

Project Structure

urbansound_extended/ spectrograms/ # Directory containing spectrogram images fold1/ # Fold 1 spectrograms fold2/ # Fold 2 spectrograms ... # ... up to fold10 spectrograms_balanced_no_sirens.csv # Dataset metadata utils/ # Utility modules __init__.py # Package initialization dataset.py # Dataset and dataloader utilities models.py # Model architecture definitions training.py # Training and evaluation utilities visualization.py # Visualization utilities train_kfold.py # K-fold cross-validation training script requirements.txt # Project dependencies README.md # This file

Dataset

The extended UrbanSound8K dataset contains 57,918 spectrogram images with the following characteristics: - Image dimensions: 1000400 pixels, RGBA format - 13 Classes: dogbark, childrenplaying, carhorn, airconditioner, streetmusic, gunshot, engine_idling, jackhammer, drilling, ambulance, firetruck, police, traffic - Folds: 10 folds for cross-validation - Augmentations: Various augmentations already applied (timestretch, pitchshift, specaugment, patchaugment, noise)

Supported Models

This project supports training the following CNN architectures: - AlexNet - VGG16 - ResNet18 - MobileNetV2 - InceptionV3 - EfficientNet-B0 - ConvNeXt-Tiny

Installation

bash pip install -r requirements.txt

Usage

Training a model with k-fold cross-validation

bash python train_kfold.py --model_name resnet18 --pretrained --batch_size 32 --epochs 30

Training on a specific fold

bash python train_kfold.py --model_name mobilenet --pretrained --fold 1

Training with mixed precision

bash python train_kfold.py --model_name efficientnet --pretrained --use_amp

Full list of available options

``` usage: trainkfold.py [-h] [--csvfile CSVFILE] [--spectrogramsdir SPECTROGRAMSDIR] --modelname {alexnet,vgg16,resnet18,mobilenet,inception,efficientnet,convnext} [--pretrained] [--freeze_features] [--batchsize BATCHSIZE] [--numworkers NUMWORKERS] [--learningrate LEARNINGRATE] [--weightdecay WEIGHTDECAY] [--epochs EPOCHS] [--patience PATIENCE] [--scheduler {plateau,cosine}] [--device {cuda,cpu}] [--use_amp] [--distributed] [--outputdir OUTPUTDIR] [--fold FOLD]

Train audio spectrogram classification models with K-fold cross-validation

optional arguments: -h, --help show this help message and exit --csvfile CSVFILE Path to the CSV file with annotations --spectrogramsdir SPECTROGRAMSDIR Directory containing spectrogram images --modelname {alexnet,vgg16,resnet18,mobilenet,inception,efficientnet,convnext} Model architecture to use --pretrained Use pretrained weights for the model --freezefeatures Freeze feature extraction layers --batchsize BATCHSIZE Batch size for training --numworkers NUMWORKERS Number of worker threads for data loading --learningrate LEARNINGRATE Initial learning rate --weightdecay WEIGHTDECAY Weight decay for optimizer --epochs EPOCHS Number of epochs to train for --patience PATIENCE Patience for early stopping --scheduler {plateau,cosine} Learning rate scheduler to use --device {cuda,cpu} Device to use for training (cuda/cpu) --useamp Use automatic mixed precision training --outputdir OUTPUT_DIR Directory to save outputs --fold FOLD Specific fold to train on (None for all folds) ```

Training Output

For each trained model, the following outputs are generated: - Model checkpoints: Regular and best model checkpoints - Learning curves: Loss and accuracy plots - Confusion matrix: Visualization of classification performance - ROC curves: ROC and AUC metrics for each class - Classification report: Precision, recall, and F1-score for each class - Grad-CAM visualizations: Attention maps for sample images

Model Weights and Outputs can be accessed here

Hardware Requirements

The code is optimized for use with NVIDIA GPUs. Recommended hardware: - 4 NVIDIA RTX 2080 Ti GPUs - 16GB RAM

Owner

  • Name: Arya Shah
  • Login: aryashah2k
  • Kind: user
  • Location: Mumbai, India
  • Company: IIT Gandhinagar

Artificial Intelligence Engineer & Researcher

GitHub Events

Total
  • Watch event: 2
  • Push event: 2
  • Public event: 1
Last Year
  • Watch event: 2
  • Push event: 2
  • Public event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 32
  • Total Committers: 1
  • Avg Commits per committer: 32.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 32
  • Committers: 1
  • Avg Commits per committer: 32.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
aryashah2k a****2@n****n 32
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels