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
Controlling the MicriSpotAI robot from scratch

Project-MicroSpot-AI Controlling the MicriSpotAI robot from scratch Colaborators Alexander Dennis Components from MicroSpot The MicriSpotAI has the fo

Dennis Núñez-Fernández 5 Oct 20, 2022
这是一个yolo3-tf2的源码,可以用于训练自己的模型。

YOLOV3:You Only Look Once目标检测模型在Tensorflow2当中的实现 目录 性能情况 Performance 所需环境 Environment 文件下载 Download 训练步骤 How2train 预测步骤 How2predict 评估步骤 How2eval 参考资料

Bubbliiiing 68 Dec 21, 2022
Facial expression detector

A tensorflow convolutional neural network model to detect facial expressions.

Carlos Tardón Rubio 5 Apr 20, 2022
Super-BPD: Super Boundary-to-Pixel Direction for Fast Image Segmentation (CVPR 2020)

Super-BPD for Fast Image Segmentation (CVPR 2020) Introduction We propose direction-based super-BPD, an alternative to superpixel, for fast generic im

189 Dec 07, 2022
A complete end-to-end demonstration in which we collect training data in Unity and use that data to train a deep neural network to predict the pose of a cube. This model is then deployed in a simulated robotic pick-and-place task.

Object Pose Estimation Demo This tutorial will go through the steps necessary to perform pose estimation with a UR3 robotic arm in Unity. You’ll gain

Unity Technologies 187 Dec 24, 2022
This is an official implementation of CvT: Introducing Convolutions to Vision Transformers.

Introduction This is an official implementation of CvT: Introducing Convolutions to Vision Transformers. We present a new architecture, named Convolut

Microsoft 408 Dec 30, 2022
Unofficial Tensorflow Implementation of ConvNeXt from A ConvNet for the 2020s

Tensorflow Implementation of "A ConvNet for the 2020s" This is the unofficial Tensorflow Implementation of ConvNeXt from "A ConvNet for the 2020s" pap

DK 11 Oct 12, 2022
git《Investigating Loss Functions for Extreme Super-Resolution》(CVPR 2020) GitHub:

Investigating Loss Functions for Extreme Super-Resolution NTIRE 2020 Perceptual Extreme Super-Resolution Submission. Our method ranked first and secon

Sejong Yang 0 Oct 17, 2022
Beyond imagenet attack (accepted by ICLR 2022) towards crafting adversarial examples for black-box domains.

Beyond ImageNet Attack: Towards Crafting Adversarial Examples for Black-box Domains (ICLR'2022) This is the Pytorch code for our paper Beyond ImageNet

Alibaba-AAIG 37 Nov 23, 2022
STARCH compuets regional extreme storm physical characteristics and moisture balance based on spatiotemporal precipitation data from reanalysis or climate model data.

STARCH (Storm Tracking And Regional CHaracterization) STARCH computes regional extreme storm physical and moisture balance characteristics based on sp

Onosama 7 Oct 20, 2022
Large scale and asynchronous Hyperparameter Optimization at your fingertip.

Syne Tune This package provides state-of-the-art distributed hyperparameter optimizers (HPO) where trials can be evaluated with several backend option

Amazon Web Services - Labs 236 Jan 01, 2023
FAST Aiming at the problems of cumbersome steps and slow download speed of GNSS data

FAST Aiming at the problems of cumbersome steps and slow download speed of GNSS data, a relatively complete set of integrated multi-source data download terminal software fast is developed. The softw

ChangChuntao 23 Dec 31, 2022
Research code of ICCV 2021 paper "Mesh Graphormer"

MeshGraphormer ✨ ✨ This is our research code of Mesh Graphormer. Mesh Graphormer is a new transformer-based method for human pose and mesh reconsructi

Microsoft 251 Jan 08, 2023
Offcial implementation of "A Hybrid Video Anomaly Detection Framework via Memory-Augmented Flow Reconstruction and Flow-Guided Frame Prediction, ICCV-2021".

HF2-VAD Offcial implementation of "A Hybrid Video Anomaly Detection Framework via Memory-Augmented Flow Reconstruction and Flow-Guided Frame Predictio

76 Dec 21, 2022
A collection of semantic image segmentation models implemented in TensorFlow

A collection of semantic image segmentation models implemented in TensorFlow. Contains data-loaders for the generic and medical benchmark datasets.

bobby 16 Dec 06, 2019
Predicts an answer in yes or no.

Oui-ou-non-prediction Predicts an answer in 'yes' or 'no'. It is based on the game 'effeuiller la marguerite' in which the person plucks flower petals

Ananya Gupta 1 Jan 15, 2022
[ICLR 2021] Is Attention Better Than Matrix Decomposition?

Enjoy-Hamburger 🍔 Official implementation of Hamburger, Is Attention Better Than Matrix Decomposition? (ICLR 2021) Under construction. Introduction T

Gsunshine 271 Dec 29, 2022
An educational tool to introduce AI planning concepts using mobile manipulator robots.

JEDAI Explains Decision-Making AI Virtual Machine Image The recommended way of using JEDAI is to use pre-configured Virtual Machine image that is avai

Autonomous Agents and Intelligent Robots 13 Nov 15, 2022
EfficientNetv2 TensorRT int8

EfficientNetv2_TensorRT_int8 EfficientNetv2模型实现来自https://github.com/d-li14/efficientnetv2.pytorch 环境配置 ubuntu:18.04 cuda:11.0 cudnn:8.0 tensorrt:7

34 Apr 24, 2022
Learning from Guided Play: A Scheduled Hierarchical Approach for Improving Exploration in Adversarial Imitation Learning Source Code

Learning from Guided Play: A Scheduled Hierarchical Approach for Improving Exploration in Adversarial Imitation Learning Source Code

STARS Laboratory 8 Sep 14, 2022