We propose a learning-based generative model for completing curvilinear features under occlusion by environmental obstacles. To this end, we adopt a flow matching-based approach that supports the inpainting of occluded regions with the appropriate curvilinear features. To eliminate the reliance on privileged information about the occlusion a priori, we also train a UNet-based mask prediction model, which can identify regions for inpainting given only the occluded observation. The components of our approach are validated via experiments using procedurally-generated test cases, and the complete pipeline is validated using large public datasets for curvilinear objects. Against off-the-shelf inpainting baselines, ROCOCO is the strongest method by a wide margin when no occlusion mask is given, and is competitive with mask-supervised inpainting when one is, achieving best on full-image error and second only to LaMa on the occluded region, while using a completer of 7.7M parameters against LaMa's 51M and Stable Diffusion's 860M.
Figures & tables
Model
MSE ↓
ML1L ↓
MSE M↓
ML1L M↓
SSIM M↑
Naive UNet
0.0026
0.0170
0.0548
0.1354
0.764
Pure Flow
0.0028
0.0061
0.0731
0.1666
0.708
Flow + GT mask
0.0018
0.0036
0.0398
0.0892
0.851
Flow Blind (full pipeline)
0.0019
0.0038
0.0427
0.0922
0.844
Table 1: Ablation on procedurally generated data, averaged over 500 freshly sampled test cases. Because samples are generated at run time, no test case is seen during training. Subscript M denotes the occluded region.
Figure 1: Qualitative comparison on the wire dataset for all baselines. Columns show: Ground Truth, Occluded Input, Occlusion Mask, SD-Inpaint, SD-Blind, LaMa, ROCOCO-GT, ROCOCO-Blind.
Dataset
MSE ↓
ML1L ↓
MSE M↓
ML1L M↓
SSIM M↑
Wires ( Zanella et al., 2021 )
0.0024
0.0064
0.0576
0.1670
0.655
Cracks
0.0022
0.0060
0.0696
0.1931
0.547
Table 2: ROCOCO (blind) on the held-out splits of both realistic datasets.
Figure 2: Blind completions on held-out images from both datasets: the model receives only the occluded input, and must localize the occluder and reconstruct the curvilinear structure behind it without being told where it is.
Method
Mask
Params
MSE ↓
ML1L ↓
MSE M↓
ML1L M↓
SSIM M↑
SD-Blind
no
860M
0.0474
0.1407
0.4416
0.5411
0.258
SD-Inpaint
GT
860M
0.0041
0.0199
0.0895
0.1923
0.634
LaMa
GT
51M
0.0037
0.0297
0.0560
0.1468
0.695
ROCOCO
GT
7.7 M
0.0032
0.0073
0.0782
0.1955
0.596
ROCOCO ( n=8 )
GT
7.7 M
0.0022
0.0060
0.0540
0.1615
0.664
ROCOCO
no
7.7 M
0.0035
0.0078
0.0831
0.2012
0.586
Table 3: Comparison against off-the-shelf inpainting on the held-out wire split ( 62 images). “Mask” indicates whether the method is given the ground-truth occlusion mask; ROCOCO’s blind rows estimate it from the observation alone. Subscript M denotes the occluded region.
Figure 3: Completion quality against occluder size on the held-out wire split. Degradation is graceful: the occluded-region error rises by about a third as the occluded area grows more than tenfold.
Figure 4: Inference budget. Quality peaks at T≈2 integration steps rather than the tens typically used for iterative samplers, and averaging independent completions is a more productive use of the same compute.
Figure 5: Example Generation Result: Inpainting with Ground Truth Mask
Figure 6: Example Generation Result: Inpainting with Mask Prediction
Figure 7: Example Generation Result: Pure Flow Model
Figure 8: Example Generations: ROCOCO on cracks and wires
Figure 9: Example Baseline Comparison Result on the Wires Dataset
Figure 10: Training Losses, Naive UNet
Figure 11: Training Losses, Mask Prediction Model
Figure 12: Training Losses, Flow Matching Inpainting Model
Image inpainting reconstructs missing or corrupted image regions using surrounding context, learned visual priors, and optional structural or reference guidance.
Object removal and semantic inpainting of missing regions remain inherently ill-posed, as multiple plausible completions may exist for a given scene. Recent diffusion-based methods have demonstrated strong potential for high-quality object removal; however, they still face two key limitations. First, although they can synthesise sharp and high-resolution images, they often struggle to complete removed regions in a semantically consistent and contextually meaningful manner, where the generated content should agree with the surrounding scene layout and object relationships rather than merely appear visually realistic. Second, their iterative denoising process makes them computationally expensive, limiting their practicality for downstream applications. We propose SERO, a semantic prediction framework for single-step object removal. Our model predicts a hidden-region semantic prior in embedding space, which guides a latent bridge-matching generator toward plausible scene completion by providing both where to edit and what structure is likely to exist behind the removed object. This enables visually realistic and contextually coherent completions in one forward pass. Experiments on the RORD and OBER datasets show that SERO achieves competitive or state-of-the-art performance while requiring only a single generation step.
With the widespread adoption of autonomous vehicles and robotics, amodal completion, which reconstructs the occluded parts of people and objects in an image, has become increasingly crucial. Just as humans infer hidden regions based on prior experience and common sense, this task inherently requires physical knowledge about real-world entities. However, existing approaches either depend solely on the image generation ability of visual generative models, which lack such knowledge, or leverage it only during the segmentation stage, preventing it from explicitly guiding the completion process. To address this, we propose AmodalCG, a novel framework that harnesses the real-world knowledge of Multimodal Large Language Models (MLLMs) to guide amodal completion. Our framework first assesses the extent of occlusion to selectively invoke MLLM guidance only when the target object is heavily occluded. If guidance is required, the framework further incorporates MLLMs to reason about both the (1) extent and (2) content of the missing regions. Finally, a visual generative model integrates these guidance and iteratively refines imperfect completions that may arise from inaccurate MLLM guidance. Experimental results on various real-world images show impressive improvements compared to all existing works, suggesting MLLMs as a promising direction for addressing challenging amodal completion.
Learning physical fields directly from incomplete observations is challenging because authentic occlusions are structured, sample-dependent, and often missing not at random, whereas existing methods typically rely on heuristic masking rules or predefined mask distributions. We propose Observation-Aligned Mask Priors, a framework that learns the distribution of authentic observation masks and uses it to construct context-query partitions for training from incomplete data. Specifically, we pretrain a Bayesian Flow Network (BFN) on binary observation masks to capture real occlusion topologies, then guide BFN sampling with a globally normalized cross-entropy objective to generate sample-specific masks aligned with each sparse observation. The intersection between the guided mask and the observed mask defines the context, and the remaining observed entries become query targets for a diffusion-based reconstruction model. We show that this intersection-based partitioning gives every valid observed dimension a strictly positive probability of being queried, preventing zero-query dead zones and local generative collapse. Experiments on three real-world oceanographic datasets with authentic satellite occlusions, across resolutions up to 256×256, show consistent improvements over strong diffusion baselines in MSE and PSNR. These results demonstrate that learning mask priors from authentic occlusions is an effective alternative to heuristic masking for learning from incomplete physical observations without access to fully observed fields.
Chiyuan Ma, Zihan Zhou, Tianshu Yu
School of Data Science, The Chinese University of Hong Kong, Shenzhen · Shanghai Artificial Intelligence Laboratory