MEKAWIRE
ExpertarXiv

LaGarNet: Latent World Models for Quasi-Static Pick-and-Place Garment Flattening

Halid A. Kadi, John Oyekan, Kasim Terzic
From the abstract

Manipulating cloth is a grand challenge in robotics: its many degrees of freedom yield an enormous state-action space that makes learning-based control extremely difficult to train. We present a goal-conditioned recurrent state-space model (GC-RSSM) that learns the latent dynamics of pick-and-place garment manipulation.

From the abstract. Our summary is in progress.

Full paper

LaGarNet: Latent World Models for Quasi-Static Pick-and-Place Garment Flattening

Halid A. Kadi, John Oyekan, Kasim Terzic

Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2611.37632 (PDF).

Abstract

Manipulating cloth is a grand challenge in robotics: its many degrees of freedom yield an enormous state-action space that makes learning-based control extremely difficult to train. We present a goal-conditioned recurrent state-space model (GC-RSSM) that learns the latent dynamics of pick-and-place garment manipulation. Unlike the velocity- and position-controlled settings where world models are usually studied, high-level pick-and-place is quasi-static: the garment rests between primitive actions, so consecutive observations are not temporally continuous and each transition is one large deformation. We show that a latent world model nonetheless learns useful dynamics in this regime; our method LaGarNet matches the state-of-the-art performance of mesh-based continuous planning methods on the difficult task of garment flattening whilst using five times fewer parameters and inferring over an order of magnitude faster. Trained on our proposed coverage-alignment reward and generalisable data-collection procedure, LaGarNet is, to our knowledge, the first integrated latent world model system to flatten four garment topologies with a single policy in the real world. Project website: https://st-cortex-lab.github.io/projects/lagarnet/

Index Terms:

Robot Learning, Cloth Manipulation, World Model, Model-Based Reinforcement Learning

I Introduction

Robotic manipulation of cloth-like deformable objects is a significant technical challenge with profound societal and economic implications. It is essential for garment manufacturing, domestic laundry, assistive care and sterile clinical handling, and it remains difficult because of cloth’s complex, underactuated dynamics. Garment flattening in particular is a foundational milestone preceding tasks such as folding, ironing, and pressing.

Two families of data-driven approaches dominate garment flattening. Behaviour cloning (BC) is conceptually simple, but the space of crumpled configurations is vast, and covering it demands an impractical volume of human demonstrations [2, 3, 4]; BC flatteners therefore require scripted oracles—which are almost impossible to engineer for garments—or narrow their scope to a single garment type. Reinforcement learning (RL) explores that distribution directly in simulation, enabling the most general flattening controllers [5, 6, 7, 8], almost always with model-free algorithms. Model-based RL, which learns and exploits a world model of the environment [9], remains rare on garments: cloth’s large degrees of freedom make such controllers extremely difficult to train, and effective world models have stayed elusive because of deformation and self-occlusion [10, 6].

Hence, we investigate whether latent world models can learn useful dynamics in quasi-static pick-and-place (PnP) garment flattening by adopting a top-down camera view and a single-gripper primitive. Contemporary behaviour-cloning and vision-language-action policies with dual-arm continuous setups struggle with long horizons and with the multi-modal action distributions of garment manipulation; a primitive compresses a whole reach-grasp-lift-place motion into four numbers, potentially reducing the state-action space that a policy needs to learn. Whilst dual-arm multi-primitive control flattens more effectively [11], a single arm keeps the study focused on the representation learning of the world model [7]. In addition, our human-in-the-loop experiments show operators flatten diverse garments exceptionally well with single-arm commands alone, indicating the primary bottleneck is reasoning about cloth deformation rather than the hardware or the action space; our LaGarNet’s latent dynamics model predicts and reasons about future observations of garment deformation and chooses which of the sampled action candidates to execute.

We present LaGarNet, a general single-policy method for flattening complex garments (Figure ). It mitigates the strong inductive biases of previous data-driven cloth manipulation methods [12, 2, 13], which rely on domain-specific architectures, reward functions, and datasets from a particular blend of expert and random oracle policies. LaGarNet instead integrates a novel goal-conditioned recurrent state-space model (GC-RSSM), a coverage-alignment reward and a general data-collection procedure into one system, to answer our central research question: can latent world models built for continuous control still function in quasi-static primitive setups, where consecutive observations are not temporally continuous?

Planning in a compact latent space, LaGarNet is competitive with human operators under the same single-arm constraint, although humans succeed more often at long horizons. In a zero-shot transfer to the real world, it averages 90% NC, 80% NI and 81% Max IoU on the real garments of Figure . Our contributions are:

1. We propose a goal-conditioned recurrent state-space model (GC-RSSM) that conditions the latent inference on the goal, making both prior and posterior latent states goal-aware.

2. We develop a data-collection strategy for offline PnP garment flattening, mixing a Diffusion Policy expert learned from few demonstrations with a mask-biased random policy. It replaces the scripted oracles offline RL usually depends on, supplying the action diversity and the near-success transitions a random policy rarely reaches.

3. We design a coverage-alignment reward for garment flattening, computable in both simulation and the real world.

Together these three components lift success rate on the simulated longsleeve benchmark within 20 actions from 6.7% for model-free RL, 23.3% for the closest RSSM planner and 43.3% for behaviour cloning to 76.7%, past the mesh-based MEDOR’s 70.0% at 17\times its inference speed.

II Related Work

Learning-based cloth flattening and folding span behaviour cloning [3, 2, 4, 15], model-free reinforcement learning (RL) [5, 6, 7, 8, 11] and model-based RL [10, 13, 17, 16]. Most successful controllers employ an explicit intermediate representation to mitigate self-occlusion, such as key points [3], seam features [4], a reconstructed mesh [16] or optical flow [2]. We instead learn a latent dynamics model and obtain actions by planning, so a single common representation covers several garment types. These systems also differ in action space, from low-level position control [5, 6] to pick-and-fling, pick-and-place (PnP) and pick-and-drag primitives, hybrids of which are highly effective [11, 7]. We deliberately keep a single-arm PnP setup, isolating our research question from the design choices a hybrid dual-arm action space introduces, and therefore neither evaluate nor compare against such setups.

Model-based methods for cloth are either mesh-based or mesh-free. Visible Connectivity Dynamics [17] reconstructs a mesh of the visible cloth for more precise planning, and MEDOR [16] extends this by recovering the occluded part from a top-down point cloud through test-time mesh fine-tuning against a garment template. Mesh-free planners such as Contrastive Forward Modelling [10] and Visual Foresight Modelling [13] learn latent or video-prediction dynamics instead, but show limited efficacy on garments and have not matched mesh-based VCD. LaGarNet is, to our knowledge, the first mesh-free planner to match mesh-based performance on garment flattening.

The latent dynamics model PlaNet [9], built on a recurrent state-space model (RSSM), is widely studied in continuous control, but its reconstructions blur the edge and corner detail that shaping needs [10, 17]. PlaNet-ClothPick [14] mitigates this with mask-restricted picks, a flattening-specific reward and an engineered offline dataset, but those same inductive biases stop it generalising beyond towels [12]. Previous work has goal-conditioned RSSMs: Pertsch et al. [18] condition a hierarchical predictor on subtask endpoints, and Duan et al. [19] condition actor-critic networks rather than the world model. We instead condition the latent inference itself, making both prior and posterior states goal-aware—Section IV-B isolates that choice against other goal-conditioning variants.

Reward engineering is essential to the success of RL controllers, and most garment-flattening systems come with their own reward function. ClothFunnels [7] interpolates a normalised delta deformation distance with a delta rigid distance, Learning2Unfold [8] mixes normalised coverage with an orientation term, and SpeedFolding [11] mixes delta coverage with a learned smoothness estimate. Our coverage-alignment reward combines coverage with the IoU difference between consecutive frames and requires only top-down segmentation masks; it is therefore computable identically in simulation and reality. The effectiveness of RL also depends on the diversity of the training trajectories [19]. Prior work draws trajectories from demonstrations [5], from corner-biased sampling that steers picks towards fabric corners and edges [13, 2], or from other engineered strategies [17]; each imposes a strong inductive bias. We instead mix a Diffusion Policy [15] learned from a few human demonstrations with a mask-biased random oracle for a more generalisable collection procedure.

III LaGarNet

LaGarNet is an offline model-based deep reinforcement learning approach to garment flattening, trained on simulation data with domain randomisation and transferred to real garments without any real-world fine-tuning. Its goal-conditioned recurrent state-space model (GC-RSSM) maintains a belief state over the partially observed garment configuration and scores how far each candidate action advances the task towards its goal [9]. Trained on a coverage-alignment reward and a unified data-collection procedure, it reaches state-of-the-art flattening performance from 100,000 offline transitions.

III-A Goal-Conditioned Recurrent State-Space Model

LaGarNet builds on State-Space Models (SSMs), generative frameworks for sequential data that support inferring future states and learning representations. Hafner et al. [9] define the Recurrent State-Space Model (RSSM) under the Partially Observable Markov Decision Process (POMDP) formulation, with latent state dynamics:

\displaystyle\text{Recurrent dynamic model:} \\ \displaystyle\bm{h}_{t}=f(\bm{h}_{t-1},\bm{z}_{t-1},\bm{a}_{t-1}) \\ \displaystyle\text{Representation model:} \\ \displaystyle\hat{\bm{z}}_{t}\sim q(\hat{\bm{z}}\;|\;\bm{h}_{t},\bm{x}_{t}) \\ \displaystyle\text{Transition predictor:} \\ \displaystyle\tilde{\bm{z}}_{t}\sim p(\tilde{\bm{z}}\;|\;\bm{h}_{t}),

where \bm{x} represents the observation, \bm{a} represents the action, \bm{h} represents the deterministic latent representation, and (\hat{\bm{z}}, \tilde{\bm{z}}) represent the posterior and prior stochastic latent states. In LaGarNet, the deterministic state \bm{h} and the stochastic state \bm{z} have 300 and 60 dimensions, respectively.

LaGarNet trains a goal-conditioned latent dynamics model by learning a feature representation \bm{y}, extending the RSSM with goal-aware inference and generation (Figure 2(a)): the goal observation \bm{g} enters the estimation of the stochastic latent state \bm{z}, defining the GC-RSSM as:

\displaystyle\hat{\bm{z}}_{t} \\ \displaystyle\sim q(\hat{\bm{z}}\;|\;\bm{h}_{t},\bm{x}_{t},\bm{g}) \\ \displaystyle\tilde{\bm{z}}_{t} \\ \displaystyle\sim p(\tilde{\bm{z}}\;|\;\bm{h}_{t},\bm{g})
(2) (3)

As shown in Figure 2(b), LaGarNet comprises four components with ReLU activations throughout: a convolutional image encoder, a transposed-convolutional decoder, a goal-conditioned transition model built from MLPs and a Gated Recurrent Unit, and a 5-layer MLP reward predictor. Training maximises the marginal log-likelihood of the estimated features and rewards given the action sequence and the goal observation, \argmax_{\theta}\ln p_{\theta}(\bm{y}_{1:T},r_{1:T}|\bm{a}_{1:T},\bm{g}). Treating this as variational inference over the factorised generative model \prod_{t}p(\bm{y}_{t}|\bm{z}_{t})p(r_{t}|\bm{z}_{t})p(\bm{z}_{t}|\bm{z}_{t-1},\bm{a}_{t-1},\bm{g}) and posterior \prod_{t}q(\bm{z}_{t}|\bm{x}_{1:t},\bm{a}_{1:t-1},\bm{g}) (in which the deterministic states \bm{h}_{t} are abstracted because they follow deterministically from previous states) gives the GC-RSSM evidence lower bound:

\displaystyle\mathcal{L}= \\ \displaystyle\sum_{t=1}^{T}\mathbb{E}_{q(\bm{z}_{1:t-1})}\Bigg[-\underset{\bm{z}_{t}\sim q}{\E}\Big[\ln p(\bm{y}_{t}|\bm{z}_{t})+\ln p(r_{t}|\bm{z}_{t})\Big] \\ \displaystyle+\text{KL}\Big[q(\bm{z}_{t}|\bm{x}_{1:t},\bm{a}_{1:{t-1}},\bm{g})\;\Big|\Big|\;p(\bm{z}_{t}|\bm{z}_{t-1},\bm{a}_{t-1},\bm{g})\Big]\Bigg].
(4)

The 64\times 64 goal image \bm{g} passes through the same convolutional encoder as the current observation to give the 1024-dimensional embedding \bm{e}_{g}. Then, we use the reparameterisation trick to sample \bm{z}, i.e., \bm{z}=\bm{\mu}+\bm{\sigma}\odot\bm{\epsilon} with \bm{\epsilon}\sim\mathcal{N}(\bm{0},\bm{I}), its standard deviation kept positive by a softplus plus a floor \sigma_{\text{min}}=0.1. We use MSE losses for feature and reward prediction, equivalent to the negative log-likelihood under a Gaussian and weighted by \gamma_{y}=\gamma_{r}=1.0 in Equation 6. For latent regularisation we adopt KL balancing, which scales prior and posterior gradients differently so the prior moves towards the posterior faster than the reverse, with a “free nat” threshold c=1 against posterior collapse [9]:

\displaystyle\mathcal{L}_{KL}= \\ \displaystyle\beta_{KL}\max\Big(c,\text{KL}\big[\text{sg}(q(\hat{\bm{z}}_{t}))\;\big|\big|\;p(\tilde{\bm{z}}_{t})\big]\Big) \\ \displaystyle+(1-\beta_{KL})\max\Big(c,\text{KL}\big[q(\hat{\bm{z}}_{t})\;\big|\big|\;\text{sg}(p(\tilde{\bm{z}}_{t}))\big]\Big),

where \text{sg}(\cdot) is the stop-gradient operator, \beta_{KL}=0.8 and \gamma_{KL}=1.0. For consistent multi-step prediction, we add overshooting losses, computed from more than one-step priors, on the KL divergence and the reward predictions of future prior states across T_{f} steps (weighted by \gamma_{KLo}=\gamma_{ro}=0.1). The total loss is:

\mathcal{L}_{\text{total}}=\gamma_{y}\mathcal{L}_{y}+\gamma_{r}\mathcal{L}_{r}+\gamma_{KL}\mathcal{L}_{KL}+\gamma_{KLo}\mathcal{L}_{KLo}+\gamma_{ro}\mathcal{L}_{ro},
(6)

where \mathcal{L}_{y} and \mathcal{L}_{r} are the feature and reward MSE losses and \mathcal{L}_{KLo}, \mathcal{L}_{ro} the corresponding overshooting losses.

At test time, LaGarNet takes (\bm{x}_{t},\bm{g}) and maintains the posterior latent states (\bm{h}_{t},\hat{\bm{z}}_{t}), updating them with the previous action and the current observation; latent vectors start at zero and the initial posterior follows from a no-operation action \bm{a}_{\text{no-op}}=\bm{1}. It selects the first action of a T_{f}-step plan by Model Predictive Control with the Cross-Entropy Method (MPC-CEM):

\displaystyle\bm{a}_{t:t+T_{f}-1}=\argmax_{\bm{a}}\sum_{k=t}^{t+T_{f}-1}r_{\theta}(\tilde{\bm{z}}_{k+1}(\bm{a}_{k})),
(7)

where \tilde{\bm{z}}_{k+1}(\bm{a}_{k})\sim p(\tilde{\bm{z}}_{k+1}\;|\;\bm{h}_{k+1}=f(\bm{h}_{k},\hat{\bm{z}}_{k},\bm{a}_{k}),\bm{g}). In our setup we set the prior future prediction horizon to T_{f}=1; Section IV-B shows that longer horizons degrade performance: a single primitive produces a large deformation whose prediction error compounds over multi-step rollouts.

CEM solves this over the normalised action space [-1,1]^{4}, whose dimensions encode pick and place positions in normalised pixel coordinates. From a diagonal Gaussian initialised at \bm{\mu}=\bm{0}, \bm{\sigma}=\bm{1} we run K=100 iterations, each drawing N=5000 candidates and rejecting, without resampling, any whose pick pixel falls outside the cloth mask or the robot’s workspace mask or whose place pixel falls outside the workspace mask; the survivors are scored by r_{\theta} and \bm{\mu},\bm{\sigma} refitted on the best 10\% (N_{e}=500 elites). The clipped mean of the final distribution is executed on the robot.

III-B Coverage-Alignment Reward

Our coverage-alignment reward \mathcal{R}_{CA} combines the step-wise normalised coverage difference \mathcal{R}_{dC} with the step-wise difference in maximum IoU between the current and goal cloth masks, \mathcal{R}_{dU}:

\mathcal{R}_{CA}=\alpha_{r}\cdot\mathcal{R}_{dC}+(1-\alpha_{r})\cdot\mathcal{R}_{dU},
(8)

where \alpha_{r}=0.3 (Figure 2(c)), \mathcal{R}_{dC}=\text{NC}_{t}-\text{NC}_{t-1} and \mathcal{R}_{dU}=\text{MaxIoU}_{t}-\text{MaxIoU}_{t-1}; both \mathcal{R}_{dC} and \mathcal{R}_{dU}\in[-1,1], so that \mathcal{R}_{CA}\in[-1,1]. Being continuous and linear, it is easy to learn.

Figure 2: LaGarNet: (a) the probabilistic graphical model and (b) the network architecture, where matching colours, line styles and nodes denote identical processes. \bm{g} is the goal observation, \bm{x}_{t} and \bm{z}_{t} the observation and latent state before action \bm{a}_{t}, and \bm{h}_{t} the hidden state of the recurrent backbone. In (a), purple observation and grey action nodes are model inputs and yellow action nodes are sampled during planning. In (b), the Prior (red, solid) predicts \bm{\tilde{z}} from \bm{h} and \bm{g}, the Posterior (orange, dashed) additionally integrates \bm{x}, and a joint decoder (blue) emits \bm{\hat{y}} and \bm{\hat{r}}. (c) Sensitivity of the coverage-alignment reward \mathcal{R}_{CA} to \alpha_{r}. (d) Data collection: a Diffusion Policy expert is mixed at ratio \xi with the mask-biased random policy.

III-C Proximal Expert and Random Policy Data Collection

Previous RSSM-based flatteners [14] rely on a complex blend of data-collection policies. Engineering flattening oracles for complex garments is extremely challenging, which hinders offline RL by preventing easy collection of trajectories around the successful region of the distribution. LaGarNet mitigates these biases with a proximal expert policy and a mask-biased random policy (Figure 2(d)). In particular, we train a Diffusion Policy [15] on 50 human demonstrations to replace the rigid oracle experts of previous methods [14]; as Figure 3(a) shows, it induces numerous nearly successful trajectories, diversifying the data around the near-successful region. For exploration, we introduce a mask-biased random policy rather than the fully random or corner-biased policies of prior work; it samples the pick pixel uniformly from the object mask and the place pixel from the image. Pairing the Diffusion Policy with this exploration at a 1:1 ratio curates a rich, targeted dataset.

IV Experiments

Our experiments investigate three research questions: (1) how LaGarNet compares against state-of-the-art (SoTA) single-picker pick-and-place flattening baselines (Section IV-A); (2) how important each component of LaGarNet is (Section IV-B); and (3) how LaGarNet performs in the real world (Section IV-C). Appendix C additionally asks what advantage GC-RSSM brings over a Diffusion Policy. We evaluate our garment flattening policy with four standard metrics. Normalised Coverage (NC) is the ratio of the garment’s current 2D projected area to its maximally flattened area, isolating the extent of unfolding and bounded to [0,1]. Normalised Improvement (NI) is the relative coverage increase from the initial configuration, \frac{c_{t}-c_{0}}{c_{\text{max}}-c_{0}}. Maximum Intersection-over-Union (Max IoU) is the highest IoU between the current garment mask and the target flattened mask over rotation and translation. Success Rate (SR) is the percentage of trials reaching a state with both \text{NC}>90\% and \text{Max IoU}>80\%.

We report both last-step and cumulative values over the horizon, since our question is whether the world model plans effectively, not whether the policy holds a flattened state. Simulated episodes run 30 steps, showing how each policy behaves once the easy gains are exhausted. Real-world trials stop at 20 steps to reduce evaluation time (Section IV-C)—a human operator comfortably flattens every garment type well within 20 actions. In both settings each garment’s goal state (its maximally flattened configuration) is captured beforehand, serving as the ground-truth reference and as input to goal-conditioned policies: in simulation we use the states of Canberk et al. [7], whilst in the real world we first flatten the garment to a canonical state and then manually crumple it—every related test trial uses the same goal image but different initial states. Augmenting the goal and current images independently absorbs the slight garment–camera offset.

We train all models for 50,000 update steps and validate every 1,000 steps to save the best checkpoint. We augment all policy inputs with appearance-level Gaussian noise, SE(2) transformations of the current observation strictly coupled to the pixel action, and independent affine transformations of the goal observation. Simulation uses 200 training, 10 validation and 30 evaluation trials. We score checkpoints by the sum of average final NC and Max IoU, breaking ties above 1.9 out of 2.0 in favour of fewer steps.

IV-A Comparison of LaGarNet against Other Neural Controllers

Figure 3: Simulation results for single-arm pick-and-place controllers. (a) Per-horizon longsleeve flattening; rows are methods and each horizon N\in\{5,10,20,30\} spans a Max column (best within N steps) and a Last column (value at step N). LaGarNet matches the mesh-based planner MEDOR; its NC and Max IoU barely change between Max and Last, but SR drops sharply (Section V). (b) All four garment types by action step 20.
Table I: Computational requirements and data efficiency across garment flattening baselines. Data is episodes \times pick-and-places; TS is task-specific, AG all-garment; Par. is network parameters, Inf. inference time per action, Coll. data-collection time and Train training time. \dagger marks values reported in the original papers; the all-garment 111 h is 4\times 9+\max(75,34). Our measurements use an NVIDIA RTX 3090 Ti and an AMD Ryzen 9 5900X.
  • No data
    Par.
    (M)
    Inf.
    (s)
    Coll.
    (h)
    Train
    (h)
  • ClothFunnels
    Data
    12.5k\times10†
    Par.
    12.6
    Inf.
    2
    Coll.
    48†
    Train
    48†
  • MEDOR
    Data
    5k\times100†
    Par.
    37.5
    Inf.
    103
    Coll.
    0.64
    Train
    144†
  • Diffusion Policy (TS)
    Data
    200\times20
    Par.
    83.7
    Inf.
    1.5
    Coll.
    9
    Train
    35
  • PlaNet-ClothPick (AG)
    Data
    5k\times20
    Par.
    6.3
    Inf.
    4
    Coll.
    111
    Train
    31
  • LaGarNet (AG)
    Data
    5k\times20
    Par.
    7.11
    Inf.
    6
    Coll.
    111
    Train
    33
IV-A1 Simulation Setup

We develop LaGarNet in Canberk et al.’s simulation environment [7] (SoftGym [6], PyFlex [20]). Following the DRAPER strategy [12], we extend it to include parallel gripper misgrasping and multi-layer grasping. We evaluate simulated longsleeved T-shirts, trousers, dresses, and skirts from Cloth3D [1] (Figure ), scaled by 0.8. Rendered via a top-down camera (2 m height, 45∘ field of view), each 1 kg garment maintains Canberk et al.’s default physical parameters (stiffness, friction, damping). We evaluate on 30 “hard” (crumpled) initial states within the workspace.

IV-A2 Baselines

We benchmark our model-based RL method LaGarNet against RSSM-based PlaNet-ClothPick [14] and the model-free ClothFunnels [7]. We also include the state-of-the-art mesh planner MEDOR [16], cropping observations to match its tuned garment-to-image ratio. Further baselines include the deep behaviour cloning method Diffusion Policy [15, 12], SAC [21], and a Human teleoperation baseline. Except for ClothFunnels and MEDOR, all trained methods use the DRAPER sim-to-real vision strategy [12]. The Diffusion Policy baseline trains on 200 human demonstrations, four times what our data collector uses (Section III-C), bounding what more demonstrations can contribute. LaGarNet and PlaNet-ClothPick (which uses a different reward and no goal observations) learn from 5,000 generated episodes (100,000 transitional steps). All-garment variants use all four clothing types at task-specific data volumes.

IV-A3 Results

Figure 3(a) summarises flattening performance. All-Garment LaGarNet performs comparably to MEDOR and competitively with humans at intermediate horizons, though humans achieve the highest success rate at step 30 by more precisely aligning garments. All-Garment LaGarNet outperforms the Task-Specific variant, demonstrating the architecture’s benefit from morphological diversity (Figure 3(b); Section V). Given 30 steps, Diffusion Policy recovers to competitive results despite weak short-horizon behaviour. Figure 3(b) shows LaGarNet exceeding 95% NC across all garment types at step 20, with higher success on simpler topologies indicating a slight bias. Table I shows the efficiency trade-off: MEDOR reaches high Max IoU at \sim103 s per step and 37.5 M parameters, and Diffusion Policy is fast but needs 83.7 M with lower success rates; All-Garment LaGarNet needs 7.11 M and \sim6 s, facilitating real-world deployment.

IV-B Ablation Study on LaGarNet

Figure 4: Ablation study for LaGarNet in simulation. (a–d) Component ablations on the all-garment models. (e) Flattening performance against the MPC planning horizon H, cumulative (Max) and final-step. Left: the default planner, constraining only the first action to the observed cloth mask; hollow markers are the unconstrained-CEM variant at H=1. Right: the all-step variant, additionally projecting actions k\geq 1 onto the predicted mask for step k. (f) Reconstruction quality of the models of (a) by MSE and SSIM, both \times100 over 10 trials per garment; GC-RSSM blurs the multi-step prior reconstructions least.

We ablate LaGarNet’s latent dynamics, reward, data size, dataset mixture, and planning horizon using Section IV-A1’s setup. Experiments use RGB-to-Mask variants, except latent dynamics ablations (RGB-to-RGB) to assess prediction quality. Models are evaluated on 30 held-out hard states across four arenas. The planning ablation isolates the hardest longsleeve arena, evaluates it over 30 steps, and logs planning time.

IV-B1 Baselines

Latent dynamics ablations compare GC-RSSM and RSSM (Section III-A) against RSSM-GC-I (decodes current image only) and RSSM-GC-IO (predicts both current and goal images), separating goal-conditioning from GC-RSSM’s structure. Reward ablations test L2U [8], CF [7], PC [14], and SFA [11] (Section II). Dataset ablations vary volume, composition, and online exploration noise [9]. The planning ablation sweeps H\in\{1,2,3,4,5\} and tests an unconstrained variant (H=1, no mask rejection). We also add all-step variants constraining actions to predicted masks at step k, projecting empty populations onto nearest mask pixels.

IV-B2 Results

Figure shows gains stem from GC-RSSM’s structure, not just goal-conditioning. RSSM-GC-I performs similarly, but RSSM-GC-IO performs poorly due to increased learning burden. GC-RSSM yields a better prior latent representation for planning (Figure ). Appendix D shows the reconstructions themselves. Figure shows the reward is decisive: success rate falls to 53.9%, 9.0% and 0.0% under the PlaNet-ClothPick, Learning2Unfold and ClothFunnels rewards, and to 71.4% under SpeedFolding’s. Performance plateaus beyond 1,000 episodes (Figures , ), confirming the importance of the data-collection strategy. The greedy one-step planner dominates (Figure ): success falls monotonically from 73.3% (H=1) to 30.0% (H=5). Lookahead is therefore detrimental here. Longer horizons also increase mean planning time from 4.17 s (H=1) to 5.33 s (H=5). Dropping mask rejection at H=1 collapses success to near zero as samples miss the garment. Extending constraints to every step deepens this loss (Figure , right). Ablations rank mask-constrained action sampling as the primary performance driver, followed by the reward, and finally the architecture.

IV-C Transfer Ability of LaGarNet to Real-World Settings

Table II: Real-world garment flattening performance. Each block is an evaluation horizon and every value is cumulative over it: NC, NI and Max IoU give the best reached within the first 10 or 20 actions, and SR the fraction of trials meeting both criteria at any step. LaGarNet improves substantially on PlaNet-ClothPick but still falls short of human performance.
  • 10 Steps
    All-Garment PlaNet-ClothPick [14]
    NC \uparrow
    NI \uparrow
    Max IoU \uparrow
    SR \uparrow
    All-Garment LaGarNet
    NC \uparrow
    NI \uparrow
    Max IoU \uparrow
    SR \uparrow
    Human Policy
    NC \uparrow
    NI \uparrow
    Max IoU \uparrow
    SR \uparrow
  • Longsleeve
    All-Garment PlaNet-ClothPick [14]
    67.1 \pm 12.7
    30.4 \pm 20.9
    63.2 \pm 10.3
    0/10
    All-Garment LaGarNet
    73.4 \pm 8.2
    52.0 \pm 16.2
    66.3 \pm 7.0
    1/10
    Human Policy
    89.1 \pm 7.8
    81.0 \pm 13.8
    78.5 \pm 6.3
    4/10
  • Trousers
    All-Garment PlaNet-ClothPick [14]
    60.6 \pm 16.4
    24.1 \pm 21.9
    57.9 \pm 14.9
    1/10
    All-Garment LaGarNet
    78.7 \pm 10.8
    57.2 \pm 17.0
    70.1 \pm 9.2
    3/10
    Human Policy
    96.4 \pm 5.5
    93.0 \pm 10.9
    85.7 \pm 7.7
    9/10
  • Dress
    All-Garment PlaNet-ClothPick [14]
    71.9 \pm 19.5
    74.6 \pm 28.8
    69.5 \pm 16.4
    3/10
    All-Garment LaGarNet
    99.0 \pm 2.2
    97.6 \pm 6.0
    88.6 \pm 2.7
    10/10
    Human Policy
    94.7 \pm 12.0
    91.3 \pm 19.8
    85.3 \pm 8.5
    9/10
  • Skirt
    All-Garment PlaNet-ClothPick [14]
    76.1 \pm 17.1
    44.0 \pm 26.1
    74.1 \pm 15.5
    4/10
    All-Garment LaGarNet
    87.7 \pm 11.8
    75.7 \pm 22.2
    83.9 \pm 9.5
    8/10
    Human Policy
    95.4 \pm 6.8
    85.9 \pm 24.7
    91.0 \pm 5.1
    8/10
  • Real Total
    All-Garment PlaNet-ClothPick [14]
    69.0 \pm 17.6
    43.3 \pm 31.4
    66.2 \pm 15.7
    8/40
    All-Garment LaGarNet
    84.7 \pm 13.3
    70.6 \pm 24.3
    77.2 \pm 12.0
    22/40
    Human Policy
    93.9 \pm 8.8
    87.8 \pm 18.7
    85.1 \pm 8.3
    30/40
  • 20 Steps
    All-Garment PlaNet-ClothPick [14]
    NC \uparrow
    NI \uparrow
    Max IoU \uparrow
    SR \uparrow
    All-Garment LaGarNet
    NC \uparrow
    NI \uparrow
    Max IoU \uparrow
    SR \uparrow
    Human Policy
    NC \uparrow
    NI \uparrow
    Max IoU \uparrow
    SR \uparrow
  • Longsleeve
    All-Garment PlaNet-ClothPick [14]
    69.2 \pm 13.2
    34.6 \pm 22.1
    64.5 \pm 10.3
    0/10
    All-Garment LaGarNet
    84.5 \pm 7.9
    71.1 \pm 17.0
    74.1 \pm 6.8
    4/10
    Human Policy
    96.8 \pm 7.6
    94.2 \pm 13.9
    87.6 \pm 5.8
    9/10
  • Trousers
    All-Garment PlaNet-ClothPick [14]
    60.6 \pm 16.4
    24.1 \pm 21.9
    57.9 \pm 14.9
    1/10
    All-Garment LaGarNet
    80.2 \pm 10.3
    60.1 \pm 16.9
    70.5 \pm 9.0
    3/10
    Human Policy
    100.0 \pm 0.0
    100.0 \pm 0.0
    93.6 \pm 0.7
    10/10
  • Dress
    All-Garment PlaNet-ClothPick [14]
    75.8 \pm 19.5
    90.6 \pm 17.7
    72.5 \pm 16.2
    3/10
    All-Garment LaGarNet
    100.0 \pm 0.0
    100.0 \pm 0.0
    89.5 \pm 1.9
    10/10
    Human Policy
    100.0 \pm 0.0
    100.0 \pm 0.0
    89.2 \pm 1.7
    10/10
  • Skirt
    All-Garment PlaNet-ClothPick [14]
    80.4 \pm 17.1
    54.0 \pm 31.7
    77.4 \pm 14.7
    5/10
    All-Garment LaGarNet
    96.5 \pm 3.2
    91.4 \pm 9.8
    90.4 \pm 2.3
    10/10
    Human Policy
    97.4 \pm 5.7
    90.3 \pm 24.2
    92.6 \pm 4.2
    9/10
  • Real Total
    All-Garment PlaNet-ClothPick [14]
    71.5 \pm 18.3
    50.8 \pm 34.9
    68.1 \pm 16.0
    9/40
    All-Garment LaGarNet
    90.3 \pm 10.6
    80.7 \pm 20.4
    81.1 \pm 10.7
    27/40
    Human Policy
    98.6 \pm 5.0
    96.1 \pm 14.5
    90.7 \pm 4.4
    38/40
Table III: Trajectory and step-wise failure rates for LaGarNet in the real world; a trajectory succeeds if it reaches the success state within 20 steps. “Messing-near-success state” counts drops in the step right after a near-success step, and “As-if-manipulating-other-object” counts steps treating part of the garment as another topology, most often a trouser leg as a sleeve.
  • Trajectory
    Specific Mode
    Fold Underneath
    Rate
    3/40
  • Fold On the Top
    Specific Mode
    2/40
  • Cannot untwist
    Specific Mode
    5/40
  • Cannot stabilise on success state
    Specific Mode
    4/40
  • Step-wise
    Specific Mode
    Segmentation failure
    Rate
    1/800
  • Misgrasping failure
    Specific Mode
    3/800
  • Messing-near-success state
    Specific Mode
    168/298
  • As-if-manipulating-other-object
    Specific Mode
    28/800

Our zero-shot real-world study evaluates simulation-trained LaGarNet and PlaNet-ClothPick (Section IV-A3) across four garment types (Figure ). We exclude MEDOR for its prohibitive execution time and Diffusion Policy for its workspace-constrained inference. We additionally evaluate a soft, high-friction longsleeved dress as an out-of-distribution (OOD) topology. We use a UR5e arm with an OnRobot RG2 parallel gripper (workspace radius 0.2–0.7 m) and a RealSense D435i camera at P_{c}=(0.03,-0.86,1.66) m, cropping its frames to a 450\times 710 region; everything runs on an RTX 3080 laptop. Because garments are visually flattened in practice, we relax real-world success criteria to NC \geq 85 and Max IoU \geq 75, absorbing camera distortion.

IV-C1 Results

Table II shows the unified all-garment LaGarNet flattens longsleeved T-shirts, trousers, skirts and dresses in the real world, substantially improving on PlaNet-ClothPick. It trails the human baseline on narrow-appendage garments, yet stays competitive with the single-gripper mesh-based planners VCD [17] and MEDOR [16]: within 20 steps it reaches 84.5\pm7.9% NC on longsleeved T-shirts against VCD’s 77.3\pm14.1%, and 100.0\pm0.0% NI on dresses against MEDOR’s 46.8%. On an unseen longsleeved dress of soft, high-friction material it reaches only 77.2\pm6.5% NC, 42.1\pm22.6% NI and 66.4\pm3.2% Max IoU, succeeding in 0 of 10 trials. Topology dependence is strong: a perfect 10/10 success rate on dresses and skirts within 20 steps, but only 3/10 and 4/10 on trousers and longsleeved shirts.

Limitations and Failure Cases

LaGarNet faces a persistent sim-to-real gap [16, 17] and multi-task capacity issues: the unified policy underfits complex topologies and overfits simpler ones (Table II). It struggles to untwist narrow sections, often manipulating trouser legs like T-shirt sleeves (Table III). Appendix G shows these cases. Furthermore, inaccurate first-step prior reward predictions from GC-RSSM occasionally cause the policy to disrupt already flattened near-success states (Table III). Prioritising geometry over physical properties, LaGarNet struggles with high-friction, low-stiffness garments, and the single-arm gripper limits unfolding stubborn wrinkles. LaGarNet also cannot distinguish front from back—a challenging task even for human [22]. It also assumes a one-off canonical flattened goal image per garment. Finally, a single primitive step takes 24.5 s (perception 8.19 s, inference 7.05 s, execution 9.20 s), resulting in over 8 minutes per 20-step episode and limiting industrial deployment.

V Discussion

To our knowledge LaGarNet is the first integrated latent world model system to flatten four garment topologies with a single policy in a quasi-static setup, a result we credit to mask-constrained sampling, the coverage-alignment reward and the data-collection strategy as much as to the architecture (Section IV-B). Applying an RSSM here raises two challenges: cloth deformation is complex, and high-level primitives make inferred states far less continuous than in velocity or position control. We find that RSSM [9], with our goal-conditioned extension, still learns the latent dynamics of cloth deformation in quasi-static setups.

LaGarNet plans in a compact latent space instead of over a reconstructed mesh, making it more data-efficient and stable than model-free and online RL. It also predicts each candidate action’s outcome, so the policy is explainable and does not depend on high-quality demonstrations. Offline RL suffers from distribution shift [23], and most methods train on data from a single policy [24]. We instead pair a mask-biased random policy with Diffusion Policy [15], a BC method that learns to flatten from only 50 human demonstrations whilst collecting the near-success data a random policy rarely reaches. We use BC only as a data collector; our deployed method never imitates an action, because BC requires extensive and expensive human expert data for garment manipulation. BC also struggles to transfer to slightly different domains; our workspace constraints shift with the heuristic’s crop, enforcing which during action denoising is difficult. LaGarNet simply rejects out-of-workspace samples while planning, so a loosely constrained simulation policy still transfers.

LaGarNet’s chief limitation is that it does not know when to stop. It reaches a success state in 76.7% of simulated longsleeve trials within 20 steps but holds it at the final step in only 13.3% (Figure 3(a)), and in the real world 168 of 298 near-success steps end in a drop (Table III). The reward predictor is least reliable once the garment lies flat, so the planner continues acting when it should stop; human operators stop as soon as the garment looks flat, which accounts for much of their advantage at long horizons. A learned stopping criterion would close this gap. Nonetheless, this research opens an exciting direction for state-space models in deformable object manipulation, such as handling dough, clay, or cables. Although we focus on reward-based planning for flattening, the model also predicts future features, which could extend to goal-directed folding.

VI Conclusion

We introduce LaGarNet, a general learning-based policy for single-arm pick-and-place (PnP) garment flattening. It successfully flattens four complex garment types (longsleeved T-shirts, trousers, skirts, and dresses) with a single policy in both simulated and real-world environments. We achieve this via a goal-conditioned recurrent state-space model, a targeted data-collection strategy, and a coverage-alignment reward. LaGarNet matches state-of-the-art mesh-based planners at a fraction of their parameter count and inference cost, marking the first successful application of state-space models to complex garments. We demonstrate that recurrent latent world models remain effective in the quasi-static PnP regime despite temporally discontinuous observations.

Acknowledgment

We thank the Institute of Safe Autonomy at the University of York for hosting the experimental evaluations, and Dr James Hilder and Dr Rob Woolley for their help in setting up the robot platform; Dr Stuart Norcross at the University of St Andrews for access to essential GPU clusters; and Dr Ivan Kapelyukh at Imperial College London for insightful discussions on generalising this approach to dual-arm manipulation and cloth folding. We acknowledge the use of the Viking cluster at York, and of Google’s Gemini 3 Flash Image to remove the background and enhance the image quality of the setup shown in Figure 1(c). This work was supported by the UK Engineering and Physical Sciences Research Council under grant EP/W014688/2 (DIGI-CORTEX).

References

  1. [1] H. Bertiche, M. Madadi, and S. Escalera, “CLOTH3D: Clothed 3d humans,” in European Conference on Computer Vision. Springer, 2020, pp. 344–359.
  2. [2] T. Weng, S. M. Bajracharya, Y. Wang, K. Agrawal, and D. Held, “Fabricflownet: Bimanual cloth manipulation with a flow-based policy,” in Conference on Robot Learning. uckland, New Zealand: PMLR, 15–18 December 2022, pp. 192–202.
  3. [3] T. Lips, V.-L. De Gusseme, and F. wyffels, “Learning keypoints for robotic cloth manipulation using synthetic data,” IEEE Robotics and Automation Letters, 2024.
  4. [4] X. Huang, A. Seino, F. Tokuda, A. Kobayashi, D. Chen, Y. Hirata, N. C. Tien, and K. Kosuge, “SIS: Seam-informed strategy for t-shirt unfolding,” IEEE Robotics and Automation Letters, vol. 10, no. 7, pp. 7342–7349, 2025.
  5. [5] J. Matas, S. James, and A. J. Davison, “Sim-to-real reinforcement learning for deformable object manipulation,” in Conference on Robot Learning. Zurich, Switzerland: PMLR, 9–31 October 2018, pp. 734–743.
  6. [6] X. Lin, Y. Wang, J. Olkin, and D. Held, “Softgym: Benchmarking deep reinforcement learning for deformable object manipulation,” in Conference on Robot Learning. London, UK: PMLR, 8–11 November 2021, pp. 432–448.
  7. [7] A. Canberk, C. Chi, H. Ha, B. Burchfiel, E. Cousineau, S. Feng, and S. Song, “Cloth Funnels: Canonicalized-alignment for multi-purpose garment manipulation,” in 2023 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2023, pp. 5872–5879.
  8. [8] N.-Q. Gu, R. He, and L. Yu, “Learning to unfold garment effectively into oriented direction,” IEEE Robotics and Automation Letters, vol. 9, no. 2, pp. 1051–1058, 2024.
  9. [9] D. Hafner, T. Lillicrap, I. Fischer, R. Villegas, D. Ha, H. Lee, and J. Davidson, “Learning latent dynamics for planning from pixels,” in International Conference on Machine Learning. Long Beach, CA, USA: PMLR, 10–15 June 2019, pp. 2555–2565.
  10. [10] W. Yan, A. Vangipuram, P. Abbeel, and L. Pinto, “Learning predictive representations for deformable objects using contrastive estimation,” in Conference on Robot Learning. London, UK: PMLR, 8–11 November 2021, pp. 564–574.
  11. [11] Y. Avigal, L. Berscheid, T. Asfour, T. Kröger, and K. Goldberg, “Speedfolding: Learning efficient bimanual folding of garments,” in 2022 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2022, pp. 1–8.
  12. [12] H. A. Kadi, J. A. Chandy, L. Figueredo, K. Terzić, and P. Caleb-Solly, “DRAPER: Towards a robust robot deployment and reliable evaluation for quasi-static pick-and-place cloth-shaping neural controllers,” 2025. [Online]. Available: https://arxiv.org/abs/2409.15159
  13. [13] R. Hoque, D. Seita, A. Balakrishna, A. Ganapathi, A. K. Tanwani, N. Jamali, K. Yamane, S. Iba, and K. Goldberg, “Visuospatial foresight for physical sequential fabric manipulation,” Autonomous Robots, vol. 46, no. 1, pp. 175–199, 2022.
  14. [14] H. A. Kadi and K. Terzić, “PlaNet-ClothPick: Effective fabric flattening based on latent dynamic planning,” in 2024 IEEE/SICE International Symposium on System Integration (SII). IEEE, 2024, pp. 972–979.
  15. [15] C. Chi, S. Feng, Y. Du, Z. Xu, E. Cousineau, B. Burchfiel, and S. Song, “Diffusion policy: Visuomotor policy learning via action diffusion,” in Proceedings of Robotics: Science and Systems (RSS), 2023.
  16. [16] Z. Huang, X. Lin, and D. Held, “Mesh-based dynamics with occlusion reasoning for cloth manipulation,” in Proceedings of Robotics: Science and Systems (RSS), New York City, NY, USA, June 2022.
  17. [17] X. Lin, Y. Wang, Z. Huang, and D. Held, “Learning visible connectivity dynamics for cloth smoothing,” in Conference on Robot Learning. Auckland, New Zealand: PMLR, 5–18 December 2022, pp. 256–266.
  18. [18] K. Pertsch, O. Rybkin, F. Ebert, S. Zhou, D. Jayaraman, C. Finn, and S. Levine, “Long-horizon visual planning with goal-conditioned hierarchical predictors,” Advances in Neural Information Processing Systems, vol. 33, pp. 17 321–17 333, 2020.
  19. [19] Y. Duan, W. Mao, and H. Zhu, “Learning world models for unconstrained goal navigation,” Advances in Neural Information Processing Systems, vol. 37, pp. 59 236–59 265, 2024.
  20. [20] Y. Li, J. Wu, R. Tedrake, J. B. Tenenbaum, and A. Torralba, “Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids,” in ICLR, 2019.
  21. [21] T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine, “Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor,” in International conference on machine learning. Stockholm, Sweden: PMLR, 10–15 July 2018, pp. 1861–1870.
  22. [22] M. D. Klein, Pre-Dressing Skills: Skill Starters for Self-Help Development. Tucson, AZ: Communication Skill Builders, 1983.
  23. [23] R. F. Prudencio, M. R. Maximo, and E. L. Colombini, “A survey on offline reinforcement learning: Taxonomy, review, and open problems,” IEEE Transactions on Neural Networks and Learning Systems, 2023.
  24. [24] R. Agarwal, D. Schuurmans, and M. Norouzi, “An optimistic perspective on offline reinforcement learning,” in International conference on machine learning. PMLR, 2020, pp. 104–114.

Appendix A Network Architecture, Planning and Hyperparameters

This appendix specifies the exact architecture of LaGarNet, its test-time planning procedure, and all training hyperparameters; see Section III-A for the conceptual overview.

Table IV: Hyperparameters for LaGarNet and Diffusion Policies. GradClip represents gradient clipping. KL denotes Kullback-Leibler divergence, used for latent state regularisation. MPC stands for Model Predictive Control, utilised for trajectory planning. EMA refers to Exponential Moving Average, used to stabilise training weights.
  • \bm{h},\bm{z} Dimensions
    Value
    300, 60
  • Hidden Dimension
    Value
    300
  • \beta_{KL},\gamma_{KL},\gamma_{KLo},\gamma_{ro},\gamma_{y},\gamma_{r}
    Value
    0.8, 1.0, 0.1, 0.1, 1.0, 1.0
  • \sigma_{min}, c
    Value
    0.1, 1
  • \bm{a}_{\text{no-op}}
    Value
    \bm{1}
  • MPC Horizon / Candidates/ Iterations
    Value
    1 / 5000 / 100
  • Backbone Network
    Value
    GRU RNN [1]

A-A Image Encoder & Decoder

The visual encoder processes the 64\times 64 RGB images (either the current observation \bm{x}_{t} or the goal observation \bm{g}) into a 1024-dimensional continuous embedding, denoted as \bm{e}_{t} and \bm{e}_{g} respectively. The network comprises four sequential convolutional blocks. For the 64\times 64 resolution, the blocks have channel sizes of \{32,64,128,256\}. Each block utilises a kernel size of 4\times 4 and a stride of 2. The output of the final convolutional layer is flattened and projected via a linear layer to match the designated embedding dimension.

The observation decoder acts as a generative model p(\hat{\bm{x}}_{t}\;|\;\bm{h}_{t},\bm{z}_{t}) to reconstruct the mask image from the latent space, which is primarily used to compute the observation reconstruction loss. It takes the concatenated deterministic state \bm{h}_{t} and stochastic state \bm{z}_{t} (sampled from the posterior \hat{\bm{z}}_{t} during training) as input, processes it through a linear dense layer, and reshapes it into a 1\times 1 spatial feature map. This is followed by four transposed convolutional layers with channel sizes of \{128,64,32,C\}, where C is the number of channels in the output observation. The first two transposed convolutions use a kernel size of 5\times 5, whilst the final two use a kernel size of 6\times 6, all with a stride of 2.

A-B Goal-Conditioned Transition Model

The transition dynamics of the GC-RSSM consist of multi-layer perceptrons (MLPs) and a Gated Recurrent Unit (GRU) [1]. The recurrent state \bm{h}_{t}=f(\bm{h}_{t-1},\bm{z}_{t-1},\bm{a}_{t-1}) is updated using a GRU cell. The input to the GRU is the output of a 1-layer MLP that fuses the previous stochastic latent state \bm{z}_{t-1} and the previous action \bm{a}_{t-1}. The prior stochastic state \tilde{\bm{z}}_{t}\sim p(\tilde{\bm{z}}\;|\;\bm{h}_{t},\bm{g}) is predicted by concatenating the current deterministic state \bm{h}_{t} and the goal embedding \bm{e}_{g}. This concatenated vector is passed through an embedding MLP, followed by a state-prior MLP that outputs the mean and variance of a diagonal Gaussian distribution. The standard deviation is parameterised using a Softplus function bounded by a minimum value (\sigma_{\text{min}}=0.1) to prevent numerical instability and mode collapse.

During training, the posterior stochastic state \hat{\bm{z}}_{t}\sim q(\hat{\bm{z}}\;|\;\bm{h}_{t},\bm{x}_{t},\bm{g}) incorporates the current observation \bm{x}_{t}. The deterministic state \bm{h}_{t}, goal embedding \bm{e}_{g}, and current observation embedding \bm{e}_{t} are concatenated and processed through an embedding MLP. A subsequent state-posterior MLP outputs the mean and variance of the posterior diagonal Gaussian distribution, similarly bounded by the Softplus function.

A-C Reward Predictor

The reward model r_{\theta}(\bm{h}_{t},\bm{z}_{t}) predicts the expected scalar reward r_{t} from the current latent state. It takes the concatenated deterministic state \bm{h}_{t} and stochastic state \bm{z}_{t}, processes them through four hidden layers and projects them to a scalar value via a final linear layer to formulate a 5-layer MLP.

A-D Test-Time Planning with the Cross-Entropy Method

This appendix completes the CEM procedure of Section III-A. To apply the masks, the planner converts each candidate into pixel coordinates via \bm{p}=(\bm{a}+\bm{1})\cdot H/2 on the H\times H observation. It clips the survivors to [-1,1] afterwards. Note that N_{e} is a fixed fraction of the drawn population, not of the survivors. Every survivor therefore becomes an elite whenever fewer than N_{e} pass the masks. If an iteration leaves none, the planner exits early and executes the current mean. To score a survivor, we roll the goal-conditioned prior out one step and evaluate r_{\theta} on the predicted latent state. The rejection applies to the first action of a plan only. For H>1 we do not know the cloth state after the first pick-and-place, so we score the later actions without mask constraints. We write the executed action as \bm{a}_{t}=\operatorname{clip}(\bm{\mu},-1,1). The simulator’s segmentation provides the cloth mask in simulation, and the pipeline of Appendix F-C provides it in the real world. In the RGB-to-Mask setting, the planner can instead threshold the model’s reconstructed observation. The workspace mask marks the ring between the near radius r_{n} and the far radius r_{f} around the robot base, in both simulation and the real world (see Appendix F). Only the executed action leaves the normalised image space. We map \bm{a}_{t} back to a pixel of the selected observation window, and then to a pixel of the full camera frame through the crop of Appendix F-A. We intersect the corresponding camera ray with the table plane, using the camera-to-base transformation of Appendix F-B. The resulting pick and place points become two end-effector poses. The robot executes them with the guarded descent and grasp procedure of Appendix F-D.

Appendix B Diffusion Policy and Data Augmentation

B-A Diffusion Policy for the P&P Domain

We adopt the Diffusion Policy [15] to generate proximal expert trajectories for garment flattening for offline RL training. We utilise the policy version adapted for the pick-and-place cloth-manipulation domain given by DRAPER [12]; it formulates quasi-static pick-and-place cloth manipulation as a conditional generative process. Unlike deterministic regressors, the Diffusion Policy learns a stochastic policy that progressively refines noisy proposals into feasible actions conditioned on visual observations.

The Diffusion Policy models the conditional distribution of action sequences \pi(\bm{A}^{t}\mid\bm{X}^{t}). It defines the action sequence \bm{A}^{t}\equiv\{\bm{a}_{i}\}_{i=t-T_{h}}^{t+T_{f}-1} over a prediction horizon T_{p}=T_{h}+T_{f}, and the observation history \bm{X}^{t}\equiv\{\bm{x}_{i}\}_{i=t-T_{h}}^{t} over a horizon T_{h}. In our pick-and-place setting, \bm{a}_{i}\in\mathbb{R}^{d} represents a continuous vector parameterising grasp locations and target placements with d=4. The framework consists of a forward process and a learned reverse process. The forward process incrementally corrupts the clean action sequence \bm{A}_{0} with Gaussian noise over K steps. The noisy sequence at step k can be sampled directly as:

\bm{A}_{k}\sim\mathcal{N}\big(\sqrt{\bar{\alpha}_{k}}\bm{A}_{0},(1-\bar{\alpha}_{k})\bm{I}\big),
(9)

where \bar{\alpha}_{k} is derived from a predefined squared-cosine noise schedule \{\beta_{i}\}_{i=1}^{k} [2]. The reverse process generates actions by iteratively denoising a sample from a standard Gaussian prior, \bm{A}_{K}\sim\mathcal{N}(\bm{0},\bm{I}). A learned noise prediction network \epsilon_{\theta} (1D U-Net [3]) takes the noisy action \bm{A}_{k}, the diffusion step k, and a conditioning observation embedding \bm{e}_{x} as inputs to estimate the injected noise; the embedding \bm{e}_{x} is derived from a vision encoder (ResNet18 [4] with Group Normalisation [5]) applied to \bm{X}. For garment flattening tasks, we disable temporal convolution in the 1D U-Net noise predictor by setting T_{h}=0 and T_{f}=1, as longer context windows have proved disadvantageous in our experiments.

The refined action sequence for the previous step is computed as:

\bm{A}_{k-1}=\frac{1}{\sqrt{1-\beta_{k}}}\Big(\bm{A}_{k}-\frac{\beta_{k}}{\sqrt{1-\bar{\alpha}_{k}}}\epsilon_{\theta}(\bm{A}_{k},k,\bm{e}_{x})\Big)+\sigma_{k}\bm{\epsilon},
(10)

where \bm{\epsilon}\sim\mathcal{N}(\bm{0},\bm{I}) and \sigma_{k} controls the stochasticity of the sampler.

Diffusion Policy trains the network to maximise the conditional log-likelihood of the action sequence by minimising the evidence lower bound (ELBO), resulting in the mean squared error (MSE) objective:

\mathcal{L}=\mathrm{MSE}\Big(\bm{\epsilon}_{k},\epsilon_{\theta}(\bm{A}_{k},k,\bm{e}_{x})\Big).
(11)

B-B Data Augmentation

In order to ensure the robust generalisation of our visual policy, we employ a comprehensive, geometry-aware data augmentation pipeline on the current and goal RGB observations.

The RGB inputs undergo an appearance-level augmentation where they are remapped to a [0, 1] range and injected with subtle Gaussian noise with \sigma of 0.01. Then, we apply rigid spatial transformations to the current state observations to expand the effective dataset and enforce SE(2) equivariance in the learned policy — we apply continuous random rotations at 1-degree intervals and vertical flips with a 50% probability to the current RGB and mask images. Crucially, to maintain geometric consistency, we strictly couple these visual transformations with the action space. When the images are rotated or flipped, the corresponding 2D spatial pixel actions (the pick-and-place coordinates) are transformed via equivalent rotation matrices and coordinate inversions, discarding any transformations that push the pixel actions out of bounds.

Finally, to enable robust goal-conditioned behaviour in the real world, the pipeline applies independent affine transformations to the goal RGB observation. These images undergo randomised 2D rigid body transformations, combining rotations and translational shifts (up to a translation scale of 0.2). By independently augmenting the target visual states, we prevent the network from simply memorising exact pixel-to-pixel mappings between the current and goal images, which forces the architecture to learn deeper, spatially robust relational features for the pick-and-place task.

Appendix C Diffusion Policy vs. LaGarNet

Figure 5: Diffusion Policy versus LaGarNet on the simulated longsleeve environment. (a) Validation performance over 50,000 training steps for task-specific Diffusion Policies trained with varying numbers of human demonstrations. Each panel carries one metric—normalised coverage above, Max IoU below—and every curve is an exponential moving average (EMA, span = 15); the All-Garment and Task-Specific LaGarNet curves are shown for reference. (b) Evaluation performance of these policies on the four primary metrics. (c) Architectural ablations by action step 20. All values are aggregated over 120 evaluation episodes (30 trials per garment type). The All-Garment LaGarNet trains stably and substantially outperforms every Diffusion Policy variant trained on an equivalent volume of success-only trajectories.

Using the setup of Section IV-A1, we ask whether LaGarNet’s advantage over the Diffusion Policy stems from explicit forward planning, extended temporal context, or simply data scale. We examine how the number of human demonstrations affects a task-specific Diffusion Policy (Figures and ) and compare it against the ablated baselines below.

C-A Baselines

To isolate which architectural components drive LaGarNet’s advantage, we design six baselines. (a) GC-DP: a Goal-Conditioned Diffusion Policy taking concatenated current and goal RGB images, trained on 5,000 episodes of diffusion-induced, success-only data spanning all garment types. (b) GC-DP-Comp: GC-DP aligned to LaGarNet’s hyperparameters—PlaNet’s CNN encoder in place of ResNet-18, the two embeddings concatenated before the downstream networks, and the observation sequence length raised from 1 to 4. (c) LaGarNet-Comp: LaGarNet with its training sequence length cut from 50 to 4 for direct comparison. (d) LaGarNet-RSSM: LaGarNet using its full, unconditioned RSSM dynamics. (e) GC-RSSM-DP: GC-DP-Comp using LaGarNet’s frozen pre-trained encoder and latent dynamics, with the noise predictor’s conditioning dimension set to 360; each step wipes memory by zeroing the previous latent state and recovers the posterior by feeding a “no-op” action into the dynamics model. (f) LaGarNet-CNN-DP: GC-DP-Comp using only LaGarNet’s frozen vision encoder, giving a 2048-dimensional embedding of the current and goal images.

C-B Results

Each baseline isolates one architectural component. Three core components drive the successful performance of LaGarNet over diffusion policy. They are temporal context, goal-conditioned inference, and forward planning. In contrast, visual features and dataset scale does not contribute as much. See Figure for full comparisons.

Temporal context is critical. Reducing training sequences to 4 steps degrade performance—SR drops drastically to 5.0%. The belief state requires sequence history; short histories cannot disambiguate folded garments. In addition, Goal-conditioned latent inference matters highly—unconditioned dynamics only reach 52.5% SR. Goal-conditioning adds 22.5 points of SR. Forward planning turns coverage into success—LaGarNet outperforms GC-DP by 35.0 SR points; it also gains 5.7 NC points, achieving through using mixed-quality data. We learned that regression can learn crude cloth spreading, but true success requires predicting action outcomes and forward planning selects actions for these effects.

Alternative explanations do not hold up. Visual features do not cause this gap—using LaGarNet’s frozen encoder degrades DP performance. Testing its full latent dynamics performs worse than base GC-DP. Furthermore, dataset scale is not responsible—increasing demonstrations to 200 raises validation NC to 93%. Max IoU also increases to 77% (Figure ). Yet, all DP variants still underperform LaGarNet. LaGarNet exceeds 93% NC within 1,000 updates. Ultimately, test-time search requires a goal-aware latent state. This state needs deep temporal context. Together, they enable effective test-time search, answering our central research question.

Appendix D Latent Reconstruction Quality

Figure 6: Observation reconstructions of the latent-dynamics models ablated in Figure . Each grid is a 64\times 64 RGB image; green arrows in the first row are the pick-and-place actions taken. GC-RSSM tracks the garment sleeves in the prior steps better than the other RSSM variants.

Figure 6 shows the reconstructions behind the scores of Figure . The posterior reconstructions are close for every variant, so the models separate only on the priors, where the prediction must be made without the current observation. GC-RSSM keeps the sleeves and the garment outline legible two and three steps ahead, whereas the unconditioned RSSM and RSSM-GC-IO blur them into the body of the garment. This is what the SSIM column of Figure measures, and it is the representation the planner scores candidate actions against.

Appendix E Simulation Garment Distribution

Figure 7 characterises the 30 “hard” initial states used for evaluation, in terms of normalised coverage, maximum IoU against the flattened goal, and garment colour.

Figure 7: The initial state distribution of the simulated garments.

Appendix F Real Robot Setup

In the cloth manipulation literature, robot arms are often fixed on a table [17, 6, 7], leading to a ring-shaped workspace for Pick-and-Place (PnP) primitives. Real garments are generally larger than simple fabrics, so it becomes physically impossible to flatten them within a fixed square window inside the workspace of a single robot arm—a common practice in this domain [12, 13, 7]. This requires us to develop a transfer strategy to bridge the gap between observation and the workspace in addition to the gap between the simulation and the real robot environment.

Figure 8: Overview of the real-world deployment setup. (a) Camera P_{c} is set at the front of the robot and top of the table surface; whilst the camera can capture the table view highlighted in yellow, our system operates on the Region-of-Interest (ROI) highlighted in red. (b) The heuristic approach for transferring the simulated policy to the real world; the heuristic prioritises the selection of the middle window for network inputs, but if the selected window does not contain any part of the cloth, it re-selects a window that centres around the cloth as shown; the most highlighted part of the rectangular images is the workspace of the UR5e robot for a particular action step. (c) The empirical parameters utilised in the segmentation pipeline.

As shown in Figure , we employ a UR5e robot arm equipped with an OnRobot RG2 electric parallel gripper to conduct our real-world experiments. We position a RealSense D435i camera P_{c} in front of the robot and above a table covered with a dark foam surface. As in simulation, we use only RGB frames with automatic exposure as input to our method in the real-world setup.

The workspace of our UR5e robot is defined by a far radius r_{f} and a near radius r_{n}. To isolate the effective workspace, we crop the visual input to a Region of Interest (ROI) as in Figure 8(a). Given the top-down camera perspective, we compute the spatial position p_{w} in the world frame for each pixel p_{x} in the camera view using the camera intrinsics and the transformation matrix. Consequently, we determine whether p_{x} lies within the workspace by checking if r_{n}\leq||p_{w}-b_{w}||_{2}\leq r_{f}, where b_{w} represents the position of the robot base in the world frame. Please refer to Table 8(c) for the exact parameters of our real-robot setup. We use the UR-RTDE package [8] for conducting Cartesian planning to execute pick-and-place primitives, as it reliably produces stable trajectories.

This section first introduces the transfer heuristic, which integrates the real robot arm’s workspace into LaGarNet’s planning method (Section F-A). Next, we discuss how we conduct our hand-eye calibration (Section F-B) for the transformation between the camera pixel space and robot base space. Then, we explain our approach to segmenting the physical garments from the camera observations (Section F-C). Finally, we detail our grasping implementation, designed to ensure the precise and robust picking of garments (Section F-D).

F-A Transfer Heuristic for Robot’s Ring-Shaped Workspace

Many robot manipulators face workspace constraints, such as limited reach as well as undesirable trajectories caused by inverse kinematics and joint discontinuities. These factors often make parts of the workspace unusable for smooth pick-and-place (PnP) execution. To address this general class of problems, we propose a heuristic workspace sampling method that adapts trained policies to feasible regions of a robot’s workspace without retraining. We demonstrate this method on a UR5e robot arm, whose PnP workspace resembles a ring due to both reach limitations and unstable trajectories near the base; the ring-like workspace is defined by a far radius r_{f} and a near radius r_{n} on the table surface.

Our heuristic workspace sampling method (see Figure 8(b)) builds an observation bridge between the UR5e environment and the policy’s training environment. This method prioritises the central square window of the raw RGB input. If the central window does not contain any part of the cloth, it re-selects a window centred on the target cloth. The LaGarNet latent dynamics network receives observations filtered by the cloth mask in the selected window, and the model predictive control planner samples pick actions at the intersection of the cloth mask and workspace mask, and place actions within the workspace mask in the selected window. Using these two processes, we ensure that LaGarNet can be transferred to the entire visible workspace of a UR5e robot from a top-down camera for flattening real garments. Note that the dynamic cropping mechanism of the transfer heuristic is only activated at the beginning of an episode if the garment is absent from the central field of view.

F-B Hand-Eye Calibration

To guarantee precise physical manipulation based on visual input, we conducted a rigorous eye-to-hand calibration to map the Intel RealSense camera’s pixel space to the Universal Robots (UR) base frame. Our calibration target is a 5\times 7 ChArUco board [9] featuring 40 mm squares and 30.0 mm ArUco markers (Dictionary 4x4_50) grasped by the robot’s end-effector. To ensure an optimal and mathematically robust solution, we program the robot to traverse a trajectory of 50 carefully designed joint configurations. These poses explicitly sample the SE(3) workspace, incorporating isolated Z-axis depth variations, lateral translations, and decoupled pitch, yaw, and roll rotations. This diverse pose generation prevents singularities and ensures the focal parameters are well-constrained. For each spatial sample, we estimate the target-to-camera transformation utilising a Perspective-n-Point solver based on the interpolated ChArUco corners. Finally, we compute the fixed camera-to-base transformation matrix by solving the standard AX=XB formulation using the Park and Martin method [10].

F-C Real-World Garment Segmentation

Following standard practices in the domain [7, 17, 12], we utilise the Segment Anything Model (SAM) [11] to isolate the target garment. This segmentation is crucial for stripping the background from policy inputs and enabling accurate real-world evaluation. Given an RGB observation, SAM generates a set of K binary candidate masks. To efficiently isolate the true garment, we convert the image to the HSV colour space and apply a multi-stage heuristic filtering pipeline. First, we apply spatial pruning: masks are retained only if their total pixel area A\in[A_{\text{min}},A_{\text{max}}]. To eliminate broad background surfaces, we reject any candidate whose active border pixels exceed a fraction \alpha_{border} of the image perimeter, formalised as P_{\text{mask}}>\alpha_{border}\times 2(h+w). Next, we apply chromatic and variance filters to distinguish the garment from its environment. For each mask, we compute the mean saturation \bar{S} and RGB intensity variance V. We discard low-saturation grey areas, for which \bar{S}<S_{\text{min}}. We further reject grey backgrounds by ensuring V\geq V_{min}. Finally, the optimal mask is selected by maximising a utility score that prioritises large, distinctly coloured objects \text{Score}_{i}=A_{i}\cdot\bar{V}_{i}. This pipeline reliably yields high-fidelity garment segmentations for downstream manipulation tasks. The specific parameters used in our real-world experiments are detailed in Table 8(c).

F-D Grasping

Accurately grasping garments without failure remains a significant challenge for parallel grippers. We build upon the grasping protocol proposed by DRAPER [12], which adjusts the pick position on an eroded mask of the garment and ensures the axis connecting the two gripper fingers is perpendicular to the target mask cutline. However, while DRAPER utilises a custom pincher extension, our approach employs a standard OnRobot RG2 parallel gripper. To mitigate misgrasping errors, we initialise the gripper to a 3 cm opening width before the approach towards garments. The end-effector then executes a guarded descent, lowering gradually until the robot’s force-torque sensor detects an upward reaction force of approximately 5 N. This force-based threshold ensures the garment is firmly contacted while preventing gripper faults or misgrasps caused by excessive collision resistance from the underlying workspace table.

Appendix G Real-World Failure Cases

Figure 9: Visual failure cases of LaGarNet in the real world. Text colour indicates the source of the failure: white for mechanical limitations, blue for oversights in our assumptions, and red for the learning process.

Figure 9 shows the failure modes counted in Table III. The mechanical cases follow from the single-arm parallel gripper, which cannot hold one part of the garment whilst pulling another and so leaves stubborn wrinkles in place. The assumption cases arise where the setup itself is the limit, such as the policy being unable to tell the front of a garment from its back. The learning cases are the ones the model could in principle avoid: disturbing an already flattened garment, or treating a trouser leg as though it were a sleeve.

Appendix References

  1. [1] K. Cho, B. Van Merriënboer, D. Bahdanau, and Y. Bengio, “On the properties of neural machine translation: Encoder–decoder approaches,” in Proceedings of SSST-8, eighth workshop on syntax, semantics and structure in statistical translation, 2014, pp. 103–111.
  2. [2] A. Q. Nichol and P. Dhariwal, “Improved denoising diffusion probabilistic models,” in International conference on machine learning. PMLR, 2021, pp. 8162–8171.
  3. [3] O. Ronneberger, P. Fischer, and T. Brox, “U-net: Convolutional networks for biomedical image segmentation,” in Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III 18. Springer, 2015, pp. 234–241.
  4. [4] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778.
  5. [5] Y. Wu and K. He, “Group normalization,” in Proceedings of the European conference on computer vision (ECCV), 2018, pp. 3–19.
  6. [6] R. Lee, J. Abou-Chakra, F. Zhang, and P. Corke, “Learning fabric manipulation in the real world with human videos,” in 2024 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2024, pp. 3124–3130.
  7. [7] R. Lee, D. Ward, V. Dasagi, A. Cosgun, J. Leitner, and P. Corke, “Learning arbitrary-goal fabric folding with one hour of real robot experience,” in Conference on Robot Learning. London, UK: PMLR, 11 November 2021, pp. 2317–2327.
  8. [8] A. P. Lindvig, I. Iturrate, U. Kindler, and C. Sloth, “ur_rtde: An interface for controlling universal robots (ur) using the real-time data exchange(rtde),” in 2025 IEEE/SICE International Symposium on System Integration (SII), 2025, pp. 1118–1123.
  9. [9] S. Garrido-Jurado, R. Muñoz-Salinas, F. J. Madrid-Cuevas, and M. J. Marín-Jiménez, “Automatic generation and detection of highly reliable fiducial markers under occlusion,” Pattern Recognition, vol. 47, no. 6, pp. 2280–2292, 2014.
  10. [10] F. C. Park and B. J. Martin, “Robot sensor calibration: solving ax= xb on the euclidean group,” IEEE Transactions on Robotics and Automation, vol. 10, no. 5, pp. 717–721, 1994.
  11. [11] A. Kirillov, E. Mintun, N. Ravi, H. Mao, C. Rolland, L. Gustafson, T. Xiao, S. Whitehead, A. C. Berg, W.-Y. Lo, P. Dollár, and R. Girshick, “Segment Anything,” in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2023, pp. 4015–4026.