Giter VIP home page Giter VIP logo

ml_project_birdclef23's Introduction

Machine Learning Project

kaggle birdclef23

Environment Setup

If you want to run the code on your own device instead of using the official kaggle notebook, Recommend use docker to setup the python enviroment on your own device. To install the kaggle enviroment, can reference here

Under the condition you have installed docker, you can use the following command to install docker image and run image:

docker pull gcr.io/kaggle-gpu-images/python:latest

# Run the image pre-built image from gcr.io
docker run --runtime nvidia --rm -it gcr.io/kaggle-gpu-images/python /bin/bash

Additional packages shoud be installed using the following command.

pip install efficientnet_pytorch
pip install prefetch-generator
pip install torchaudio_augmentations

Code Running

  1. Download birdclef-2023 dataset

First, use the following command to donwload dataset

cd download_dataset
bash download_birdclef23.sh
mkdir /kaggle/input/birdclef-2023
cp birdclef-2023.zip /kaggle/input/birdclef-2023
unzip birdclef-2023.zip
  1. Dwonload the pretrained model

Then, download the official unilm/beats pretrained model

cd ./pretrained_models/unilm
bash download.sh
  1. Optuna Parameter Tuning
CUDA_VISIBLE_DEVICES=3 python birdclef23-optuna.py --experiment_name beats --model_name beats --eval_step 1

CUDA_VISIBLE_DEVICES=2 python birdclef23-optuna.py --experiment_name ast --model_name ast --eval_step 1

CUDA_VISIBLE_DEVICES=1 python birdclef23-optuna.py --experiment_name efficientnet --model_name efficientnet --eval_step 1

CUDA_VISIBLE_DEVICES=0 python birdclef23-optuna.py --experiment_name musicnn --model_name musicnn --eval_step 1

Submit on Kaggle

When finish the optuna training, can refer to the script Infer_kaggle.ipynb to get the kaggle submission.

TODO:

    • Repeat the these codes (these codes are from here) by Pytorch
    • Use Wav2vec, Audio Spectrogram Transformer, Musicnn to do the classification (Plan to complete on 8/4/2023)
      • Add Audio Spectrogram Transformer mudule (Completed on 8/4/2023)
    • Train and Valid the performation of Unilm BEATs model (run birdclef23-unilm-finetune.ipynb) (Plan to complete on 8/4/2023)
      • Training Unilm BEATs model (running on 8/4/2023)
    • Add Optuna parameter adjust in the Training process. (completed on 8/4/2023)
      • Merge BEATs model and AST model in the same training pipline
    • Add audio data cache in Dataset (improve the speed of loading data). (completed on 10/4/2023)
    • Add EfficientNet Model in the model hub. (completed on 10/4/2023)
    • Add Wav2Vec model to experiment (Completed on 11/4/2023)
    • Add BCE loss in all models (when use BCE, the model output need to use nn.Sigmoid()) (Completed on 13/4/2023)
    • Add a hyper parameter $ast_fix_layer$ to assign layers that need to be fixed (Completed on 13/4/2023)
    • Submit on Kaggle (Competed on 18/04/2023)
    • Add model quantization to reduce the inference time. (Completed on 19/04/2023)

Reference

Some of the code in this repo is taken from there.

ml_project_birdclef23's People

Contributors

iser97 avatar yyya9 avatar

Watchers

 avatar

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.