GFPack++: Attention-Driven Gradient Fields for Optimizing 2D Irregular Packing
Organizations: Shandong University, China · Microsoft Research Asia, China · Peking University, China
Abstract
2D irregular packing is a classic combinatorial optimization problem with various applications, such as material utilization and texture atlas generation. Due to its NP-hard nature, conventional numerical approaches typically encounter slow convergence and high computational costs. Previous research (GFPack) introduced a generative method for gradient-based packing, providing early evidence of its feasibility but faced limitations such as insufficient rotation support, poor boundary adaptability, and high overlap ratios. In this paper, we propose GFPack++, a deeply investigated framework that adopts attention-based geometry and relation encoding, enabling more comprehensive modeling of complex packing relationships. We further design a constrained gradient and a weighting function to enhance both the feasibility of the produced solutions and the learning effectiveness. Experimental results on multiple datasets demonstrate that GFPack++ achieves higher space utilization, supports continuous rotation, generalizes well to arbitrary boundaries, and infers orders of magnitude faster than previous approaches. Codes for this paper are at https://github.com/TimHsue/GFPack-pp.
Figures & tables
| Dataset | XAtlas | NFP | SVGnest | GFPack++ ( ) | GFPack++ ( ) |
|---|---|---|---|---|---|
| Garment | 62.26 | 69.53 | 74.70 | 1.01 s | 61.49 | 65.49 | 67.94 | 6.13 s | 69.38 | 72.75 | 75.13 | 80.21 s | 69.37 | 74.22 | 77.83 | 3.25 s | 74.15 | 77.04 | 80.62 | 10.5 s |
| Dental | 63.18 | 70.86 | 73.59 | 1.25 s | 60.42 | 66.30 | 68.13 | 8.22 s | 67.22 | 73.64 | 76.49 | 96.73 s | 70.57 | 75.21 | 78.67 | 4.28 s | 74.06 | 77.53 | 79.79 | 14.5 s |
| Puzzle (square) | 56.16 | 66.48 | 76.15 | 1.21 s | 56.90 | 62.53 | 68.13 | 4.52 s | 61.00 | 67.22 | 73.21 | 42.55 s | 82.22 | 93.99 | 98.64 | 6.23 s | 84.80 | 95.12 | 98.74 | 32.1 s |
| Atlas (building) | 50.56 | 71.21 | 87.62 | 0.96 s | 41.97 | 67.32 | 83.31 | 2.76 s | 44.97 | 74.51 | 90.54 | 52.43 s | 58.96 | 78.78 | 98.47 | 8.12 s | 66.03 | 80.16 | 98.88 | 25.3 s |
| Atlas (object) | 38.58 | 60.98 | 76.09 | 1.43 s | 32.18 | 57.75 | 83.12 | 45.3 s | 41.53 | 63.87 | 83.12 | 402.2 s | 31.76 | 65.11 | 86.08 | 15.5 s | 41.95 | 67.47 | 86.81 | 65.4 s |
| Dataset | Algo. | Util.(%) | Over.(%) | Time(s) |
|---|---|---|---|---|
| Garment | GFPack | 69.82 | 0.85 | 81.2 |
| GFPack (E) | 72.17 | 0.23 | 124.0 | |
| GFPack++ | 74.25 | 0.08 | 7.9 | |
| GFPack++ (E) | 77.04 | 0.00 | 10.5 | |
| Dental | GFPack | 66.59 | 1.43 | 80.4 |
| GFPack++ | 69.31 | 0.06 | 8.0 |
| Geometric Enc. | Relation Enc. | Over. | Util. |
|---|---|---|---|
| GFPack | GFPack | 13.2% | - |
| GFPack++ | GFPack | 8.38% | - |
| GFPack | GFPack++ | 1.89% | 72.84% |
| GFPack++ (AvgPool) | GFPack++ | 0.85% | 73.11% |
| GFPack++ | GFPack++ | 0.08% | 74.25% |
| Batch Size | Valid Solutions | Time |
|---|---|---|
| GFPack++ ( ) | 38.53% | 4.21 s |
| GFPack++ ( ) | 67.54% | 7.95 s |
| Batch Size | IoU (Min Avg Max) | Time |
|---|---|---|
| GFPack++ ( ) | 80.39 % 93.75 % 96.80 % | 3.27 s |
| GFPack++ ( ) | 82.43 % 94.91 % 98.86 % | 4.23 s |
| Algo. | Building | Object |
|---|---|---|
| [ 40 ] | 68.3 82.7 98.0 | 37.7 68.7 86.2 |
| GFPack++ | 66.0 80.2 98.9 | 42.0 67.5 86.8 |
| GFPack++* | 61.5 78.4 97.4 | 36.2 66.2 83.9 |
| Teacher dataset | Min | Avg | Max |
|---|---|---|---|
| Garment | 63.02% | 72.39% | 78.90% |
| Dental | 67.33% | 74.16% | 77.36% |
| Atlas (building) | 39.92% | 74.55% | 95.74% |
| Atlas (object) | 24.69% | 63.25% | 85.18% |
| Atlas (general) | 40.76% | 67.54% | 92.41% |
| Dataset | Min | Avg | Max | Std |
|---|---|---|---|---|
| Garment | 5 | 81.57 | 284 | 76.83 |
| Dental | 17 | 34.47 | 123 | 14.50 |
| Puzzle | 4 | 8.25 | 29 | 2.86 |
| Atlas (building) | 4 | 6.52 | 70 | 3.87 |
| Atlas (object) | 4 | 67.41 | 1120 | 102.38 |
| Dataset | Polygon Count |
|---|---|
| Garment | 313 |
| Dental | 440 |
| Atlas (building) | 3262 |
| Atlas (object) | 6764 |
| Dataset | GFPack++ | XAtlas | SVGnest | |||
|---|---|---|---|---|---|---|
| Bef. | Aft. | Bef. | Aft. | Bef. | Aft. | |
| Garment | 74.25% | 77.04% | 68.90% | 69.53% | 70.98% | 72.75% |
| Dental | 75.11% | 77.53% | 69.88% | 70.86% | 72.55% | 73.64% |