Trim the model card: drop cross-model comparisons, cite the IJCV version
Browse files13 unmodified lines1415161718192021222324252627282930311 unmodified line3334353637383940414243444546474849505152535455565758596061622 unmodified lines656667686970717 unmodified lines7980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461476 unmodified lines15415515615715815916016114 unmodified lines17617717817918018118213 unmodified lines# STP: Spatiotemporal Predictive Pre-training for Robotic Motor ControlPre-trained visual encoder for robotic manipulation, from the paper**Spatiotemporal Predictive Pre-training for Robotic Motor Control**(IJCV 2026, [arXiv:2403.05304](https://arxiv.org/abs/2403.05304)).Official code: [MCG-NJU/STP](https://github.com/MCG-NJU/STP)STP pre-trains a **plain image ViT** on large-scale egocentric video (Ego4D /EgoClip) with **no** language, action, depth or teacher supervision. It jointlylearns content and motion features by predicting the masked current frame andthe masked future frame with a shared encoder and **decoupled dual decoders**.At evaluation the encoder is **frozen**, both decoders are discarded, and the`[CLS]` token is used as the visual representation for downstream policylearning.1 unmodified line| file | size | contents ||---|---|---|| `stp_vitb.pth` | ~558 MiB | model weights (encoder + both decoders), 146.34 M params || `stp_vitb_encoder.pth` | ~327 MiB | decoder-free encoder, for consumers using a plain timm ViT || `config.json` | small | architecture and pre-training recipe || `models_stp.py`, `util/` | small | model definition, so this repo is self-contained || `loader.py` | small | minimal `STPEncoder` wrapper |The full 1.75 GB training checkpoint (with AdamW optimizer state, for resumingpre-training) is available separately — see the repository.## Architecture| | ||---|---|| encoder | ViT-B/16, 12 layers, 12 heads, 768 dim, fixed sincos pos embed || spatial decoder | 8 blocks, 16 heads, 512 dim, transformer encoder blocks || temporal decoder | 8 blocks, 16 heads, 512 dim, self-attn + cross-attn + FFN || input | 224 × 224, ImageNet normalisation |The **spatial** branch masks the current frame at 75% and reconstructs it.The **temporal** branch masks the future frame at 95% and reconstructs it,conditioned on the current-frame feature `Z_c` used as a **fixed** key/value —so the future-frame query cannot write back into the current-framerepresentation. That asymmetry is the design that matters most: the ablationscores 63.7 for `self-cross` against 59.8 for `joint-self`.## Usage2 unmodified linesfrom models_stp import mae_vit_base_patch16from huggingface_hub import hf_hub_downloadpath = hf_hub_download('MCG-NJU/STP', 'stp_vitb.pth')model = mae_vit_base_patch16()model.load_state_dict(torch.load(path, map_location='cpu')['model'], strict=True)model.eval()7 unmodified lines```pythonfrom loader import STPEncoderenc = STPEncoder.from_pretrained('MCG-NJU/STP')feats = enc.encode([pil_image_1, pil_image_2]) # (N, 768)```Match the convention used by VC-1 and R3M: concatenate multi-view andmulti-frame features in the channel dimension together with the robot'sproprioceptive state, then train the policy. STP does not constrain the policyarchitecture — the paper evaluates MLPs, transformers, RVT-2 and ACT.```python# equivalent, without the hub packageimport torch, models_stpmodel = models_stp.mae_vit_base_patch16()model.load_state_dict(torch.load('stp_vitb.pth', map_location='cpu')['model'], strict=True)```## Pre-training recipeAdamW, base lr 1.5e-4, weight decay 0.05, betas (0.9, 0.95), cosine decay,50 epochs with 5 warmup, effective batch 4096, `RandomResizedCrop(0.8, 1.0)`plus horizontal flip, frame interval 16, mask ratios 75% / 95%, per-patchnormalised reconstruction target, MSE summed over both branches at 1:1 weight.Pre-training costs about 1.77× standard image MAE (34.53 vs 19.56 GFLOPs forViT-B/16 at 224²), thanks to the shallow temporal decoder and the 95% futuremasking.## ResultsWeighted average over five single-task simulation benchmarks (Meta-World,Franka-Kitchen, DMControl, Adroit, Trifinger), same pre-training datathroughout:| method | WA ||---|---|| **STP (frozen, ViT-B/16)** | **63.7** || MAE baseline | 59.6 || VC-1 | 61.8 || DINOv2 | 59.6 || CLIP | 55.6 || R3M | 54.9 |Language-conditioned multi-task: LIBERO-LONG 41.3 ± 0.3, RLBench 51.3 ± 1.4.Real-world (five tasks on a low-cost dual-arm robot): 49.3 in the standardenvironment, 46.3 with unseen distractors, against VC-1's 42.0 / 36.7.## Note on languageThis checkpoint is the **single-modality** variant. Despite the `lang_` in theoriginal research filename, it contains no language parameters. Adding languagenarration as a temporal-prediction condition *hurt* performance in the ablation(63.1 with language at the encoder vs 63.7 without), because of the modality gapbetween pre-training and single-modal downstream policies.## Intended useFrozen visual representation for behaviour-cloning policy learning in roboticmanipulation, especially few-shot regimes. The encoder is not fine-tuned in thepaper's main results; post-training the encoder on task data is a documentedalternative that performs better than end-to-end fine-tuning.Not intended for general-purpose vision tasks; it is an image-levelrepresentation optimised for manipulation.## Verification6 unmodified lines- `stp_vitb.pth` is bit-identical to the original training checkpoint in modelweights; only the optimizer state and AMP scaler were removed.- `stp_vitb_encoder.pth` loads into a plain `timm` `VisionTransformer`(`patch_size=16, embed_dim=768, depth=12, num_heads=12, qkv_bias=True`),with only the classification head unmatched, as expected for a frozen encoder.Two version notes if you load these yourself:14 unmodified linestitle = {Spatiotemporal Predictive Pre-training for Robotic Motor Control},year = {2026},volume = {134},number = {354},doi = {10.1007/s11263-026-02948-3},}```13 unmodified lines141516171819202122232425262728293031321 unmodified line343536373839404142434445464748495051525354555657582 unmodified lines616263646566677 unmodified lines757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141156 unmodified lines12212312412512612712812914 unmodified lines14414514614714814913 unmodified lines# STP: Spatiotemporal Predictive Pre-training for Robotic Motor ControlPre-trained visual encoder for robotic manipulation, from the paper published in*International Journal of Computer Vision* (2026):[10.1007/s11263-026-02948-3](https://link.springer.com/article/10.1007/s11263-026-02948-3)Official code: [MCG-NJU/STP](https://github.com/MCG-NJU/STP)STP pre-trains a plain image ViT on large-scale egocentric video (Ego4D /EgoClip), with no language, action, depth or teacher supervision. It jointlylearns content and motion features by reconstructing the masked current frameand the masked future frame, using a shared encoder with decoupled dualdecoders.At evaluation the encoder is frozen, both decoders are discarded, and the`[CLS]` token is used as the visual representation for downstream policylearning.1 unmodified line| file | size | contents ||---|---|---|| `stp_vitb.pth` | ~558 MiB | model weights (encoder + both decoders), 146.34 M parameters || `stp_vitb_encoder.pth` | ~327 MiB | decoder-free encoder, for use with a plain timm ViT || `config.json` | small | architecture and pre-training recipe || `models_stp.py`, `util/` | small | model definition, so this repo is self-contained || `loader.py` | small | minimal `STPEncoder` wrapper |## Architecture| | ||---|---|| encoder | ViT-B/16, 12 layers, 12 heads, 768 dim, fixed sincos positional embedding || spatial decoder | 8 blocks, 16 heads, 512 dim, transformer encoder blocks || temporal decoder | 8 blocks, 16 heads, 512 dim, self-attention + cross-attention + FFN || input | 224 × 224, ImageNet normalisation |The spatial branch masks the current frame at 75% and reconstructs it. Thetemporal branch masks the future frame at 95% and reconstructs it, conditionedon the current-frame feature `Z_c` used as a fixed key/value, so the future-framequery cannot write back into the current-frame representation.## Usage2 unmodified linesfrom models_stp import mae_vit_base_patch16from huggingface_hub import hf_hub_downloadpath = hf_hub_download('yangjiange/STP', 'stp_vitb.pth')model = mae_vit_base_patch16()model.load_state_dict(torch.load(path, map_location='cpu')['model'], strict=True)model.eval()7 unmodified lines```pythonfrom loader import STPEncoderenc = STPEncoder.from_pretrained('yangjiange/STP')feats = enc.encode([pil_image_1, pil_image_2]) # (N, 768)```Concatenate multi-view and multi-frame features in the channel dimensiontogether with the robot's proprioceptive state, then train the policy. STP doesnot constrain the policy architecture.## Pre-training recipeAdamW, base learning rate 1.5e-4, weight decay 0.05, betas (0.9, 0.95), cosinedecay, 50 epochs with 5 warmup epochs, effective batch size 4096,`RandomResizedCrop(0.8, 1.0)` with horizontal flip, frame interval 16, maskratios 75% / 95%, per-patch normalised reconstruction target, MSE summed overboth branches with 1:1 weight.Pre-training costs about 1.77× standard image MAE (34.53 vs 19.56 GFLOPs forViT-B/16 at 224²), owing to the shallow temporal decoder and the 95% futuremasking.## Note on languageThis checkpoint is the single-modality variant and contains no languageparameters. Adding language narration as a temporal-prediction conditionreduced performance in the paper's ablation, because of the modality gapbetween pre-training and single-modal downstream policies.## Intended useFrozen visual representation for behaviour-cloning policy learning in roboticmanipulation, particularly in few-shot regimes. The encoder is not fine-tuned inthe paper's main results; post-training the encoder on task data is a documentedalternative that performs better than end-to-end fine-tuning.It is not intended for general-purpose vision tasks.## Verification6 unmodified lines- `stp_vitb.pth` is bit-identical to the original training checkpoint in modelweights; only the optimizer state and AMP scaler were removed.- `stp_vitb_encoder.pth` loads into a plain `timm` `VisionTransformer`(`patch_size=16, embed_dim=768, depth=12, num_heads=12, qkv_bias=True`), withonly the classification head unmatched, as expected for a frozen encoder.Two version notes if you load these yourself:14 unmodified linestitle = {Spatiotemporal Predictive Pre-training for Robotic Motor Control},year = {2026},volume = {134},doi = {10.1007/s11263-026-02948-3},}```
README.md+37-70