Upload IKTM model card and MIT-licensed checkpoint
Browse files- LICENSE +21 -0
- README.md +118 -0
- iktm_model.pt +3 -0
- scaling_stats.npy +3 -0
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 Max Amiri
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: pytorch
|
| 3 |
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- trajectory-generation
|
| 6 |
+
- time-series
|
| 7 |
+
- transformer
|
| 8 |
+
- industrial-mobility
|
| 9 |
---
|
| 10 |
+
|
| 11 |
+
# IKTM
|
| 12 |
+
|
| 13 |
+
The Industrial Kinematic Trajectory Model (IKTM) generates autoregressive
|
| 14 |
+
kinematic trajectories for industrial vehicles. It models speed and change in
|
| 15 |
+
heading without absolute coordinates, so the model is location-invariant.
|
| 16 |
+
|
| 17 |
+
This is a research release. It is not a `transformers` model and cannot be
|
| 18 |
+
loaded with `transformers.from_pretrained`.
|
| 19 |
+
|
| 20 |
+
## Files
|
| 21 |
+
|
| 22 |
+
| File | Description |
|
| 23 |
+
|---|---|
|
| 24 |
+
| `iktm_model.pt` | Production probabilistic, duration-conditioned causal Transformer checkpoint. This is the best-validation checkpoint, not the epoch-30 final state. |
|
| 25 |
+
| `scaling_stats.npy` | Speed-normalisation statistics from the Site A training split. |
|
| 26 |
+
|
| 27 |
+
The checkpoint is a native PyTorch checkpoint rather than a Hugging Face
|
| 28 |
+
Transformers model. It contains the model state and the configuration needed
|
| 29 |
+
by the IKTM implementation, including the model dimensions, mixture sizes,
|
| 30 |
+
duration conditioning flag, and speed mean and standard deviation.
|
| 31 |
+
|
| 32 |
+
## Model
|
| 33 |
+
|
| 34 |
+
- 30 training epochs; the retained checkpoint is the best-validation state
|
| 35 |
+
(epoch 24).
|
| 36 |
+
- Decoder-only causal Transformer.
|
| 37 |
+
- Probabilistic output: a Gaussian mixture for speed and a von Mises mixture
|
| 38 |
+
for change in heading, together with a stop probability.
|
| 39 |
+
- Inputs: normalised speed, sine and cosine of heading change, a beginning-of-
|
| 40 |
+
sequence flag, and a remaining-duration feature.
|
| 41 |
+
- Three Gaussian speed-mixture components and five von Mises heading-mixture
|
| 42 |
+
components.
|
| 43 |
+
- 60-step maximum context and 128-dimensional hidden representation.
|
| 44 |
+
|
| 45 |
+
## Intended use
|
| 46 |
+
|
| 47 |
+
IKTM is intended for research on synthetic industrial-vehicle trajectory
|
| 48 |
+
generation, kinematic simulation, and evaluation of cross-site transfer. It
|
| 49 |
+
generates speed and heading-change sequences, not absolute positions, routes,
|
| 50 |
+
or maps.
|
| 51 |
+
|
| 52 |
+
## Training data and procedure
|
| 53 |
+
|
| 54 |
+
The model was trained on anonymised Site A industrial-vehicle telematics. The
|
| 55 |
+
data was cleaned and resampled to one-second kinematic time series. Training,
|
| 56 |
+
validation, and test devices used a fixed 70/15/15 device-level split with
|
| 57 |
+
seed 42; raw trajectories and site identifiers are confidential and are not
|
| 58 |
+
included here.
|
| 59 |
+
|
| 60 |
+
Training used AdamW with learning rate `1e-3`, weight decay `1e-4`, batch size
|
| 61 |
+
128, and a cosine learning-rate schedule. The loss combines probabilistic
|
| 62 |
+
speed and heading likelihoods, stop binary cross-entropy, and a duration-prior
|
| 63 |
+
likelihood. The checkpoint contains the learned duration prior.
|
| 64 |
+
|
| 65 |
+
## Evaluation
|
| 66 |
+
|
| 67 |
+
The following values use the held-out test protocol and temperature `T=0.2`.
|
| 68 |
+
Teacher-forced metrics are reported for the production checkpoint; rollout
|
| 69 |
+
metrics use 100 samples from the beginning-of-sequence token with seed 42.
|
| 70 |
+
|
| 71 |
+
| Site | Split | Speed RMSE, teacher-forced (m/s) | Heading RMSE, teacher-forced (degrees) | Turn-rate JSD, rollout (bits) |
|
| 72 |
+
|---|---|---:|---:|---:|
|
| 73 |
+
| Site A | ID test | 0.1178 | 21.3432 | 0.0390 |
|
| 74 |
+
| Site B | zero-shot OOD | 0.1281 | 19.6080 | 0.0569 |
|
| 75 |
+
| Site C | zero-shot OOD | 0.1413 | 20.7127 | 0.0310 |
|
| 76 |
+
| Site D | zero-shot OOD | 0.1509 | 23.4554 | 0.0329 |
|
| 77 |
+
|
| 78 |
+
All 100 Site A rollouts stopped naturally and matched their sampled target
|
| 79 |
+
duration, with length error `+0.0 +/- 0.0` seconds. The rollout metrics are
|
| 80 |
+
distributional diagnostics, not guarantees for an individual generated
|
| 81 |
+
trajectory.
|
| 82 |
+
|
| 83 |
+
## Limitations and responsible use
|
| 84 |
+
|
| 85 |
+
- The model was trained on one industrial site and evaluated zero-shot on
|
| 86 |
+
three other sites. It may not represent other fleets, operating policies,
|
| 87 |
+
vehicle types, or environments.
|
| 88 |
+
- It has no absolute-coordinate, road-network, obstacle, or route-intent
|
| 89 |
+
information. Generated sequences should not be interpreted as safe paths.
|
| 90 |
+
- Do not use this checkpoint for real-time vehicle control, collision
|
| 91 |
+
avoidance, safety decisions, or operational planning without independent
|
| 92 |
+
validation and appropriate safety systems.
|
| 93 |
+
- The training data contains industrial mobility patterns. The release omits
|
| 94 |
+
raw telematics and site identifiers to preserve confidentiality.
|
| 95 |
+
|
| 96 |
+
## Loading
|
| 97 |
+
|
| 98 |
+
The checkpoint requires the IKTM model implementation in `scripts/models.py`.
|
| 99 |
+
For the full evaluation and generation workflow, use the project repository's
|
| 100 |
+
`scripts/evaluate_generator.py` and point it at this checkpoint after placing
|
| 101 |
+
it at the expected model path.
|
| 102 |
+
|
| 103 |
+
```python
|
| 104 |
+
import torch
|
| 105 |
+
|
| 106 |
+
checkpoint = torch.load(
|
| 107 |
+
"iktm_model.pt",
|
| 108 |
+
map_location="cpu",
|
| 109 |
+
weights_only=False,
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
print(checkpoint.keys())
|
| 113 |
+
print(checkpoint["speed_mean"], checkpoint["speed_std"])
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
The model is intended for research use with the accompanying IKTM code and
|
| 117 |
+
evaluation protocol.
|
| 118 |
+
|
| 119 |
+
## License
|
| 120 |
+
|
| 121 |
+
This model is released under the [MIT License](LICENSE).
|
iktm_model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c4f8bb5b3282994207b48ba415950d96e1acf2260a8446d78590e9550ac1f7d1
|
| 3 |
+
size 9743306
|
scaling_stats.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35f1dc77f1014004e45b418a84011432ed450dfd72ad58f317cd602361aa020f
|
| 3 |
+
size 321
|