Research
ClothCode: Generative Modeling for Garment State Estimation and Dynamics Prediction
Robots that manipulate cloth must guess the full 3D shape of a garment from a partial, self-occluded camera view, and must predict how that garment will deform in response to a candidate action…

- arXiv
- 2610.14200 · Preprint · not peer-reviewed
- Published
- 2026-10-09
- Authors
- Yingdong Ru, Lipeng Zhuang, Shiyu Fan, Zhuo He, Florent P. Audonnet, Gerardo Aragon Camarasa
In plain words
Robots that manipulate cloth must guess the full 3D shape of a garment from a partial, self-occluded camera view, and must predict how that garment will deform in response to a candidate action — quickly enough to be queried many times inside a planning loop.
AI summary
Overview
Research area: Robotics — model-based deformable-object (cloth) manipulation, combining learned discrete generative modeling with model-predictive control.
Technical level: Advanced. The paper assumes familiarity with vector quantization, masked generative transformers, mesh representations, and sampling-based MPC, though its core idea can be grasped without that background.
Scope (one sentence): ClothCode proposes a single discrete token representation of garment shape, shared by two masked generative transformers, to estimate full garment state from partial views and to predict action-conditioned cloth dynamics fast enough for closed-loop real-robot folding and flattening (University of Glasgow; arXiv:2610.14200v1, cs.RO, 09 Oct 2026).
What This Paper Is About
Robots that manipulate cloth must guess the full 3D shape of a garment from a partial, self-occluded camera view, and must predict how that garment will deform in response to a candidate action — quickly enough to be queried many times inside a planning loop. Existing methods tend to be deterministic (producing a single, blurry "average" prediction under ambiguity) or diffusion-based (accurate but slow, because the entire dense vertex output is denoised repeatedly). ClothCode's goal is to make both perception and prediction accurate, fast, and generative by performing them in one shared, compact, discrete space of garment tokens.
Key Contributions
- A shared discrete garment configuration space. The mesh is split into 128 fixed, material-aligned patches (same vertices per patch across all deformations), each encoded as two residual vector-quantization (RVQ) indices from codebooks of 512 entries per level, shared across patches and decoded back to a full mesh by a topology-aware decoder.
- One representation, two masked generative transformers. Task-specific Masked Generative Transformers perform (a) full-state estimation from a partial point cloud with all garment tokens initially masked, and (b) action-conditioned dynamics prediction of 10 future configurations from 3 context configurations, both using confidence-guided iterative mask-and-refine.
- A large simulated benchmark with explicit generalization splits. 134,400 trajectories / 16,800 action instances across three templates in Isaac Sim 5.1 with Isaac Lab 2.2.1, with ID, Action-OOD (held-out regions of action-parameter space) and Physics-OOD (two of eight material configurations withheld from all training) evaluation settings.
- Closed-loop real-robot validation. The learned state and dynamics models are plugged into a CEM-based model-predictive controller on a Baxter robot with a single ZED 2i camera, and compared against substituting the prior state-of-the-art model in either or both roles.
Main Findings
- Lower dynamics error: ClothCode achieves the lowest MDE and EMD across all three garments and all splits, reducing them by 37.0% and 36.2% on average relative to the strongest baselines. Gains persist out of distribution: 40.2% MDE reduction under Action-OOD and 35.2% under Physics-OOD.
- Better multi-step rollouts: Over multi-window rollouts, MDE drops by 32.4% with oracle context and 34.1% in free (autoregressive) rollout mode.
- Much faster inference: Dynamics prediction takes 16.7 ms per window with four refinement steps, versus 556.2 ms for UniClothDiff with 100 denoising steps.
- Better state estimation: Relative to UniClothDiff (the strongest baseline), MDE, EMD and Chamfer distance fall by 26.6%, 36.8% and 29.2% on average; under Action-OOD the reductions are 23.9%, 36.2% and 29.2%. The largest single gain is the T-shirt under Action-OOD (40.0% MDE, 45.1% EMD, 38.0% Chamfer).
- EMD improves more than MDE: The relative EMD improvement exceeds the MDE improvement for every garment under both splits, which the authors read as better recovery of overall garment geometry rather than just local fit.
- Higher real-world success: Overall MPC success rises from 56.7% (UniClothDiff for both modules) to 78.9% with ClothCode for both. Replacing only the state estimator gives 68.9%; replacing only the dynamics model gives 67.2%.
- Different garments have different bottlenecks: With ClothCode dynamics fixed, swapping in ClothCode state estimation raises fabric success from 73.3% to 85.0%; with ClothCode state estimation fixed, swapping in ClothCode dynamics raises sweater success from 53.3% to 71.7%.
- Residual quantization matters: Under the same patch-wise representation, continuous latents give 0.175 cm MDE, single-level VQ worsens it to 0.367 cm, and two-level RVQ recovers to 0.187 cm while cutting P95 error from 1.503 cm to 0.787 cm.
- Discretization and iterative refinement are complementary: With one-shot prediction, discretization improves state MDE from 2.673 cm to 1.996 cm while staying competitive on dynamics (1.327 cm vs 1.300 cm). Masked iterative prediction then reaches 0.674 cm (dynamics) and 1.211 cm (state), i.e. 48.2% and 39.3% better than discrete one-shot, and 33.5% and 42.5% better than continuous iterative (diffusion) prediction.
Methodology in Plain English
The core bet is that although whole garments take wildly many shapes, local patches of fabric deform in repetitive ways. So the authors cut each garment template into 128 fixed patches that always contain the same material points, and train a small autoencoder to describe each patch with just two integer "codes" drawn from learned codebooks. A decoder then turns those codes back into vertices, using the mesh connectivity to keep the reconstruction coherent. This autoencoder is trained once per template and then frozen, becoming the shared language that both downstream tasks speak.
For state estimation, a transformer is given the visible point cloud plus a full set of garment tokens that start out masked, and it guesses the missing codes. For dynamics prediction, a second transformer is given the last three frames of codes plus a candidate end-effector trajectory, and it fills in the codes for ten future frames at once. Both are trained like a masked-language model: randomly hide a fraction of the target codes (with the fraction drawn from a cosine schedule), then predict them with cross-entropy.
At inference, both models use the same loop: predict all masked codes in parallel, keep the high-confidence guesses, re-mask the lowest-confidence ones, and repeat for four iterations. Because global position is factored out before tokenization, a separate small head predicts the garment centroid or future centroid displacements.
For control, OWLv2 and SAM2 segment the garment from one RGB-D frame, the state model reconstructs the full mesh and registers it with ICP, and a CEM sampling MPC rolls out 16 candidate action sequences over a horizon of 40 with the learned dynamics model, executing the first 10 steps before re-observing and replanning.
Why This Matters
The paper argues that the practical bottleneck for model-based cloth manipulation is not just accuracy but the cost of querying a dynamics model hundreds of times per control cycle, and that a shared discrete representation addresses accuracy and speed simultaneously rather than trading one for the other. It also provides an unusually explicit generalization study (held-out action regions and held-out physics) plus a controlled real-robot ablation isolating the contribution of perception versus prediction.
Real-world applications:
- Robotic laundry and household folding — folding and flattening are exactly the two tasks evaluated, on fabric sheets, T-shirts and sweaters.
- Apparel and textile manufacturing — automated handling of cut pieces, sleeves and whole garments where the material and size vary between items.
- Assistive and service robotics — manipulation of deformable household items by robots operating from a single fixed camera.
- Warehouse and logistics automation — grasping and reorienting soft goods, where partial visibility and self-occlusion are the norm.
Industry relevance: the 16.7 ms per-window inference cost is the difference between a dynamics model that can sit inside a real-time planning loop and one that cannot; combined with a single-camera, single-arm-plus-gripper setup on a Baxter, the pipeline is close to what a deployed system would need.
Future Directions
- Transferable discrete representations across unseen garment topologies. The current tokenizer is trained per template and frozen, and the authors explicitly list cross-topology transfer as future work — so how codes generalize to a garment with no trained template is not reported.
- Longer-horizon closed-loop manipulation. The controller replans every 10 executed steps over a horizon of 40; the paper leaves open how error compounds over substantially longer tasks and whether free-rollout drift can be better controlled.
- Material properties as an explicit conditioning signal. Physics-OOD (two of eight material configurations never seen in training) shows the largest remaining degradation, raising the question of whether inferred friction/stiffness should be fed to the dynamics transformer rather than left implicit.
- Integration with grasp selection and higher-level task specification. Grasps are sampled by a fixed heuristic inherited from UniClothDiff and folding/flattening targets are given as reconstructed observations, leaving joint grasp-and-motion optimization and language- or image-specified goals unexplored.
Target Audience
Robotics researchers and graduate students working on deformable-object manipulation, model-based control, or learned sim-to-real pipelines; generative-modeling researchers interested in discrete tokenization and masked iterative generation applied outside images and text; and industrial engineers evaluating whether learned cloth dynamics are fast and accurate enough to embed in a real picking-and-folding system. Readers without a robotics background can still follow the representation and generation ideas, but the MPC and evaluation details assume some familiarity with manipulation literature.
Authors’ abstract
We introduce ClothCode, a unified generative framework for garment state estimation and action-conditioned dynamics prediction in a shared discrete configuration space. A material-aligned tokenizer encodes garment configuration as residual vector-quantized patch tokens, while task-specific Masked Generative Transformers predict these tokens through parallel confidence-guided refinement. Across three garment templates, ClothCode reduces mean displacement error by 26.6% for…
The full abstract on arXivRelated papers
- FoldBack: Self-Correcting Masked Generative Policy for Long-Horizon Garment Folding 2026-10-07 · cs.RO · Also by Florent P. Audonnet, Gerardo Aragon Camarasa +4
- Masked Generative Motion Planning with Geometry-Guided Token Search 2026-10-07 · cs.RO · Also by Gerardo Aragon Camarasa, Lipeng Zhuang +2
- Bayesian Continuum Robot Dynamics and State Estimation 2026-09-17 · cs.RO · Key terms of the title in common
- Neural Networks for Temporal Pattern Recognition and Dynamic Arm Gesture Speed Estimation for Robot Control 2026-10-08 · cs.RO · Key terms of the title in common
- Predicting Cable Dynamics with Physical Attention Bias 2026-10-08 · cs.RO · Key terms of the title in common