Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tutorial for multilabel training #254

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

PariaValizadeh
Copy link
Collaborator

@PariaValizadeh PariaValizadeh commented Jul 24, 2024

This PR adds a tutorial notebook to guide practictioners how to train a ResNet model for multilabel classification on the HSN dataset.

  • Add notebook
  • merge main
  • check that it is working

@PariaValizadeh PariaValizadeh marked this pull request as ready for review July 25, 2024 06:53
@PariaValizadeh PariaValizadeh changed the title WIP: Add tutorial for multilabel training Add tutorial for multilabel training Jul 25, 2024
@PariaValizadeh PariaValizadeh marked this pull request as draft July 25, 2024 06:54
@PariaValizadeh PariaValizadeh marked this pull request as ready for review July 25, 2024 06:54
Copy link
Contributor

@raphaelschwinger raphaelschwinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @PariaValizadeh,
Thanks for your work. To get the most out it for our readers, I would suggest the following changes:

  • Load the data with our BirdSetDataModule without any preprocessing so that it outputs batched waveforms
  • Pick the first sample of the batch from the train and test set (this will show the difference of focal / soundscapes)
  • Make the sounds audible
  • Now, add preprocessing to train a EfficientNet (EfficientNet because we can upload a pretrained model for that, and we included the EfficientNet in BirdSet), make sure to use the same preprocessing config as done in configs/experiment/birdset_neurips24/HSN/DT/efficientnet.yaml
  • Visualize the first sample (now a spectrogram)
  • Train the model (with same configs) and add the option to download the pretrained model
  • Run test with trainer.test()
  • Run model on previously selected test sample
  • Print the predicted classes and the target class.

"source": [
"## load the test dataset\n",
"from datasets import load_dataset\n",
"hsn_test = load_dataset(\"DBD-research-group/BirdSet\",\"HSN\", split=\"test\")"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PariaValizadeh This will not use the cached version and therefore requires a complete redownload.

"cell_type": "markdown",
"metadata": {},
"source": [
"# Step 6: Visualization"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PariaValizadeh Could you move the visualization before the model training? So that the reader sees how the data gets preprocessed by the birdset pipeline?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants