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
Owner
Hiroshechka Y
ML Engineer | Kaggle Master | Public Health
Hiroshechka Y
Neuralnetwork - Basic Multilayer Perceptron Neural Network for deep learning

Neural Network Just a basic Neural Network module Usage Example Importing Module

andreecy 0 Nov 01, 2022
PyTorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision.

PyTorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision @misc{CV2018, author = {Donny You ( Donny You 40 Sep 14, 2022

A python-image-classification web application project, written in Python and served through the Flask Microframework

A python-image-classification web application project, written in Python and served through the Flask Microframework. This Project implements the VGG16 covolutional neural network, through Keras and

Gerald Maduabuchi 19 Dec 12, 2022
Improving Calibration for Long-Tailed Recognition (CVPR2021)

MiSLAS Improving Calibration for Long-Tailed Recognition Authors: Zhisheng Zhong, Jiequan Cui, Shu Liu, Jiaya Jia [arXiv] [slide] [BibTeX] Introductio

DV Lab 116 Dec 20, 2022
Training BERT with Compute/Time (Academic) Budget

Training BERT with Compute/Time (Academic) Budget This repository contains scripts for pre-training and finetuning BERT-like models with limited time

Intel Labs 263 Jan 07, 2023
Perform zero-order Hankel Transform for an 1D array (float or real valued).

perform zero-order Hankel Transform for an 1D array (float or real valued). An discrete form of Parseval theorem is guaranteed. Suit for iterative problems.

1 Jan 17, 2022
offical implement of our Lifelong Person Re-Identification via Adaptive Knowledge Accumulation in CVPR2021

LifelongReID Offical implementation of our Lifelong Person Re-Identification via Adaptive Knowledge Accumulation in CVPR2021 by Nan Pu, Wei Chen, Yu L

PeterPu 76 Dec 08, 2022
[CVPR'20] TTSR: Learning Texture Transformer Network for Image Super-Resolution

TTSR Official PyTorch implementation of the paper Learning Texture Transformer Network for Image Super-Resolution accepted in CVPR 2020. Contents Intr

Multimedia Research 689 Dec 28, 2022
A deep neural networks for images using CNN algorithm.

Example-CNN-Project This is a simple project showing how to implement deep neural networks using CNN algorithm. The dataset is taken from this link: h

Mohammad Amin Dadgar 3 Sep 16, 2022
Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal, multi-exposure and multi-focus image fusion.

U2Fusion Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal (VIS-IR, medical), multi

Han Xu 129 Dec 11, 2022
Kaggle: Cell Instance Segmentation

Kaggle: Cell Instance Segmentation The goal of this challenge is to detect cells in microscope images. with simple view on how many cels have been ann

Jirka Borovec 9 Aug 12, 2022
Spatial Transformer Nets in TensorFlow/ TensorLayer

MOVED TO HERE Spatial Transformer Networks Spatial Transformer Networks (STN) is a dynamic mechanism that produces transformations of input images (or

Hao 36 Nov 23, 2022
MAVE: : A Product Dataset for Multi-source Attribute Value Extraction

The dataset contains 3 million attribute-value annotations across 1257 unique categories on 2.2 million cleaned Amazon product profiles. It is a large, multi-sourced, diverse dataset for product attr

Google Research Datasets 89 Jan 08, 2023
Autotype on websites that have copy-paste disabled like Moodle, HackerEarth contest etc.

Autotype A quick and small python script that helps you autotype on websites that have copy paste disabled like Moodle, HackerEarth contests etc as it

Tushar 32 Nov 03, 2022
Code for CVPR 2021 paper TransNAS-Bench-101: Improving Transferrability and Generalizability of Cross-Task Neural Architecture Search.

TransNAS-Bench-101 This repository contains the publishable code for CVPR 2021 paper TransNAS-Bench-101: Improving Transferrability and Generalizabili

Yawen Duan 17 Nov 20, 2022
Norm-based Analysis of Transformer

Norm-based Analysis of Transformer Implementations for 2 papers introducing to analyze Transformers using vector norms: Kobayashi+'20 Attention is Not

Goro Kobayashi 52 Dec 05, 2022
Text Generation by Learning from Demonstrations

Text Generation by Learning from Demonstrations The README was last updated on March 7, 2021. The repo is based on fairseq (v0.9.?). Paper arXiv Prere

38 Oct 21, 2022
PyTorch implementation for "HyperSPNs: Compact and Expressive Probabilistic Circuits", NeurIPS 2021

HyperSPN This repository contains code for the paper: HyperSPNs: Compact and Expressive Probabilistic Circuits "HyperSPNs: Compact and Expressive Prob

8 Nov 08, 2022
Allele-specific pipeline for unbiased read mapping(WIP), QTL discovery(WIP), and allelic-imbalance analysis

WASP2 (Currently in pre-development): Allele-specific pipeline for unbiased read mapping(WIP), QTL discovery(WIP), and allelic-imbalance analysis Requ

McVicker Lab 2 Aug 11, 2022