Git Product home page Git Product logo

soundsee-background-domain-switch's Introduction

Background-Domain-Switch (BDS) for Robust SED

An implementation example for adopting the BDS data augmentation approach proposed in this paper (paper link will be available soon). The work is presented and published in Interspeech'23. This repository will demonstrate on how to apply BDS using DCASE Challenge-Task4 as example.

Purpose of this Software

This software is a research prototype, solely developed for and published as part of the publication mentioned above. It will neither be maintained nor monitored in any way.

Running Environment

Please refer to the official baseline recipe provided by DCASE website.

How to Use

Simply adding the BDS function to pytorch lightning trainer step prior to other data augmentation approaches! e.g., inside /local/sed_trainer.py

...
from desed_task.data_augm import BDS

...
	def training_step(self, batch, batch_indx):
		...

		# deriving masks for each dataset
		strong_mask = torch.zeros(batch_num).to(features).bool()
		weak_mask = torch.zeros(batch_num).to(features).bool()
		unlabeled_mask = torch.zeros(batch_num).to(features).bool()
		strong_mask[:indx_synth] = 1
		weak_mask[indx_synth : indx_weak + indx_synth] = 1
		unlabeled_mask[indx_weak + indx_synth:] = 1
		
		# BDS has to apply after some training epochs for reliable pseudo-labeling results
		if self.current_epoch/self.hparams["training"]["n_epochs"]>=0.6: # e.g., apply at latest 40% epochs
			features = BDS(feats=features,
						norm=self.scaler,
						scale=self.take_log,
						labels_strong=labels,
						set_masks=[strong_mask, weak_mask, unlabeled_mask],
						model=self.sed_student,
						seq_pooling_factor=4,
						event_threshold=0.4,
						min_frames=40,
						bidirectional=False,
						stochastic_iter=1)
		
		# other data augmentations, e.g., MixUp, SpecAugment...etc
		...

Cite

If you use this code, please cite the following paper:

Wei-Cheng Lin, Luca Bondi and Shabnam Ghaffarzadegan, "Background Domain Switch: A Novel Data Augmentation Technique for Robust Sound Event Detection", Interspeech 2023.

@InProceedings{LinBDS_2023, 
  author={W.-C. Lin and L. Bondi and S. Ghaffarzadegan}, 
  title={{Background Domain Switch}: A Novel Data Augmentation Technique for Robust Sound Event Detection},
  booktitle={Interspeech 2023}, 
  volume={},
  year={2023}, 
  month={August}, 
  pages={XXXX-XXXX}, 
  address =  {Dublin, Ireland},
  doi={},
}

License

The code in this repository is open-sourced under the AGPL-3.0 license. See the LICENSE file for details.

soundsee-background-domain-switch's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.