Uncertain machine learning framework for GPS/GNSS sensor fusion
Project description
GeoFusion
An uncertain machine learning framework for GPS/GNSS sensor fusion.
GeoFusion estimates true location events from noisy phone-reported GPS coordinates by modelling each observation as an uncertain object, clustering by location event, and fusing the cluster into a refined position estimate.
Installation
pip install geofusion
Quick start
import pandas as pd
from geofusion import run_geofusion
df = pd.read_csv("sample_top100_groups.csv")
# UK-medoids (mountain uncertainty model) + Kalman filter
result = run_geofusion(
df = df,
model = "mountain",
algorithm = "ukmedoids",
algo_params = dict(k=100, random_state=42, n_init=10, n_samples=50),
estimator = "kf",
)
print(result)
# GeoFusionResult(
# model='mountain' algorithm='ukmedoids' estimator='kf'
# nc=100 V=2.75m H=1.54m MAE=3.43m
# runtime=4.5s peak_RAM=152.1MB
# )
# Access the output dataframe and metrics
df_out = result.df_out # original columns + predicted_cluster + predicted_location
metrics = result.metrics # {'V': ..., 'H': ..., 'MAE': ...}
Uncertainty models
model |
Description | Compatible algorithms |
|---|---|---|
certain |
Raw phone coordinates, no uncertainty | kmeans, kmedoids, sdsgc |
volcano |
Isotropic sigma from satellite geometry cost J_avg (El Abbous & Samanta, 2017) | ukmeans, ukmedoids |
mountain |
Directional Student-t scale from multivariate regression on GSDC dataset | ukmeans, ukmedoids |
Clustering algorithms
algorithm |
Description |
|---|---|
kmeans |
k-means++ (sklearn) |
kmedoids |
k-medoids with k-medoids++ initialisation |
ukmeans |
UK-means (Chau et al., 2006) — provably equivalent to k-means on GPS data |
ukmedoids |
UK-medoids (Gullo et al., 2008) with Monte Carlo expected-distance estimation |
sdsgc |
Structured Doubly Stochastic Graph-Based Clustering (Wang et al., TNNLS 2025) |
Estimators
estimator |
Description |
|---|---|
rep |
Cluster representative (centroid or medoid) |
kf |
Linear Kalman filter (static target, degree space) |
ekf |
Extended Kalman filter (local metre space — corrects degree-space distortion) |
pf |
Sequential Importance Resampling particle filter |
dnn |
Post-clustering MLP predicting a position correction from cluster-level GNSS features |
Required dataset columns
| Column | Description |
|---|---|
collectionName |
Drive identifier (used for DNN drive-level split) |
latDeg_gt |
NovAtel reference latitude (degrees) |
lngDeg_gt |
NovAtel reference longitude (degrees) |
latDeg_phone |
Phone-reported latitude (degrees) |
lngDeg_phone |
Phone-reported longitude (degrees) |
j_avg |
Average satellite geometry cost |
speedMps |
Vehicle speed (m/s) |
n_signals |
Number of satellite signals |
avg_rawPrUnc |
Average pseudorange uncertainty (m) |
hDop |
Horizontal dilution of precision |
vDop |
Vertical dilution of precision |
avg_iono |
Average ionospheric delay (m) |
avg_tropo |
Average tropospheric delay (m) |
The dataset is publicly available on Kaggle.
algo_params reference
All algorithms accept k, random_state, n_init, max_iter.
Additional parameters:
ukmedoids:n_samples(Monte Carlo samples for expected distance, default 50)sdsgc:nn(nearest neighbours, default 5 for k≤50, 4 for k≥100),strategy(early_stop/best_of_n/threshold),threshold(W-matrix threshold for component extraction),eigsh_tol,eigsh_maxiter
estimator_params reference
pf:n_particles(default 500)dnn:test_drives(required),val_drives(required),max_epochs(200),patience(20),random_state(42),subprocess(False — set True for clean RAM measurement)
DNN example
result = run_geofusion(
df = df,
model = "mountain",
algorithm = "ukmedoids",
algo_params = dict(k=300, random_state=42, n_init=10, n_samples=50),
estimator = "dnn",
estimator_params = dict(
test_drives = ["2020-08-03-US-MTV-1", "2020-07-08-US-MTV-1", "2021-04-15-US-MTV-1"],
val_drives = ["2021-04-28-US-MTV-1", "2021-04-28-US-SJC-1"],
max_epochs = 200,
patience = 20,
),
)
# DNN metrics are evaluated on test-drive clusters only
print(result.metrics) # {'V': 2.05, 'H': 1.40, 'MAE': 2.71, 'n_test_clusters': 69}
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geofusion-0.1.0.tar.gz.
File metadata
- Download URL: geofusion-0.1.0.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c509d2962a7ab88f097968824e92a18d30e9dcf86682a02fdb3260f3980a320d
|
|
| MD5 |
a7c6f092df863477cb19c5b00f622988
|
|
| BLAKE2b-256 |
bdf271a4890ff406abcb70a949fc9b8d95a4237152419a9c63b8f9f4df61c9ad
|
File details
Details for the file geofusion-0.1.0-py3-none-any.whl.
File metadata
- Download URL: geofusion-0.1.0-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1efe7d1e7d15d49980682f37ea0afad08b72fbd4af44b7e488df24b24c55776
|
|
| MD5 |
6c08c57c2ba6ee93cf89daf26a524d30
|
|
| BLAKE2b-256 |
14ec56d71a2d933c55e2f7a7475ee4f3a6c47837dfedaf15c4fa1b08ca8a7be0
|