Kaggle G2Net Gravitational Wave Detection : 2nd place solution

Overview

Kaggle G2Net Gravitational Wave Detection : 2nd place solution

Solution writeup: https://www.kaggle.com/c/g2net-gravitational-wave-detection/discussion/275341

Instructions

1. Download data

You have to download the competition dataset from competition website, and place the files in input/ directory.

┣ input/
┃   ┣ training_labels.csv
┃   ┣ sample_submission.csv
┃   ┣ train/
┃   ┣ test/
┃
┣ configs.py
┣ ...

(Optional:) Add your hardware configurations

# configs.py
HW_CFG = {
    'RTX3090': (16, 128, 1, 24), # CPU count, RAM amount(GB), GPU count, GPU RAM(GB)
    'A100': (9, 60, 1, 40), 
    'Your config', (128, 512, 8, 40) # add your hardware config!
}

2. Setup python environment

conda

conda env create -n kumaconda -f=environment.yaml
conda activate kumaconda

docker

WIP

3. Prepare data

Two new files - input/train.csv and input/test/.csv will be created.

python prep_data.py

(Optional:) Prepare waveform cache

Optionally you can speed up training by making waveform cache.
This is not recommend if your machine has RAM size smaller than 32GB.
input/train_cache.pickle and input/test_cache.pickle will be created.

python prep_data.py --cache

Then, add cache path to Baseline class in configs.py.

# configs.py
class Baseline:
    name = 'baseline'
    seed = 2021
    train_path = INPUT_DIR/'train.csv'
    test_path = INPUT_DIR/'test.csv'
    train_cache = INPUT_DIR/'train_cache.pickle' # here
    test_cache = INPUT_DIR/'test_cache.pickle' # here
    cv = 5

4. Train nueral network

Each experiment class has a name (e.g. name for Nspec16 is nspec_16).
Outputs of an experiment are

  • outoffolds.npy : (train size, 1) np.float32
  • predictions.npy : (cv fold, test size, 1) np.float32
  • {name}_{timestamp}.log : training log
  • foldx.pt : pytorch checkpoint

All outputs will be created in results/{name}/.

python train.py --config {experiment class}
# [Options]
# --progress_bar    : Everyone loves progress bar
# --inference       : Run inference only
# --tta             : Run test time augmentations (FlipWave)
# --limit_fold x    : Train a single fold x. You must run inference again by yourself.

5. Train neural network again (pseudo-label)

For experiments with name starting with Pseudo, you must use train_pseudo.py.
Outputs and options are the same as train.py.
Make sure the dependent experiment (see the table below) was successfully run.

python train_pseudo.py --config {experiment class}

Experiments

# Experiment Dependency Frontend Backend Input size CV Public LB Private LB
1 Pseudo06 Nspec12 CWT efficientnet-b2 256 x 512 0.8779 0.8797 0.8782
2 Pseodo07 Nspec16 CWT efficientnet-b2 128 x 1024 0.87841 0.8801 0.8787
3 Pseudo12 Nspec12arch0 CWT densenet201 256 x 512 0.87762 0.8796 0.8782
4 Pseudo13 MultiInstance04 CWT xcit-tiny-p16 384 x 768 0.87794 0.8800 0.8782
5 Pseudo14 Nspec16arch17 CWT efficientnet-b7 128 x 1024 0.87957 0.8811 0.8800
6 Pseudo18 Nspec21 CWT efficientnet-b4 256 x 1024 0.87942 0.8812 0.8797
7 Pseudo10 Nspec16spec13 CWT efficientnet-b2 128 x 1024 0.87875 0.8802 0.8789
8 Pseudo15 Nspec22aug1 WaveNet efficientnet-b2 128 x 1024 0.87846 0.8809 0.8794
9 Pseudo16 Nspec22arch2 WaveNet efficientnet-b6 128 x 1024 0.87982 0.8823 0.8807
10 Pseudo19 Nspec22arch6 WaveNet densenet201 128 x 1024 0.87831 0.8818 0.8804
11 Pseudo17 Nspec23arch3 CNN efficientnet-b6 128 x 1024 0.87982 0.8823 0.8808
12 Pseudo21 Nspec22arch7 WaveNet effnetv2-m 128 x 1024 0.87861 0.8831 0.8815
13 Pseudo22 Nspec23arch5 CNN effnetv2-m 128 x 1024 0.87847 0.8817 0.8799
14 Pseudo23 Nspec22arch12 WaveNet effnetv2-l 128 x 1024 0.87901 0.8829 0.8811
15 Pseudo24 Nspec30arch2 WaveNet efficientnet-b6 128 x 1024 0.8797 0.8817 0.8805
16 Pseudo25 Nspec25arch1 WaveNet efficientnet-b3 256 x 1024 0.87948 0.8820 0.8803
17 Pseudo26 Nspec22arch10 WaveNet resnet200d 128 x 1024 0.87791 0.881 0.8797
18 PseudoSeq04 Seq03aug3 ResNet1d-18 - 0.87663 0.8804 0.8785
19 PseudoSeq07 Seq12arch4 WaveNet - 0.87698 0.8796 0.8784
20 PseudoSeq03 Seq09 DenseNet1d-121 - 0.86826 0.8723 0.8703
You might also like...
Galactic and gravitational dynamics in Python
Galactic and gravitational dynamics in Python

Gala is a Python package for Galactic and gravitational dynamics. Documentation The documentation for Gala is hosted on Read the docs. Installation an

1st place solution to the Satellite Image Change Detection Challenge hosted by SenseTime
1st place solution to the Satellite Image Change Detection Challenge hosted by SenseTime

1st place solution to the Satellite Image Change Detection Challenge hosted by SenseTime

Winning solution of the Indoor Location & Navigation Kaggle competition
Winning solution of the Indoor Location & Navigation Kaggle competition

This repository contains the code to generate the winning solution of the Kaggle competition on indoor location and navigation organized by Microsoft

Solution of Kaggle competition: Sartorius - Cell Instance Segmentation

Sartorius - Cell Instance Segmentation https://www.kaggle.com/c/sartorius-cell-instance-segmentation Environment setup Build docker image bash .dev_sc

Kaggle Feedback Prize - Evaluating Student Writing 15th solution

Kaggle Feedback Prize - Evaluating Student Writing 15th solution First of all, I would like to thank the excellent notebooks and discussions from http

The 3rd place solution for competition
The 3rd place solution for competition

The 3rd place solution for competition "Lyft Motion Prediction for Autonomous Vehicles" at Kaggle Team behind this solution: Artsiom Sanakoyeu [Homepa

1st Place Solution to ECCV-TAO-2020: Detect and Represent Any Object for Tracking

Instead, two models for appearance modeling are included, together with the open-source BAGS model and the full set of code for inference. With this code, you can achieve around mAP@23 with TAO test set (based on our estimation).

9th place solution in "Santa 2020 - The Candy Cane Contest"

Santa 2020 - The Candy Cane Contest My solution in this Kaggle competition "Santa 2020 - The Candy Cane Contest", 9th place. Basic Strategy In this co

Code for 1st place solution in Sleep AI Challenge SNU Hospital
Code for 1st place solution in Sleep AI Challenge SNU Hospital

Sleep AI Challenge SNU Hospital 2021 Code for 1st place solution for Sleep AI Challenge (Note that the code is not fully organized) Refer to the notio

Owner
Hiroshechka Y
ML Engineer | Kaggle Master | Public Health
Hiroshechka Y
This is the solution for 2nd rank in Kaggle competition: Feedback Prize - Evaluating Student Writing.

Feedback Prize - Evaluating Student Writing This is the solution for 2nd rank in Kaggle competition: Feedback Prize - Evaluating Student Writing. The

Udbhav Bamba 41 Dec 14, 2022
Simple Linear 2nd ODE Solver GUI - A 2nd constant coefficient linear ODE solver with simple GUI using euler's method

Simple_Linear_2nd_ODE_Solver_GUI Description It is a 2nd constant coefficient li

:) 4 Feb 5, 2022
SweiNet is an uncertainty-quantifying shear wave speed (SWS) estimator for ultrasound shear wave elasticity (SWE) imaging.

SweiNet SweiNet is an uncertainty-quantifying shear wave speed (SWS) estimator for ultrasound shear wave elasticity (SWE) imaging. SweiNet takes as in

Felix Jin 3 Mar 31, 2022
Kaggle Lyft Motion Prediction for Autonomous Vehicles 4th place solution

Lyft Motion Prediction for Autonomous Vehicles Code for the 4th place solution of Lyft Motion Prediction for Autonomous Vehicles on Kaggle. Discussion

null 44 Jun 27, 2022
7th place solution of Human Protein Atlas - Single Cell Classification on Kaggle

kaggle-hpa-2021-7th-place-solution Code for 7th place solution of Human Protein Atlas - Single Cell Classification on Kaggle. A description of the met

null 8 Jul 9, 2021
Kaggle | 9th place (part of) solution for the Bristol-Myers Squibb – Molecular Translation challenge

Part of the 9th place solution for the Bristol-Myers Squibb – Molecular Translation challenge translating images containing chemical structures into I

Erdene-Ochir Tuguldur 22 Nov 30, 2022
My 1st place solution at Kaggle Hotel-ID 2021

1st place solution at Kaggle Hotel-ID My 1st place solution at Kaggle Hotel-ID to Combat Human Trafficking 2021. https://www.kaggle.com/c/hotel-id-202

Kohei Ozaki 18 Aug 19, 2022
Kaggle | 9th place single model solution for TGS Salt Identification Challenge

UNet for segmenting salt deposits from seismic images with PyTorch. General We, tugstugi and xuyuan, have participated in the Kaggle competition TGS S

Erdene-Ochir Tuguldur 276 Dec 20, 2022
10th place solution for Google Smartphone Decimeter Challenge at kaggle.

Under refactoring 10th place solution for Google Smartphone Decimeter Challenge at kaggle. Google Smartphone Decimeter Challenge Global Navigation Sat

null 12 Oct 25, 2022
2nd solution of ICDAR 2021 Competition on Scientific Literature Parsing, Task B.

TableMASTER-mmocr Contents About The Project Method Description Dependency Getting Started Prerequisites Installation Usage Data preprocess Train Infe

Jianquan Ye 298 Dec 21, 2022