TL;DR
GarmentSegAgent is an autonomous framework that performs high-precision garment segmentation on complex web images without requiring human-provided spatial prompts. By using a novel iterative process called CAST (Constrained Attribution-guided Selective TextGrad), the agent diagnoses its own visual errors and surgically refines specific parts of its textual instructions to produce increasingly accurate masks.
What Problem Does This Paper Address?
Segmenting clothing in "wild" web images is notoriously difficult. Unlike clean catalog shots, these images feature cluttered backgrounds, overlapping garments, and tricky occlusions. While foundation models like the Segment Anything Model (SAM) are powerful, they usually require precise human-provided boxes or points to work well.
Existing autonomous methods often struggle with fine-grained details. When they try to self-correct, they typically rewrite their entire text prompt. This "naive" approach is risky: fixing a missing sleeve might accidentally cause the model to start segmenting the background or a different piece of clothing entirely. The challenge is creating an agent that can identify exactly what went wrong and fix it without breaking what was already working.
Methods
GarmentSegAgent operates as a closed-loop system involving four key components:
- Planner (Qwen2.5-VL): Generates a "semantic plan" based on an initial instruction (e.g., "segment the jacket"). It breaks this down into four structured fields: Target, Localization, Coverage, and Exclusion.
- Actor (SAM 2.1): Translates the plan into spatial prompts (bounding boxes and points) to generate candidate masks.
- Evaluator (Qwen3-VL): Inspects the masks for errors like "missing regions" or "background leakage."
- CAST Refinement Engine: This is the core innovation. Instead of a total rewrite, CAST uses Error Attribution to map visual errors to specific textual fields. For example, a missing sleeve is attributed to the "Coverage" field. It then applies Selective TextGrad—a language-based backpropagation technique—to update only those relevant fields while keeping the rest of the prompt under a "Garment Contract" (a set of constraints to ensure the target remains consistent).
Datasets
The authors evaluated the agent on three major fashion benchmarks, each offering different challenges:
- DeepFashion2: Features diverse consumer and commercial images with various viewpoints.
- ModaNet: Focuses on street-fashion imagery with highly cluttered backgrounds.
- Fashionpedia: Provides fine-grained annotations for complex garment attributes.
- COCO: Used for cross-domain testing to see if the framework generalizes to general person segmentation.
Key Insights and Ideas
- Surgical vs. Global Refinement: The paper demonstrates that "naive" whole-prompt refinement often leads to performance degradation. By isolating updates to specific instruction fields (e.g., only updating the "Exclusion" text to fix background leakage), the agent is much more stable.
- Visual-to-Textual Mapping: The ability to translate a visual error (a red blob on a sleeve) into a semantic instruction update ("include the cuffs and lower hem") allows the system to leverage the reasoning power of Large Vision-Language Models (LVLMs) for low-level vision tasks.
- The "Garment Contract": Implementing a set of logical constraints prevents the agent from "hallucinating" its way into a different task during the iterative loop, ensuring that a request for a "jacket" doesn't turn into a "shirt" after three iterations.
Key Results
GarmentSegAgent consistently outperformed state-of-the-art baselines (like SegZero+SAM 2 and LISA) across all metrics:
- Accuracy: Achieved an mIoU of 0.8124 on DeepFashion2, surpassing the strongest baseline by 1.65 percentage points.
- Boundary Precision: Showed significant gains in Boundary IoU (BIoU), indicating much cleaner edges around complex structures like collars and sleeves.
- Reliability: In refinement analysis, CAST showed a much higher Improvement Rate (88.7%) and a significantly lower Degradation Rate (6.4%) compared to vanilla TextGrad methods.
- Generalization: Even on the general COCO person segmentation task, it outperformed specialized models, proving the framework isn't just for clothes.
Limitations and Future Work
While powerful, GarmentSegAgent has a few hurdles:
- Inference Cost: The iterative nature requires multiple calls to large models (Qwen, SAM), which increases execution time (roughly 10-12 seconds per image).
- Single Target Focus: The current evaluation focuses primarily on single-target upper-garment segmentation. Extending this to multi-instance scenarios (e.g., segmenting every item in an outfit simultaneously) remains a challenge.
- Pixel-Level Guarantees: While the textual refinement is smart, the final mask quality is still capped by the underlying foundation model's (SAM 2.1) ability to follow the generated spatial prompts.
Future work will likely focus on making the refinement process more efficient and expanding the agent's "vocabulary" to handle more complex multi-garment interactions.
Summary updated