Detecting bus delays and service anomalies in Niterói with autoencoder latent feature representations
Organizations: Systems and Computing Department, Federal University of Campina Grande (UFCG), Campina Grande, PB, Brazil
Abstract
Bus riders judge service by two failures: single trips that run late, and days on which the whole system misbehaves. We ask whether one unsupervised representation of raw GPS telemetry can serve both diagnoses on the NetMob 2026 Niterói bus dataset. An autoencoder compresses each trip into a 64-dimensional latent vector; the frozen encoder feeds supervised delay classifiers, and the reconstruction error serves as an anomaly score. Two findings are negative. First, the latent representation does not improve delay detection: gradient boosting on per-trip summary features reaches ROC-AUC against for the best latent setup, and the gap becomes significant once the preprocessing filters are relaxed. Second, two of the three external checks of the anomaly score were circular. Retraining without rainfall removes the rain association ( against flagged, ) and an apparent citywide disruption on 23 March. What survives is a day-level signal stable across three autoencoders (Spearman ), driven mostly by day type, with degraded-telemetry days still separable within weekday and weekend strata. The alarm threshold limits detection more than the score does: a pooled percentile cut flags of trips on the worst degraded day, while re-scaling within each bus line flags . The delay model rests almost entirely on one feature, no latent dimension is individually interpretable, and 22 chronic line-directions carry half of all delayed trips.
Figures & tables
| Gate | Threshold | Dropped | % |
|---|---|---|---|
| No GTFS match | no schedule join for trip id/direction | ||
| Too few points | GPS points | ||
| Implausible duration | outside min– h | ||
| Off-route | of points m from shape | ||
| Low stop coverage | matched stops or coverage | ||
| Multi-vehicle trip id † | same trip id served by several vehicles |
| Train / test split | ROC-AUC | PR-AUC |
|---|---|---|
| strict train, strict test | ||
| strict train, recovered test | ||
| relaxed train, strict test | ||
| relaxed train, all test |
| Representation | Classifier | ROC-AUC | PR-AUC | Precision | Recall | F1 |
|---|---|---|---|---|---|---|
| CNN-AE | MLP | |||||
| CNN-AE | XGBoost | |||||
| CNN-AE | RF | |||||
| CNN-AE | LR | |||||
| CNN-AE | LSTM | |||||
| CNN-AE | GRU |
| Comparison | Metric | Difference | ||
|---|---|---|---|---|
| CNN-AE+XGBoost vs RAW-STATS+XGBoost | ROC-AUC | |||
| CNN-AE+XGBoost vs RAW-STATS+XGBoost | PR-AUC | |||
| CNN-AE+XGBoost vs RAW-FLAT+XGBoost | ROC-AUC | |||
| CNN-AE+XGBoost vs RAW-FLAT+XGBoost | PR-AUC | |||
| CNN-AE+RF vs RAW-STATS+RF | ROC-AUC | |||
| CNN-AE+RF vs RAW-STATS+RF | PR-AUC |
| ROC-AUC | PR-AUC | |||||||
|---|---|---|---|---|---|---|---|---|
| Dataset | Trips | Delayed | RAW-STATS | CNN-AE | ( ) | RAW-STATS | CNN-AE | ( ) |
| strict (reported) | ( ) | ( ) | ||||||
| stop rule relaxed | ( ) | ( ) | ||||||
| multi-vehicle merged | ( ) | ( ) | ||||||
| all gates relaxed | ( ) | ( ) | ||||||
| Latent dim | Conv blocks | ROC-AUC | PR-AUC |
|---|---|---|---|
| Route seen | ROC-AUC | PR-AUC | Skill retained |
|---|---|---|---|
| Validation | With rainfall | Without rainfall | Verdict |
|---|---|---|---|
| Degraded days (20, 22 Mar), median score | vs | vs | survives |
| one-sided Mann–Whitney | |||
| Rain-hour flag rate vs dry | vs | vs | does not survive |
| significance | |||
| 23 Mar 15:30–17:00 window, median score | does not survive | ||
| trips in global top-20 |
| AE input | ROC-AUC | PR-AUC | recon. AUC |
|---|---|---|---|
| 12 ch., no schedule | |||
| start deviation | |||
| median stop delay |
| Stratum | Degraded median | Normal median | one-sided |
|---|---|---|---|
| Weekdays | ( ) | ( ) | |
| Weekends | ( ) | ( ) | |
| 22 Mar vs other Sundays | ( ) | ( ) |
| Rule | Overall | 22 Mar | Lift |
|---|---|---|---|
| global-p95 | |||
| dynamic | |||
| per-line | |||
| per-hour |
Anomaly Detection
Anomaly detection finds rare or unexpected patterns in data, from defective products and system faults to fraud and security threats.
See all 654 papers