Giter Site home page Giter Site logo

prnet's Introduction

Project of PrNet

The codes are the implementation of the following paper:

Weng, X., Ling, K. V., & Liu, H. (2024). PrNet: A neural network for correcting pseudoranges to improve positioning with android raw GNSS measurements. IEEE Internet of Things Journal.

Overview

PrNet is a neural network ๐Ÿค– for correcting pseudoranges to improve positioning with Android ๐Ÿ“ฑ raw GNSS ๐Ÿ›ฐ๏ธ measurements. This repository includes the pre-processing/post-processing codes, the codes of PrNet, and the data set.

Requirement

Pre-processing and post-processing codes:

  • MATLAB

PrNet codes:

  • Ubuntu 18.04.6 LTS or later
  • Python 3.8.13 or later

Data

We use the open data set for Google Smartphone Decimeter Challenge (GSDC) 2021 to evaluate our method. We use the dataset to design four scenarios in tow areas, including

  • Rural Areas ๐Ÿš—๐Ÿ›ฃ๏ธ
    • Fingerprinting: Interstate 280 (I-280) highway between San Bruno and Mountain View, U.S. Highway 101 between Brisbane and Mountain View
    • Cross-trace: Mountain View City
  • Urban Areas ๐Ÿš—๐Ÿฌ
    • Fingerprinting: Downtown San Jose City
    • Cross-trace: Downtown San Jose City

Our data are put under:

  `PrNet/Data/RouteR or RouteU`

Pre-processing Android Raw GNSS Measurements

The pre-processing codes (MATLAB) are used to generate training and testing data from the original GSDC dataset. These codes are based on our androidGnss repository.

The codes are put under:

`PrNet/GNSS_opensource_software`

The main entrance for rural fingerprinting positioning is

`PrNet/GNSS_opensource_software/ProcessGnssMeasScriptGnssNet_Dynamic_PrNet_MTV.m`

The main entrance for rural cross-trace, urban fingerprinting, and urban cross-trace positioning is

`PrNet/GNSS_opensource_software/ProcessGnssMeasScriptGnssNet_Dynamic_PrNet_SJC.m`

Get started (using rural fingerprinting positioning as an example):

  • Step 1: Set the directory of your Android raw GNSS data file in ProcessGnssMeasScriptGnssNet_Dynamic_PrNet_MTV.m, e.g.:

    `dirName ='../Data/RouteR/GSDC/2020-05-29-US-MTV-1'`;
    
  • Step 2: Specify the name of your Android raw GNSS data file in ProcessGnssMeasScriptGnssNet_Dynamic_PrNet_MTV.m, e.g.:

    `prFileName = 'Pixel4_GnssLog.txt'`;
    
  • Step 3: Specify the name of the ground truth data file, e.g.:

    `gtNmeaFileName = 'SPAN_Pixel4_10Hz.nmea'`;
    
  • Step 4: Run ProcessGnssMeasScriptPrNet.m to process Android raw GNSS measurements;

  • Step 5: The processed files contain the input features and labels and can be found in the directory specified by dirName. While one of them has a header, the other one only consists of data. For example:

    `SvPVT3D_Error_label_dynamic_2020-05-29-US-MTV-1.csv` with a header
    `SvPVT3D_Error_label_dynamic_data_2020-05-29-US-MTV-1.csv` without a header
    

PrNet Implementation

PrNet is based on a simple Multilayer perceptron (MLP) structure and implemented using PyTorch and d2l libraries.

The related code is included under:

  `PrNet/Neural_Pseudorange_Correction`

And the weights we trained are stored in:

  `PrNet/Neural_Pseudorange_Correction/Weights/RouteR or RouteU`

Get started:

  • Step 1: Create the conda environment, use:

    `conda env create -f environment.yml`
    
  • Step 2: Open the Jupyter notebook under:

    `PrNet/Neural_Pseudorange_Correction/PrNet_MultipleFile_parallel.ipynb`
    
  • Step 3: Set the directory for training data files, e.g.,

    `training_data_dir = "../Data/RouteR/Training/"`
    
  • Step 4: Config the number of training epochs and learning rate in the cell "Training Process", e.g.,

    `num_epochs, lr = 500, 0.01`
    
  • Step 5: Run the cell "Training Process" to train PrNet. The trained model will be saved under the same root directory, e.g.,

    `PrNet/Neural_Pseudorange_Correction/PrNet_Layer20_H40_heading_500.tar`
    
  • Step 6: Set the directory for the testing data file in the cell "Evaluation Process", e.g.,

    `data_file_eval = "../Data/RouteR/Testing/SvPVT3D_Error_label_dynamic_2020-05-14-US-MTV-1.csv"`
    
  • Step 7: Load the weight file, e.g.,

    `checkpoint = torch.load('PrNet/Neural_Pseudorange_Correction/PrNet_Layer20_H40_heading_500.tar')
     model_eval.load_state_dict(checkpoint['model_state_dict'])`
    
  • Step 8: Run the cell "Evaluation Process" to evaluate PrNet. The predicted pseudorange errors will be logged into a .csv file, e.g.,

    `PrNet/Neural_Pseudorange_Correction/PrM_Bias_2020-05-14-US-MTV-1.csv`
    

Post-processing Android Raw GNSS Measurements

The post-processing codes (MATLAB) are used to calculate locations using Android raw GNSS measurements and the pseudorange errors predicted by PrNet. The codes are generally same as the pre-processing codes.

The codes are put under:

`PrNet/GNSS_opensource_software`

The main entrance for rural fingerprinting positioning is

`PrNet/GNSS_opensource_software/ProcessGnssMeasScriptGnssNet_Dynamic_PrNet_MTV_test.m`

The main entrance for rural cross-trace, urban fingerprinting, and urban cross-trace positioning is

`PrNet/GNSS_opensource_software/ProcessGnssMeasScriptGnssNet_Dynamic_PrNet_SJC_test.m`

Get started (using rural fingerprinting positioning as an example):

  • Step 1: Put the predicted pseudorange error file to the root directory of MATLAB codes, e.g.,

    PrNet/GNSS_opensource_software/PrM_Bias_2020-05-14-US-MTV-1.csv

  • Step 2: Modify the following line of codes in GpsWlsPvtEKF_test.m:

    `#103 GT_data = load('PrM_Bias_2020-05-14-US-MTV-1.csv');
    
  • Step 3: Run ProcessGnssMeasScriptGnssNet_Dynamic_PrNet_MTV_test.m to get the positioning results.

prnet's People

Contributors

ailocar avatar

Stargazers

 avatar  avatar poiwu avatar  avatar Scotty Nelson avatar Peijun Bao avatar  avatar  avatar George Liu avatar

Watchers

yuanhong avatar  avatar

Forkers

arenas7307979

prnet's Issues

Issue with Loss Convergence During Training

I have been training my GNSS network using the following setup:

num_epochs_seq = [1000, 1000, 1000, 1000, 1000]
and
num_epochs_seq = [100, 100, 100, 100, 100]

Despite training for a substantial number of epochs, I am unable to achieve loss convergence. No matter how many epochs I train, the loss remains stagnant.

Has anyone else experienced similar issues with their data? Is this behavior consistent with your testing results? Any insights or suggestions to resolve this would be greatly appreciated.

Thank you!

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.