TactiWeave-VP implements the following sequence classifier:
tactile frames ── shared ResNet-18 ── visual projection ──┐
├─ frame-wise fusion
physical states ───────── physical MLP ──────────────────┘
└─ causal TCN ── attention pooling ── classifier ── logits
The implementation lives in model/ and uses [batch, time, features] for sequence features.
For frame t, the aligned observation is
The six metadata fields, in model order, are Fx, Fy, Fz, F2D, mu, and area. The physical vector is standardized with training-split statistics only:
where m and s are the population mean and standard deviation computed from unique training frames. The saved statistics are reused unchanged for validation, testing, offline inference, and real-time inference.
All frames share one ResNet-18. The batch and time dimensions are flattened to process the frames together:
The classification layer is removed. For ImageNet initialization, the first RGB convolution weights are averaged across the channel dimension to initialize the single input channel. A projection produces a 256-dimensional visual token:
with r_t in R^512 and v_t in R^256.
The normalized six-dimensional state passes through a two-layer MLP:
The default dimensions are 6 -> 64 -> 128, so s_t is a 128-dimensional physical token.
Aligned visual and physical tokens are concatenated at each time step and projected back to 256 dimensions:
corresponding to 256 + 128 -> 256. Invalid padded positions, when a mask is supplied, are zeroed before temporal encoding.
The fused sequence is processed by four residual TCN blocks. Each block contains two left-padded causal 1-D convolutions, GELU activation, dropout, and a residual connection. Defaults are:
- hidden dimension: 256;
- kernel size: 3;
- block dilations:
(1, 2, 4, 8); - convolution dropout: 0.2.
A causal convolution at time t reads only the current and previous positions. With two convolutions per residual block, the temporal receptive field is
The TCN preserves sequence length and returns h_t in R^256 for every frame.
Attention pooling converts the temporal features into one fixed-size vector:
where V is the set of valid positions from the optional mask. The weights are non-negative and sum to one over valid positions.
The classifier is Linear(256, 128) -> GELU -> Dropout(0.3) -> Linear(128, C). It returns unnormalized logits. Training passes those logits directly to cross-entropy loss; probabilities are computed only when needed for inference or reporting.
| Stage | Per-frame or per-sequence shape |
|---|---|
| Tactile image | 1 x 350 x 350 per frame |
| ResNet-18 feature | 512 per frame |
| Visual token | 256 per frame |
| Physical input/token | 6 -> 128 per frame |
| Concatenated/fused token | 384 -> 256 per frame |
| Causal TCN output | 256 per frame |
| Attention-pooled feature | 256 per sequence |
| Classifier output | C logits per sequence |
See Data pipeline for how aligned sequences are built and Usage for training and inference commands.