Table of Contents
Fetching ...

GFPack++: Improving 2D Irregular Packing by Learning Gradient Field with Attention

Tianyang Xue, Lin Lu, Yang Liu, Mingdong Wu, Hao Dong, Yanbin Zhang, Renmin Han, Baoquan Chen

TL;DR

This work tackles 2D irregular polygon packing, a challenging NP-hard problem, by proposing GFPack++, an attention-based diffusion framework that learns gradient fields guiding simultaneous polygon placement. It introduces two encoders—attention-based geometry encoding and attention-based relation encoding—together with a utilization-focused training weight and a post-diffusion utilization enhancement for refining layouts. The method supports continuous rotation and arbitrary boundaries, achieving higher space utilization and significantly faster inference than prior diffusion-based methods, with strong generalization to different polygon counts and boundary shapes. Practically, GFPack++ improves packing efficiency while offering scalable, interpretable attention mechanisms and a plan to release code and datasets for broader adoption.

Abstract

2D irregular packing is a classic combinatorial optimization problem with various applications, such as material utilization and texture atlas generation. This NP-hard problem requires efficient algorithms to optimize space utilization. Conventional numerical methods suffer from slow convergence and high computational cost. Existing learning-based methods, such as the score-based diffusion model, also have limitations, such as no rotation support, frequent collisions, and poor adaptability to arbitrary boundaries, and slow inferring. The difficulty of learning from teacher packing is to capture the complex geometric relationships among packing examples, which include the spatial (position, orientation) relationships of objects, their geometric features, and container boundary conditions. Representing these relationships in latent space is challenging. We propose GFPack++, an attention-based gradient field learning approach that addresses this challenge. It consists of two pivotal strategies: \emph{attention-based geometry encoding} for effective feature encoding and \emph{attention-based relation encoding} for learning complex relationships. We investigate the utilization distribution between the teacher and inference data and design a weighting function to prioritize tighter teacher data during training, enhancing learning effectiveness. Our diffusion model supports continuous rotation and outperforms existing methods on various datasets. We achieve higher space utilization over several widely used baselines, one-order faster than the previous diffusion-based method, and promising generalization for arbitrary boundaries. We plan to release our source code and datasets to support further research in this direction.

GFPack++: Improving 2D Irregular Packing by Learning Gradient Field with Attention

TL;DR

This work tackles 2D irregular polygon packing, a challenging NP-hard problem, by proposing GFPack++, an attention-based diffusion framework that learns gradient fields guiding simultaneous polygon placement. It introduces two encoders—attention-based geometry encoding and attention-based relation encoding—together with a utilization-focused training weight and a post-diffusion utilization enhancement for refining layouts. The method supports continuous rotation and arbitrary boundaries, achieving higher space utilization and significantly faster inference than prior diffusion-based methods, with strong generalization to different polygon counts and boundary shapes. Practically, GFPack++ improves packing efficiency while offering scalable, interpretable attention mechanisms and a plan to release code and datasets for broader adoption.

Abstract

2D irregular packing is a classic combinatorial optimization problem with various applications, such as material utilization and texture atlas generation. This NP-hard problem requires efficient algorithms to optimize space utilization. Conventional numerical methods suffer from slow convergence and high computational cost. Existing learning-based methods, such as the score-based diffusion model, also have limitations, such as no rotation support, frequent collisions, and poor adaptability to arbitrary boundaries, and slow inferring. The difficulty of learning from teacher packing is to capture the complex geometric relationships among packing examples, which include the spatial (position, orientation) relationships of objects, their geometric features, and container boundary conditions. Representing these relationships in latent space is challenging. We propose GFPack++, an attention-based gradient field learning approach that addresses this challenge. It consists of two pivotal strategies: \emph{attention-based geometry encoding} for effective feature encoding and \emph{attention-based relation encoding} for learning complex relationships. We investigate the utilization distribution between the teacher and inference data and design a weighting function to prioritize tighter teacher data during training, enhancing learning effectiveness. Our diffusion model supports continuous rotation and outperforms existing methods on various datasets. We achieve higher space utilization over several widely used baselines, one-order faster than the previous diffusion-based method, and promising generalization for arbitrary boundaries. We plan to release our source code and datasets to support further research in this direction.
Paper Structure (33 sections, 11 equations, 13 figures, 10 tables)

This paper contains 33 sections, 11 equations, 13 figures, 10 tables.

Figures (13)

  • Figure 1: (a) Our approach is a diffusion-based generation method. (b) We use a sequence-to-sequence model to encode and decode the state and velocities at each time step and generate the next state accordingly. Our model consists of two components: an attention-based relationship encoder (c) and an attention-based geometry encoder (d). The former encodes the geometric feature, spatial, and boundary relationships among the input variables using the attention mechanism. The latter computes the geometric features $\varepsilon^g$ using a multi-level GCN feature aggregation network and Attention Pooling.
  • Figure 2: Local Feature Representation. Our method leverages the information aggregation capability of GCNs combined with the multi-scale abilities of residual connections. It aggregates the geometric features of each point and its neighboring area with Eq.\ref{['eq:gnn']}.
  • Figure 3: Attention pooling for local features. For the local features of each point, we aggregate them into the shape features of the polygon using an attention mechanism.
  • Figure 4: Samples from the teacher datasets.
  • Figure 5: Puzzle dataset.
  • ...and 8 more figures