10th place solution for Google Smartphone Decimeter Challenge at kaggle.

Overview

Under refactoring

10th place solution for Google Smartphone Decimeter Challenge at kaggle.

Google Smartphone Decimeter Challenge

Global Navigation Satellite System (GNSS) provides raw signals, which the GPS chipset uses to compute a position.
Current mobile phones only offer 3-5 meters of positioning accuracy. While useful in many cases,
it can create a “jumpy” experience. For many use cases the results are not fine nor stable enough to be reliable.

This competition, hosted by the Android GPS team, is being presented at the ION GNSS+ 2021 Conference.
They seek to advance research in smartphone GNSS positioning accuracy
and help people better navigate the world around them.

In this competition, you'll use data collected from the host team’s own Android phones
to compute location down to decimeter or even centimeter resolution, if possible.
You'll have access to precise ground truth, raw GPS measurements,
and assistance data from nearby GPS stations, in order to train and test your submissions.
  • Predictions with host baseline for highway area(upper figure) are really good, but for downtown area(lower figure) are noisy due to the effect of Multipath. input_highway input_downtown

Overview

  • Predicting the Noise, Noise = Ground Truth - Baseline, like denoising in computer vision
  • Using the speed latDeg(t + dt) - latDeg(t)/dt as input instead of the absolute position for preventing overfitting on the train dataset.
  • Making 2D image input with Short Time Fourier Transform, STFT, and then using ImageNet convolutional neural network

image-20210806172801198 best_vs_hosbaseline

STFT and Conv Network Part

  • Input: Using librosa, generating STFT for both latDeg&lngDeg speeds.
    • Each phone sequence are split into 256 seconds sequence then STFT with n_tft=256, hop_length=1 and win_length=16 , result in (256, 127, 2) feature for each degree. The following 2D images are generated from 1D sequence.

image-20210806174449510

  • Model: Regression and Segmentation
    • Regression: EfficientNet B3, predict latDeg&lngDeg noise,
    • Segmentation: Unet ++ with EfficientNet encoder(segmentation pyroch) , predict stft noise
      • segmentation prediction + input STFT -> inverse STFT -> prediction of latDeg&lngDeg speeds

      • this speed prediction was used for:

        1. Low speed mask; The points of low speed area are replaced with its median.
        2. Speed disagreement mask: If the speed from position prediction and this speed prediction differ a lot, remove such points and interpolate.
      • prediction example for the segmentation. segmentation segmentation2

LightGBM Part

  • Input: IMU data excluding magnetic filed feature
    • also excluding y acceleration and z gyro because of phone mounting condition
    • adding moving average as additional features, window_size=5, 15, 45
  • Predict latDeg&lngDeg noise

KNN at downtown Part

similar to Snap to Grid, but using both global and local feature. Local re-ranking comes from the host baseline of GLR2021

  • Use train ground truth as database
  • Global search: query(latDeg&lngDeg) -> find 10 candidates
  • Local re-ranking: query(latDeg&lngDeg speeds and its moving averages) -> find 3 candidates -> taking mean over candidates

Public Post Process Part

There are lots of nice and effective PPs in public notebooks. Thanks to the all authors. I used the following notebooks.

score

  • Check each idea with late submissions.
  • actually conv position pred part implemented near deadline, before that I used only the segmentation model for STFT image.
status Host baseline + Public PP conv position pred gbm speed mask knn global knn local Private Board Score
1 day before deadline 3.07323
10 hours before deadline 2.80185
my best submission 2.61693
late sub 5.423
late sub 3.61910
late sub 3.28516
late sub 3.19016
late sub 2.81074
late sub 2.66377

How to run

environment

  • Ubuntu 18.04
  • Python with Anaconda
  • NVIDIA GPUx1

Data Preparation

First, download the data, here, and then place it like below.

../input/
    └ google-smartphone-decimeter-challenge/

During run, temporary cached will be stored under ../data/ and outputs will be stored under ../working/ through hydra.

Code&Pacakage Installation

# clone project
git clone https://github.com/Fkaneko/kaggle_Google_Smartphone_Decimeter_Challenge

# install project
cd kaggle_Google_Smartphone_Decimeter_Challenge
conda create -n gsdc_conv python==3.8.0
yes | bash install.sh
# at my case I need an additional run of `yes | bash install.sh` for installation.

Training/Testing

3 different models

  • for conv training, python train.py at each branch. Please check the src/config/config.yaml for the training configuration.
  • for LightGBM position you need mv ./src/notebook/lightgbm_position_prediction.ipynb ./ and then starting juypter notebook.
model branch training test
conv stft segmentation main ./train.py ./test.py
conv position conv_position ./train.py ./test.py
LightGBM position main ./src/notebook/lightgbm_position_prediction.ipynb included training notebook

Testing

10th place solution trained weights

I've uploaded pretrained weights as kaggle dataset, here. So extract it on ./ and you can see ./model_weights. And then running python test.py yields submission.csv. This csv will score ~2.61 at kaggle private dataset, which equals to 10th place.

your trained weights

For conv stft segmentation please change paths at the config, src/config/test_weights/compe_sub_github.yaml, and then run followings.

# at main branch
python test.py  \
     conv_pred_path="your conv position prediction csv path"\
     gbm_pred_path="your lightgbm position prediction path"

Regarding, conv_pred_path and gbm_pred_path, you need to create each prediction csv with the table above before run this code. Or you can use mv prediction results on the same kaggle dataset as pretrained weights.

License

Code

Apache 2.0

Dataset

Please check the kaggle page -> https://www.kaggle.com/c/google-smartphone-decimeter-challenge/rules

pretrained weights

These trained weights were generated from ImageNet pretrained weights. So please check ImageNet license if you use pretrained weights for a serious case.

Scaling and Benchmarking Self-Supervised Visual Representation Learning

FAIR Self-Supervision Benchmark is deprecated. Please see VISSL, a ground-up rewrite of benchmark in PyTorch. FAIR Self-Supervision Benchmark This cod

Meta Research 584 Dec 31, 2022
A Repository of Community-Driven Natural Instructions

A Repository of Community-Driven Natural Instructions TLDR; this repository maintains a community effort to create a large collection of tasks and the

AI2 244 Jan 04, 2023
code for our ECCV 2020 paper "A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation"

Code for our ECCV (2020) paper A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation. Prerequisites: python == 3.6.8 pytorch ==1.1.0

32 Nov 27, 2022
Python PID Tuner - Based on a FOPDT model obtained using a Open Loop Process Reaction Curve

PythonPID_Tuner Step 1: Takes a Process Reaction Curve in csv format - assumes data at 100ms interval (column names CV and PV) Step 2: Makes a rough e

6 Jan 14, 2022
Code for the Lovász-Softmax loss (CVPR 2018)

The Lovász-Softmax loss: A tractable surrogate for the optimization of the intersection-over-union measure in neural networks Maxim Berman, Amal Ranne

Maxim Berman 1.3k Jan 04, 2023
functorch is a prototype of JAX-like composable function transforms for PyTorch.

functorch is a prototype of JAX-like composable function transforms for PyTorch.

Facebook Research 1.2k Jan 09, 2023
StyleGAN2-ada for practice

This version of the newest PyTorch-based StyleGAN2-ada is intended mostly for fellow artists, who rarely look at scientific metrics, but rather need a working creative tool. Tested on Python 3.7 + Py

vadim epstein 170 Nov 16, 2022
Towards Debiasing NLU Models from Unknown Biases

Towards Debiasing NLU Models from Unknown Biases Abstract: NLU models often exploit biased features to achieve high dataset-specific performance witho

Ubiquitous Knowledge Processing Lab 22 Jun 14, 2022
[NeurIPS 2021] PyTorch Code for Accelerating Robotic Reinforcement Learning with Parameterized Action Primitives

Robot Action Primitives (RAPS) This repository is the official implementation of Accelerating Robotic Reinforcement Learning via Parameterized Action

Murtaza Dalal 55 Dec 27, 2022
CurriculumNet: Weakly Supervised Learning from Large-Scale Web Images

CurriculumNet Introduction This repo contains related code and models from the ECCV 2018 CurriculumNet paper. CurriculumNet is a new training strategy

156 Jul 04, 2022
Official implementation for Likelihood Regret: An Out-of-Distribution Detection Score For Variational Auto-encoder at NeurIPS 2020

Likelihood-Regret Official implementation of Likelihood Regret: An Out-of-Distribution Detection Score For Variational Auto-encoder at NeurIPS 2020. T

Xavier 33 Oct 12, 2022
Heat transfer problemas solved using python

heat-transfer Heat transfer problems solved using python isolation-convection.py compares the temperature distribution on the problem as shown in the

2 Nov 14, 2021
Training a Resilient Q-Network against Observational Interference, Causal Inference Q-Networks

Obs-Causal-Q-Network AAAI 2022 - Training a Resilient Q-Network against Observational Interference Preprint | Slides | Colab Demo | Environment Setup

23 Nov 21, 2022
Agile SVG maker for python

Agile SVG Maker Need to draw hundreds of frames for a GIF? Need to change the style of all pictures in a PPT? Need to draw similar images with differe

SemiWaker 4 Sep 25, 2022
Complete the code of prefix-tuning in low data setting

Prefix Tuning Note: 作者在论文中提到使用真实的word去初始化prefix的操作(Initializing the prefix with activations of real words,significantly improves generation)。我在使用作者提供的

Andrew Zeng 4 Jul 11, 2022
Real time sign language recognition

The proposed work aims at converting american sign language gestures into English that can be understood by everyone in real time.

Mohit Kaushik 6 Jun 13, 2022
The official repo of the CVPR2021 oral paper: Representative Batch Normalization with Feature Calibration

Representative Batch Normalization (RBN) with Feature Calibration The official implementation of the CVPR2021 oral paper: Representative Batch Normali

Open source projects of ShangHua-Gao 76 Nov 09, 2022
This python-based package offers a way of creating a parametric OpenMC plasma source from plasma parameters.

openmc-plasma-source This python-based package offers a way of creating a parametric OpenMC plasma source from plasma parameters. The OpenMC sources a

Fusion Energy 10 Oct 18, 2022
End-To-End Optimization of LiDAR Beam Configuration

End-To-End Optimization of LiDAR Beam Configuration arXiv | IEEE Xplore This repository is the official implementation of the paper: End-To-End Optimi

Niclas 30 Nov 28, 2022
An unofficial PyTorch implementation of a federated learning algorithm, FedAvg.

Federated Averaging (FedAvg) in PyTorch An unofficial implementation of FederatedAveraging (or FedAvg) algorithm proposed in the paper Communication-E

Seok-Ju Hahn 123 Jan 06, 2023