Learning Gradient Fields for Scalable and Generalizable Irregular Packing

Tianyang Xue, Mingdong Wu, Lin Lu, Haoxuan Wang, Hao Dong, Baoquan Chen · DOI

Abstract

Irregular packing, commonly known as the "nesting problem," is a computationally intensive NP-hard challenge central to manufacturing and logistics. Traditional approaches typically rely on either fast but inefficient heuristics or high-quality but computationally prohibitive global optimization. This paper introduces a novel generative framework that leverages score-based diffusion models to learn "gradient fields" from existing packing examples. By reframing packing as a conditional generative modeling problem, the proposed method evolves random initial configurations into high-utilization layouts. Evaluated on industrial garment and dental datasets, the model demonstrates the ability to outperform the traditional algorithms used for its training, achieving higher spatial utilization with significantly reduced inference times and robust generalization to unseen shapes.

Introduction

The objective of irregular packing is to arrange a set of non-convex, irregular polygons within a defined container to maximize density and minimize waste. This problem is foundational to industries such as garment manufacturing, sheet metal cutting, and logistics. However, the geometric complexity of irregular shapes makes overlap detection and optimal placement difficult.

Existing solutions often fail to generalize; a change in container dimensions or the introduction of a novel shape typically requires the algorithm to restart its search from scratch. This research proposes a learning-based alternative that treats the packing process as a denoising task, where a model learns to "push" shapes into valid, high-density arrangements based on learned geometric features and spatial relationships.

Methodology

The core innovation of this work is the application of score-based diffusion models to the nesting problem. Instead of searching for a discrete solution, the model learns a series of gradient fields (scores) that act as "pseudo-velocities."

1. Gradient Fields and Diffusion

The model is trained on "teacher" layouts generated by traditional optimization algorithms. It learns the gradient of the log-density of these successful packings. During inference, the model starts with a random distribution of shapes and iteratively applies these learned gradients to refine their positions. This process, governed by a Reverse Stochastic Differential Equation (SDE), allows the shapes to "jiggle" out of overlapping states and settle into high-density configurations.

2. Geometric and Spatial Feature Extraction

To handle the high topological complexity of irregular shapes—such as dental models with over 1,700 vertices—the authors employ a multi-scale architecture:

  • PointNeXt: A modified version of PointNet++ is used to extract fine-grained geometric features from the polygon vertices, ensuring the model understands the specific contours of each piece.
  • Graph Convolutional Network (GCN): A three-layer GCN performs spatial reasoning across the layout:
  • Global Layer: Establishes the macro-level arrangement of all polygons.
  • Local Layer: Refines the positioning of immediate neighbors.
  • Intersection Layer: Specifically identifies and resolves overlaps between adjacent shapes.

Experimental Setup

The model was rigorously tested on two distinct industrial datasets:

  • Garment Dataset: 314 polygons representing fabric pieces (5 to 284 vertices).
  • Dental Dataset: 109 complex polygons representing dental models (52 to 1,735 vertices).

The training data consisted of 20,000 layouts generated by a "bottom-left fill" algorithm optimized via simulated annealing. This "teacher" provided the baseline distribution for the diffusion model to learn.

Results and Discussion

Performance and Efficiency

The generative model demonstrated superior efficiency and utilization compared to the teacher algorithm. On the Garment test set, the model achieved a utilization rate of 68.16%, surpassing the teacher’s 64.22%. Furthermore, the model reached these results in approximately 6 seconds, whereas the teacher algorithm required over 42 seconds. This suggests that the model does not merely mimic the teacher but learns the underlying principles of efficient packing, allowing it to discover superior arrangements.

Scalability and Generalization

A key strength of this approach is its scalability. The model maintains consistent utilization rates even as the number of polygons increases from 20 to 128. Because the architecture focuses on geometric features and relative spatial relationships rather than absolute coordinates, it generalizes effectively to containers with different aspect ratios and to shapes not encountered during the training phase.

Limitations and Future Directions

While the results are promising, several challenges remain for production-level deployment:

  • Overlap Constraints: The model significantly reduces overlaps, but it does not provide a 100% mathematical guarantee of zero overlap, occasionally requiring a minor post-processing step.
  • Degrees of Freedom: The current implementation focuses on translations. Incorporating rotations is a necessary next step for comprehensive industrial nesting.
  • Dimensionality: The study is currently limited to 2D. However, the PointNeXt-based architecture is theoretically extensible to 3D bin packing, which would have significant implications for 3D printing and container loading.
  • Beyond the Teacher: Future work may involve Reinforcement Learning (RL) to allow the model to explore optimal packing strategies that exceed the capabilities of the initial training data.

Conclusion

By framing irregular packing as a generative task, this research provides a scalable, fast, and generalizable solution to a long-standing industrial problem. The use of gradient fields allows for a flexible refinement process that overcomes the limitations of traditional heuristic and optimization-based methods.

Summary updated

BibTeX
@inproceedings{xue2023learning,
  author = {Tianyang Xue and Mingdong Wu and Lin Lu and Haoxuan Wang and Hao Dong and Baoquan Chen},
  title = {{Learning Gradient Fields for Scalable and Generalizable Irregular Packing}},
  booktitle = {SIGGRAPH Asia},
  year = {2023},
  doi = {10.1145/3610548.3618235},
}
Figure