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.

Official code for "Simpler is Better: Few-shot Semantic Segmentation with Classifier Weight Transformer. ICCV2021".

Simpler is Better: Few-shot Semantic Segmentation with Classifier Weight Transformer. ICCV2021. Introduction We proposed a novel model training paradi

Lucas 103 Dec 14, 2022
基于pytorch构建cyclegan示例

cyclegan-demo 基于Pytorch构建CycleGAN示例 如何运行 准备数据集 将数据集整理成4个文件,分别命名为 trainA, trainB:训练集,A、B代表两类图片 testA, testB:测试集,A、B代表两类图片 例如 D:\CODE\CYCLEGAN-DEMO\DATA

Koorye 3 Oct 18, 2022
Official implementation of EdiTTS: Score-based Editing for Controllable Text-to-Speech

EdiTTS: Score-based Editing for Controllable Text-to-Speech Official implementation of EdiTTS: Score-based Editing for Controllable Text-to-Speech. Au

Neosapience 98 Dec 25, 2022
A Python toolbox to create adversarial examples that fool neural networks in PyTorch, TensorFlow, and JAX

Foolbox Native: Fast adversarial attacks to benchmark the robustness of machine learning models in PyTorch, TensorFlow, and JAX Foolbox is a Python li

Bethge Lab 2.4k Dec 25, 2022
Official repository of IMPROVING DEEP IMAGE MATTING VIA LOCAL SMOOTHNESS ASSUMPTION.

IMPROVING DEEP IMAGE MATTING VIA LOCAL SMOOTHNESS ASSUMPTION This is the official repository of IMPROVING DEEP IMAGE MATTING VIA LOCAL SMOOTHNESS ASSU

电线杆 14 Dec 15, 2022
P-Tuning v2: Prompt Tuning Can Be Comparable to Finetuning Universally Across Scales and Tasks

P-tuning v2 P-Tuning v2: Prompt Tuning Can Be Comparable to Finetuning Universally Across Scales and Tasks An optimized prompt tuning strategy for sma

THUDM 540 Dec 30, 2022
Unofficial PyTorch implementation of MobileViT based on paper "MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer".

MobileViT RegNet Unofficial PyTorch implementation of MobileViT based on paper MOBILEVIT: LIGHT-WEIGHT, GENERAL-PURPOSE, AND MOBILE-FRIENDLY VISION TR

Hong-Jia Chen 91 Dec 02, 2022
This repository includes the code of the sequence-to-sequence model for discontinuous constituent parsing described in paper Discontinuous Grammar as a Foreign Language.

Discontinuous Grammar as a Foreign Language This repository includes the code of the sequence-to-sequence model for discontinuous constituent parsing

Daniel Fernández-González 2 Apr 07, 2022
Unofficial implementation of One-Shot Free-View Neural Talking Head Synthesis

face-vid2vid Usage Dataset Preparation cd datasets wget https://yt-dl.org/downloads/latest/youtube-dl -O youtube-dl chmod a+rx youtube-dl python load_

worstcoder 68 Dec 30, 2022
PyTorch implementation of U-TAE and PaPs for satellite image time series panoptic segmentation.

Panoptic Segmentation of Satellite Image Time Series with Convolutional Temporal Attention Networks (ICCV 2021) This repository is the official implem

71 Jan 04, 2023
Pytorch Implementation of "Desigining Network Design Spaces", Radosavovic et al. CVPR 2020.

RegNet Pytorch Implementation of "Desigining Network Design Spaces", Radosavovic et al. CVPR 2020. Paper | Official Implementation RegNet offer a very

Vishal R 2 Feb 11, 2022
Official implementation of CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification

CrossViT This repository is the official implementation of CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification. ArXiv If

International Business Machines 168 Dec 29, 2022
Pytorch implementation of “Recursive Non-Autoregressive Graph-to-Graph Transformer for Dependency Parsing with Iterative Refinement”

Graph-to-Graph Transformers Self-attention models, such as Transformer, have been hugely successful in a wide range of natural language processing (NL

Idiap Research Institute 40 Aug 14, 2022
Mercury: easily convert Python notebook to web app and share with others

Mercury Share your Python notebooks with others Easily convert your Python notebooks into interactive web apps by adding parameters in YAML. Simply ad

MLJAR 2.2k Dec 27, 2022
Official repository for "On Generating Transferable Targeted Perturbations" (ICCV 2021)

On Generating Transferable Targeted Perturbations (ICCV'21) Muzammal Naseer, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Fatih Porikli Paper:

Muzammal Naseer 46 Nov 17, 2022
This repo provides code for QB-Norm (Cross Modal Retrieval with Querybank Normalisation)

This repo provides code for QB-Norm (Cross Modal Retrieval with Querybank Normalisation) Usage example python dynamic_inverted_softmax.py --sims_train

36 Dec 29, 2022
[TNNLS 2021] The official code for the paper "Learning Deep Context-Sensitive Decomposition for Low-Light Image Enhancement"

CSDNet-CSDGAN this is the code for the paper "Learning Deep Context-Sensitive Decomposition for Low-Light Image Enhancement" Environment Preparing pyt

Jiaao Zhang 17 Nov 05, 2022
Visualizing lattice vibration information from phonon dispersion to atoms (For GPUMD)

Phonon-Vibration-Viewer (For GPUMD) Visualizing lattice vibration information from phonon dispersion for primitive atoms. In this tutorial, we will in

Liangting 6 Dec 10, 2022
AI-based, context-driven network device ranking

Batea A batea is a large shallow pan of wood or iron traditionally used by gold prospectors for washing sand and gravel to recover gold nuggets. Batea

Secureworks Taegis VDR 269 Nov 26, 2022
Consensus score for tripadvisor

ContripScore ContripScore is essentially a score that combines an Internet platform rating and a consensus rating from sentiment analysis (For instanc

Pepe 1 Jan 13, 2022