Embodiments of the present invention relate to a method for selecting parts to be placed on sheets using a computer.
DE 10 2020 129 293 A1 discloses a method for generating a cutting plan for cutting out parts from a plate-shaped material sheet. In particular, a plan for nesting the parts is generated in order to keep material waste to a minimum.
However, the method does not allow for flexible selection of parts to reduce the amount of material waste that occurs when cutting parts from a sheet.
Embodiments of the present invention provide a method for selecting parts to be placed on sheets using a computer. The method includes encoding geometric features of each part in a respective geometric information vector. For each part, one of the geometric features is a projected area of the part in a plan view. The method further includes generating a graph. The geometric features of each part are assigned to one node of the graph. All nodes of the graph are connected in pairs by one edge. The method further includes, in an inference phase, estimating geometrical compatibility indices (GCI) for all pairs of parts, wherein each GCI is a measure of how well the respective pair of parts is capable of being placed on a same sheet, assigning each GCI to a respective edge of the graph, the respective edge passing through two nodes representing the pair of parts to which the respective GCI is assigned, determining weights of the edges of the graph, wherein the respective weight of each respective edge depends on the GCI associated with the respective edge, and assigning the parts to a respective sheet by determining subgraphs through the nodes of the graph by an optimization method. The nodes through which a respective subgraph passes represent the parts to be placed on the respective sheet. A sum of the projected areas of the parts on each subgraph is at most equal to a size of the respective sheet.
Subject matter of the present disclosure will be described in even greater detail below based on the exemplary figures. All features described and/or illustrated herein can be used alone or combined in different combinations. The features and advantages of various embodiments will become apparent by reading the following detailed description with reference to the attached drawings, which illustrate the following:
Embodiments of the invention provide a method for assigning parts to metal sheets in a way that minimizes the material waste that occurs when the parts are cut from the metal sheets.
The method according to embodiments of the invention comprises the following steps:
According to embodiments of the invention, a set of parts is divided into subsets, each subset being arranged on a respective sheet. The subsets are determined such that the parts of the subsets optimally cover the respective sheets. The selection of suitable parts for a respective sheet simplifies the subsequent arrangement of the parts on the sheet. In particular, methods for determining the arrangement of parts on a particular sheet can be applied to a comparatively small number of parts previously determined for the sheet in question. Furthermore, material losses during cutting of the parts are greatly reduced.
The geometric information vector contains information on the shape and size of the respective part, for example, data on angles between edges of the part, side lengths of the part, and curvatures of the part.
The relationship between the weight w of a respective edge of the graph and the GCI assigned to the edge according to step XVI is given in particular by: w=1−GCI.
The graph is preferably designed as a fully connected geometrical relationship graph.
In an advantageous embodiment of the method, the optimization method in step XVII is performed using a quantum computer. In particular, a qubit can be assigned to each node of the graph. Thus, advantageously, high computational power of a quantum computer can be used while keeping the number of qubits required comparatively low.
In some embodiments of the method, one or more steps of the method are performed by a first neural network, preferably a Graph Neural Network, particularly preferably a Graph Convolutional Neural Network. The geometric information vectors associated with the parts are represented as nodes of the graph. Graph Neural Networks are then particularly useful for classifying the nodes according to which sheet the parts belong to that are represented by the nodes.
In preferred embodiments of the method, steps XIV, XV and/or XVI are performed by an actor-like module, wherein the actor-like module preferably comprises the first neural network. The actor-like module can be trained by the method of reinforcement learning to learn a strategy comparatively quickly, with which differently shaped parts can be assigned to given sheets in an optimal way.
In an advantageous variant of the method, assigning the parts to a respective sheet according to step XVII is performed by an optimization method for solving the capacitated vehicle routing problem (CVRP). The optimization procedure for solving the CVRP enables an optimal assignment of the parts to the respective sheets to be determined in a comparatively short time. In particular, the weights of the edges correspond to the distances between locations in the CVRP. The areas of the parts in plan view encoded in the nodes of the graph correspond to the capacities or demands assigned to the individual locations in the CVRP. The sheets on which the parts are placed correspond to the vehicles in the CVRP.
In particular, an algorithm for solving the CVRP can be implemented on a quantum computer to group the nodes of the graph into subsets, where the nodes in each subset correspond to the parts on a respective sheet.
According to a preferred embodiment of the method, the sheets have the same sheet size. This simplifies the application of a method for solving the CVRP in order find the optimal assignment of given parts to respective sheets.
In an advantageous embodiment of the method, determining the GCI for all pairs of the parts in a training phase which is performed before the inference phase comprises the following steps:
In this embodiment, the estimation method for estimating the second edge weights is advantageously optimized in the training phase to find suitable values of the GCI for given parts in as few steps as possible.
In particular, the relationship between a first weight w of a respective edge and the GCI associated with the edge is given by: w=1−GCI. The same applies to the second weights of the edges. The average according to step VII is determined in particular as an arithmetic mean value. The reward loss according to step VIII is in particular calculated by a Laplacian loss function L1, which depends on the reward function value and the suitability value.
The reward function value according to step VI can for example be calculated as the ratio of the sum of the projected areas of the parts in plan view to the respective sheet size for cach subgraph.
Preferably, the output values according to step VII are determined by passing the nodes of a respective subgraph through a first and a second consecutive graph convolutional neural network (GCNConv) layer, wherein the GCNConv layers initially use estimated values of the GCI as inputs, for example the estimated values from step III. The output of the first GCNConv layer is provided as input to the second GCNConv layer by a message passing function which takes into account the estimated values of the GCIs, the number of edges connected to each node in the subgraph, an information on which nodes are connected together, the weighted geometric information encoded in the nodes by the geometric information vectors and/or trainable weights of the GCNConv layers. The output values of the second GCNConv layer are then used to determine the average according to step VII.
In some embodiments of the method, steps X, XI and/or XII are performed by the actor-like module. The training procedure, in particular steps X, XI and/or XII, trains the actor-like module in such a way that advantageously the actor-like module alone can find the GCI when presented with new parts without further input.
In advantageous variants of the method, the step III, IV, VII, VIII and/or IX is/are performed by a critic-like module, wherein the critic-like module in particular comprises a second neural network, wherein the critic-like module preferably comprises a third neural network in addition to the second neural network, wherein the third neural network receives result data of the second neural network. The critic-like module can be used to improve the actor-like module without any external (human) input in the training phase by specifying values for the GCI parameters to be achieved by the actor-like module. By using two layers of the crtic-like module, the effort to determine the GCI can be reduced. For this purpose, the layers are designed in particular as convolutional layers.
In particular, all the output data of the critc-like module, preferably of the third neural network belonging to the critic-like module, is averaged to a single value corresponding to the suitability value in step VII.
The edge weight losses according to step X are preferably determined by a loss function, preferably a Gaussian loss function L2, which depends on the second edge weights (the values of the GCI determined by the actor-like module) and the first edge weights (the values of the edge weights determined by the critic-like module).
According to an advantageous embodiment of the method, the redetermination of the GCI according to step VIII is performed using error backpropagation to minimize the reward loss for the respective subgraph. The backpropagation allows the GCI to be determined in a comparatively time-saving manner according to step VIII in such a way that the reward loss function is minimized. The backpropagation is in particular used in connection with the Laplacian loss function L1 mentioned above.
In some variants of the method, the first termination criterion according to step IX is given by the reward loss being smaller than a first default value and/or the second termination criterion according to step XII is given by the edge weight losses at the edges of the graph being smaller than a second default value and/or the third termination criterion according to step XIII is given by the estimated values of the GCI changing by less than a third default value after going through steps III to XII. In particular, each individual edge weight loss is smaller than the second default value. Preferably, the change in each individual estimated value of the GCI is less than the third default value.
In a further embodiment of the method, the GCI are determined in step XIV using a metaheuristic. A metaheuristic can be used to determine approximate values of the GCI to obtain comparative values for the GCI obtained by a method according to steps XV through XVII. A metaheuristic can also be used if the values of the GCI cannot be found by a method according to steps XV through XVII.
In an advantageous variant of the method, the parts are arranged on the sheets and subsequently produced. If parts are manufactured using this method, material waste is greatly reduced during the production of the parts.
Exemplary embodiments are described below with reference to the drawing. The above-mentioned and the still further elaborated features can each be used individually or in any combination. The embodiments shown and described are not to be understood as a conclusive list, but rather have an exemplary character.
Reducing the material waste and operating time are primary objectives in Cutting and Packing problems (C&P). A solution to the C&P problem consists of many steps, including the grouping of items to be nested and the arrangement of clustered items on a large object. Current algorithms use meta-heuristics to solve the arrangement problem directly without explicitly addressing the grouping problem. In this work, we propose a new pipeline for the nesting problem that starts with grouping the items to be nested then arranging them on large objects. To this end, we introduce and motivate a new concept, namely the Geometrical Compatibility Index (GCI). Items with higher GCI should be clustered together. Since estimating GCIs is an unsupervised problem, we propose a Reinforcement Learning-based framework, which consists of two Graph Neural Networks (GNNs) trained in an actor-critic-like fashion. To group the items into clusters, we model the estimated GCIs in a graph as the reciprocal of distance in a Capacitated Vehicle Routing Problem (CVRP) and solve it using meta-heuristics. Experiments conducted on a private dataset with regularly and irregularly shaped parts show that the proposed algorithm can achieve a significant reduction in operating time (34% to 50%) compared to an open-source nesting software while attaining similar trim loss on regular parts and a three-fold improvement in trim loss on irregular parts.
The cutting and packing problems (in short C&P problems) are related to many areas of the operations research (OP) and they have been extensively studied for decades. The C&P problems have been referred to, in literature, with different terminologies over the past decades [1]-[3].
The C&P are NP-hard problems with identical common logical structure which can be described as follows. The inputs are two groups of geometrical data elements, namely a set of large objects, and a set of small items. The aim is then to select a set of some or all small items, group them into one or more subsets, and finally pack each of the resulting subsets on a corresponding large object, in a pattern (a.k.a. layout), while satisfying some geometric conditions [4]. The first geometric condition to be satisfied is that the small items of each subset must be laid entirely within the sheet. And the second geometric condition is that all small items lying on the same large object must not overlap. The residual unused areas, remaining uncovered by a small item, on the layout are usually treated as trim loss or waste. The objectives of the C&P problem are to reduce this waste to maximize the material utilization and to reduce the operating time. Reducing the trim loss can be very beneficial from the economic point of view in very large scale productions such as sheet metal, wood and textile production as it can result in savings of material and consequently in reduction of production costs.
In general, a solution to a C&P problem may consist of using a set of some or all large objects, and a set of some or all small items depending on the problem's objective and constraints. Considering the broad constraints, a formal formulation of five sub-problems can be derived [3]:
In almost all of the C&P industries, the small items to be packed are provided by customers and hence the second sub-problem is disregarded. If similar large objects are used, which is usually the case, the first and fourth sub-problems will be dropped. Therefore, the C&P problem is practically reduced to only the third and fifth sub-problems, i.e., grouping the parts to be nested into clusters and finding a layout for each cluster by arranging its small items on a large object.
In most of the C&P industries, the C&P process is referred to by the Nesting process. The small items are also usually called Parts and the large objects are called Sheets. The latter terms, i.e., nesting, parts, and sheets, will be henceforth used in this work.
Over the past decades, the fifth sub-problem, i.e., the “layout problem”, has been mostly addressed, where it is assumed that only one sheet is used for all of the parts and hence no parts clustering is needed. The layout problem has been extensively studied using exact methods [5]-[9], heuristics [10]-[14], meta-heuristics [15]-[18], supervised machine learning [19], [20], and reinforcement learning [21]-[26]. In contrast, the third sub-problem, i.e., the “grouping problem”, has often been ignored. The current existing commercial nesting software known to us solve the grouping problem implicitly as a part of the layout problem. They start with a single sheet for placing all the parts then discard the parts that do not fit on the current sheet and place them on a new one.
In this work, we hypothesize that a new nesting pipeline, where the grouping problem is directly solved before the layout problem, will positively impact both material utilization and the nesting time. We reason that the trim loss can be reduced if the clustered parts already fit together geometrically before placing them on the sheet (
To the best of our knowledge, this is the first learning-based approach for solving the grouping problem in the scope of nesting. The grouping problem is an unsupervised learning task, as we initially do not have any labels or hints about the geometrical suitability between the parts to be nested. We quantize, in this work, the parts' geometrical suitability by a value which we call the “Geometrical Compatibility Index” (GCI). We model the GCI as the weights of the edges of a fully connected Geometrical Relationship Graph (GRG) by means of a Graph Neural Network (GNN). The targets used to update the GNN parameters are generated using meta-heuristics in a Reinforcement Learning (RL) fashion.
The flow of this work is as follows. A practical motivation for the geometrical compatibility concept and its effect on trim loss is provided in Section III. Our definitions and hypotheses about the geometrical compatibility concept are then introduced in Section IV. In Section V, we present current research state relating to estimating the edges in a GNN and how they relate to our work, we also show some paradigms that will be used later in our methodology. In Section VI, we show an example of our dataset and reveal the preprocessing applied on it. We explain also in details the architecture of our framework for estimating the GCI values for a set of given parts. We conduct a study on the effect of different non-linear reward functions on our framework and discuss their results in Section VII-A. In Section VII-B, we compare the performance of our framework against an existing open-source nesting software. Finally we conclude our work in Section VIII and suggest further future research directions.
According to some embodiments,
In this section, we formally define the grouping problem. We assume there are N parts to be nested on K sheets. We denote the parts areas by an, their geometry information by gn and the sheets' areas by sK. In this formulation, the geometry information encodes the inner and outer contours of each part. In this work, we consider that gn is a vector in latent space, Rd, where d is the dimension of the latent space. We seek to find xnk∈{0,1}, which denotes whether the part n will be assigned to sheet k. Parts which are assigned to the same sheet are grouped together. The optimization problem can be formulated as follows:
BBk is the rectangular bounding box enclosing all the parts nested on sheet k. BBk is first calculated by solving the layout problem for sheet k, i.e., after nesting all parts which have xnk=1 on sheet k. Equation (1a) denotes finding xnk which minimizes the material waste, Area(BBk)−Σn=1Nan on each sheet. The constraint in (1b) states that each part must be assigned to one and only one sheet. The second constraint in (1c) states that the total area of all nested parts on sheet k must not exceed the sheet's area, sk. And the final constraint in (1d) imposes that each sheet must be used to its maximum capacity.
This optimization problem is ill-defined because Area (BBk) is an unknown non-linear function of the nested parts' geometry and areas. It can be expressed as:
A solution to the grouping problem consists in finding a mapping function π, which maps the parts' geometrical information gn, parts' areas an, and the sheets areas sx to the coefficients xnk, which determine the groups.
To find a solution to the grouping problem, we seek to approximate the mapping:
Since this mapping is hard to estimate, we propose to break it down into two mappings by introducing an intermediary value which can be learned from the data and can then act as a criteria for the grouping. For the intermediary value, we define a new concept, the Geometrical Compatibility Index (GCI). The mapping I can be expressed as π=π2∘π1. The first function in the proposed solution, π1, tries to estimate the GCIs between all the parts given their geometrical information, {gn}n=1N. The set of all estimated GCIs is expressed as {GCIn,m}, where n and m are two different parts. The second function, π2, estimates the coefficients {xnk} given the GCIs. For instance, parts with high GCIs should be grouped together, while parts which have low GCIs should belong to different groups. In short, the mapping functions can be expressed as:
In the following two subsections, we motivate the proposed solution to estimate the mapping functions, π1 and π2.
The goal of this mapping function π1 is to estimate a quantitative criteria to cluster the parts. We hypothesize that geometrical compatibility between parts is a reasonable choice for the grouping criteria. However, GCI is an abstract concept which we motivate by a simple example, before giving a formal definition in Section IV.
To show how the selection of geometrically compatible parts can lead to more material savings, we show three different simple parts (square, triangle, and circle) in
The red circle instead has a higher geometric compatibility with the nested parts and therefore left more space for another red circle. This subsequently has increased the area utilization and reduced the material waste. Quantitatively, the wasted area for nesting only a single orange triangle is 9, 650 mm2, while the wasted are for nesting two red circles is 6, 807.6 mm2. Hence, a higher geometrical compatibility saves more area for new parts to be nested and reduces trim loss. Note that the geometrical compatibility is not to be confused with the area suitability. The red circle and orange triangle have the same area, the former is geometrical compatible whilst the second is not. Furthermore, differently sized circles with area less than or equal 3, 257.32 mm2, would also fit perfectly without changing the layout.
As shown in the example above, the GCI estimation problem cannot be just estimated in a pairwise manner, without observing other parts in a group. For this, we first assume that all given parts form one large group. To estimate GCIs between all parts, we choose to model the parts as nodes in a graph and GCIs as weighted edges between the nodes. We refer to this graph as the Geometrical Relationship Graph (GRG), and we use a Graph Neural Network (GNN) to estimate the weights of its edges.
After estimating the GCIs, we propose to use them as a criteria for the grouping. The mapping π2 can be seen as a solution to another optimization problem, which seeks to find out what are the optimal sets of parts which should be chosen together to achieve the maximum GCI sum for different sheets. This optimization problem can be expressed as:
This new formulation, while satisfying the constraints in (1b)-(1d), is analogous to a typical Capacitated Vehicle Routing Problem (CVRP) formulation, which tries to find out the optimal set of routes for a fleet of vehicles to traverse. In this analogy, the GCI is the reciprocal of the distance (distance=1−GCI), the sheets are the vehicles with defined capacities (areas) and the parts are the cities in the typical CVRP problem. To solve for π2, we use meta-heuristics instead of exact methods to find a good solution in an acceptable time.
From Subsection III-A, it is clear that the GCI cannot be concretely estimated in a defined way before solving the layout problem. Moreover, it is not possible to get labels for the GCIs, because the GCIs between parts change whenever the grouping policy changes. It is also very computationally expensive to use a brute-force approach and try out all grouping permutations to generate GCI labels for supervised learning. For this, we propose to learn the GCIs by maximizing a reward function from a nesting environment using Reinforcement Learning (RL). The reward function R is chosen to be the ratio between the area of the parts of a group and the area of the sheet k on which they are nested, and it is computed for each group of parts as follows:
In this section, we give formal definitions for GCI and GRG.
Definition 1 (GRG). The GRG is a fully connected, bidirectional weighted graph representing the parts to be nested along with their geometrical relationships.
Definition 2 (GCI).: The GCI is a scalar variable with fixed bounds that is computed graph-wise rather than pair-wise. Its value is the weight wnm of the edge enm in the GRG, i.e., wnm=GCInmGCInm∈[0,1]. It denotes the geometrical relationship between two parts in the sense of their geometrical compatibility, not their area compatibility, to be nested together on the same sheet.
Cutting and Packing Problem. The C&P problems exist in various industries and have been studied in depth for a long time [27]. They appear repeatedly in the literature with several variations of the name such as the layout design problem in [28], the spatial configuration problem in [29], cutting stock or trim loss problem, bin or strip packing problem, vehicle, pallet or container loading problem, nesting problem, knapsack problem, etc. The C&P problems are present in various forms and variants depending on the objectives of the problem at hand and the constraints present during approaching the problem. The main objectives of a C&P problem are to reduce the computation time and to maximize the material utilization by reducing the trim loss and increasing the packing efficiency. The latter objective is particularly very important for big industries with mass production because the total trim loss is reduced leading to massive savings [30]. The most spotted nesting problem in literature was the layout problem. Several techniques have been developed over the years to tackle the layout problem, which can be categorized into: exact methods [6], [7], [31], heuristics [10]-[12], [32], and meta-heuristics [15]-[18]. More recent approaches [25], [26], [33] utilize Deep Reinforcement Learning (DRL).
Contour Similarity and GCI. In order to increase the compactness and reduce the scrap while solving the layout problem, the “contour similarity” concept was introduced in the literature of the 2D-bin packing [34], [35]. The contour similarity aims to match the new parts with the sheet's unoccupied closed polygons having similar contour. A time exhaustive approach to find contour similarity was first studied by searching for the new part's optimal angle with a fixed angle step size [36]-[38]. More recently, the contour similarity was researched in the field of additive manufacturing through the Freeman chain code in [34] and using the longest similarity subsequence (LCSS) approach in [35]. In this work, we introduce the concept of geometrical compatibility, which differs from the contour similarity concept in different aspects. (1) Contour similarity is a specific case from the geometrical compatibility; if two parts are geometrically compatible, they will be nested together on the same sheet, but they will not necessarily be adjacent on the sheet, as it would be the case for contour similarity. (2) Contour similarity is computed pair-wise and would be time exhausting if computed for all possible pairs inside a group of parts. On the other hand, GCI is computed graph-wise and considers relationships between all parts at once in the GRG. For instance, in [35], contour similarity was calculated using an iteration-based algorithm, LCSS, which at its best has a time complexity of O(n·m) where n and m are the lengths of the two input sequences. GCI is estimated using a learning-based algorithm with a O(1) time complexity at inference time. (3) Lastly, contour similarity targets the layout problem, unlike GCI, which focuses on the grouping problem.
GNNs are widely used for classification. There exist three typical classification tasks in a graph: node classification, edge classification, and node and edge classification. The classification task is either based on node features only (e.g., GraphSAGE [39] and DeepWalk [40]) or on both node and edge features (e.g., EGNN [41]). Graph Convolutional
is a convolutional operator first introduced in [42]. GCNConv is one of the most widely used architectures for classification in graphs. The majority of graph neural network models share a largely universal architecture which is based on using a message passing function to aggregate information from neighbor nodes into the current node. The main message passing function used in the forward path of the GCNConv is given by
In Equation (7), A is the adjacency matrix of the input graph representing which nodes are connected together. The adjacency matrix would be a matrix of ones if the input graph is a fully connected graph, which applies to the GRG. Â represents the adjacency matrix with self-loops inserted, i.e., each node is connected to itself which is depicted by the identity matrix I. The adjacency matrix is also known as the “edge weights matrix” when it contains values that indicate how closely connected the nodes are to one another rather than only values that indicate the nodes' connectivity (zeros and ones). {circumflex over (D)} is the diagonal node degree matrix, where the diagonal element corresponds to the number of edges connected to the node, namely, {circumflex over (D)}ii=Σj=1NÂij. Furthermore, X denotes a matrix of node feature vectors, Θ is the trainable weight matrix for the GCNConv layer, and X′ is the weighted aggregation of the features of the neighbor nodes.
In this work, the values of the adjacency matrix are determined by means of the GCI. The GCI, however, is not known a priori and thus, has to be learned. Learning the GCI corresponds to an edge labeling problem. Current approaches, such as EGNN [41], cannot be used, though, as they assume the existence of some node labels that do not exist in our case. For this, we propose a hybrid approach using DRL that combines previous techniques to overcome the problem of missing labeled data.
The Vehicle Routing Problem (VRP) is an NP-hard optimization problem and is substantially a generalization of the well-known traveling salesman problem (TSP). It is used in supply chain management to design an optimal route for a fleet of vehicles to serve customers under a set of constraints. The common constraints between all the VRP types are minimizing the global distance between customers and the number of vehicles needed to serve all customers. The VRP has been extensively studied in literature through many heuristics and meta-heuristic algorithms surveyed in [43], [44]. There are two main variants of the VRP, the VRP with Time Windows (VRPTW) and the capacitated VRP (CVRP). The third constraint for the VRPTW is to serve all the customers within a predefined time window. CVRP assumes that all the vehicles in the fleet have a uniform capacity and the customers have known demand for a single commodity. To solve CVRP, a third extra constraint must be fulfilled: each vehicle must not exceed its capacity. This work makes an analogy between GRG and CVRP to group the parts based on their GCIs.
Reinforcement learning is a decision-making framework where an agent represents the solver of the problem, and an environment represents the problem to be solved. At each state of solving the problem, the agent interacts with the environment by selecting an action to be applied. By applying the action, the environment updates its state and returns the new state and a scalar reward evaluating the quality of the action taken to the agent. In any state, the agent selects the action by following a policy. The agent's goal is to optimize its policy by maximizing the total accumulated reward, also called the return. To decide on actions to be taken in future states, the agent indirectly uses past experiences by building an estimation function of the return called the value function. One widely used agent's paradigm is the actor-critic paradigm, where the actor tries to optimize the policy, and the critic tries to optimize the value function. The actor-critic algorithms can be categorized based on two criteria [45]: whether a discounted [46]-[48] or an average reward [49]-[51] setting is used, and whether the policy's parameters are updated using the standard (also known as vanilla) gradient [52]-[54] or the natural gradient [55], [56]. The central concept behind all the actor-critic algorithms is that the value function estimated and optimized by the critic is used to guide the actor's policy to the improvement direction of performance.
In this section, we present the proposed approach to solving the grouping problem. First, we present an overview of the different components of our approach, then we present the parts encoding, the architectures of actor and critic modules and the learning routine.
Our approach consists of finding the mappings π1 and π2. The proposed framework consists of four components:
The input to our algorithm is the set of parts to be nested, where each part is described by its area and its geometrical shape. To alleviate the task of the first policy, π1, we encode the geometrical shape of each part, described as a rasterized image, into a geometrical information vector. Inspired by representation learning, the rasterized image of each part is encoded using an autoencoder into a vector gn in Rd, where d=256, as a preprocessing step. An encoding of the parts would facilitate the GCI learning task and optimize needed computation resources by reducing dimensionality. The encoded geometrical information vector gn of a part n will be further used as its GRG node's features in Subsection VI-C. A customized autoencoder based on the inception network [57] was trained on a different datasets of more than 10, 000 rasterized parts including some layouts images. To evaluate the encoding generalization on new images, the autoencoder has been tested on unseen new images of single parts (
Motivated by the “learning with a critic” concept [58], which incited Sutton, Barto, and Anderson [59] to outline the fundamental concepts of all the modern Actor-Critic algorithms in the RL field, our model consists of two modules: actor-like and critc-like modules (
a) Critic-Like Module: In the critic-like module, the nodes of a sub-graph of the GRG are passed through two consecutive GCNConv layers to perform message passing between the nodes. The rationale for using a sub-graph rather than the entire GRG will become clear in the “Data Collection” step of Subsection VI-D. Both GCNConv layers take initially a random edge weights matrix representing the GCIs. The output, of the first GCNConv layer is then provided as input to the second GCNConv layer. Theoretically speaking, in Equation (8), the matrix of node geometrical information vectors [g1, . . . , gN] of the input graph represents the X, while the edge weights represent the  matrix and are learnable parameters.
To guide the improvement of the actor-like module, the final GCNConv layer's outputs are averaged to a single value estimating the environment's reward. This value is compared to the ground-truth reward signal coming from the environment using a L1 loss function. The L1 loss is further used in backpropagation with Stochastic Gradient Descent (SGD) to update the parameters of the 2 GCNConv layers and the edge weights matrix. Each parameter of this edge weights matrix stands for a GCI between its connecting nodes (i.e. parts).
Actor-Like Module: The actor-like module consists of one GCNConv layer, which takes the nodes of the GRG as input and an adjacency matrix of ones (as it is assumed that all nodes are connected). The goal of the actor-like module is to learn a forward mapping between the input graph nodes and the edge weights Âestimate, which is a matrix of dimensions N×N, where N is the number of the nodes in the graph. After updating the edge weights of the critic-like module, the L2 loss function is computed between the output of the actor-like module Abestimate and the edge weights A blearned by the critic-like module. The parameters of the actor-like module's GCNConv layer are then updated by SGD in backpropagation.
The actor-like module learns an edge-labeling task.
It might be mistakenly thought that the critic-like module has achieved the whole task by learning the edge weights, and the actor-like module is redundant. Practically speaking, this is partially true. The critic-like module learns the GCIs by backpropagating on the learnable parameters of the edge weights matrix. However, the critic-like module maps the input nodes and the GCIs to a reward function and only learns the GCIs by backpropagation, which is impossible at test time.
In simple words, we can say that the critic-like module has no memory for learned knowledge. The role of the actor-like module is to generalize the knowledge learned by the critic-like module.
a) Actor-Critic-Like vs. Actor-Critic: The actor-critic and actor-critic-like paradigms agree on the concept but differ on its implementation. The critic in the actor-critic paradigm implicitly improves the actor, by insinuating the direction of actions update from an evaluation signal (e.g. v-value, q-value, a-value or return). On the other hand, the critic-like in the actor-critic-like paradigm explicitly learns the good actions by directly estimating the reward signal and teach the actor those actions. The actor and critic have “act then get criticized” dynamics: the actor takes action first and then the critic evaluates its performance. The dynamics between the actor-like and critic-like are rather “get criticized and then learn”: the critic-like learns explicit action by evaluating it, and then the actor-like learn this action.
The GCIs of the GRG could only be learned by nesting the parts of the GRG on sheets and evaluating the layouts quality in a RL framework. In this section, the GCI's, and accordingly the GRG's, learning procedure (Algorithm 1) is explained in details.
a) Initialization of the environment: The first step is to initialize a nesting environment. In the RL context, the action-space consists of all the sets of parts that could be nested together on the same sheet, i.e. each action is a sub-graph of the GRG. The state-space includes only the initial state which is the set of all parts in the GRG. In other words, there exists only one state which is the whole GRG graph, and each action is a sub-graph of the GRG that the agent believes that its parts will be geometrically fitting together on the same sheet. The environment takes a sub-graph, nests its parts on the same sheet, and returns the quality of the resulting layout (Equation (6)) as a “reward” to the agent.
b) Initialize a replay Buffer: To store the experiences collected from the agent and environment interactions, a replay buffer is initialized for the GRG. Each entry of the reply buffer is a pair of binary mask and reward. The mask filters out all the GRG's parts that are not included in the sub-graph. The replay buffer has a limited capacity and once it is full the newest experience replaces the oldest one. This allows an off-policy training, since experiences collected from old policies are used to learn a new one.
c) Data Collection: In the data collection step (
the environment to be nested on the same sheet and a reward is returned. The mask of the sub-graph and the reward are then stored in the replay buffer.
d) Update Step: To update the actor-like and critic-like
d) Update Step: To update the actor-like and critic-like modules, we sample a random batch of experiences from the replay buffer. The mask of each element in this batch is used to recover the sub-graph and the reward is used to compute the L1 loss and update the critic-like module. After the update of the critic-like module, the whole GRG is used by the actor-like module to estimate the GCIs. Those GCIs are again compared to the edge weights matrix learned by the critic-like module, in a L2 loss function, to update the actor-like module (
e) Extension to large GRGs: In order to limit the computation resources, the GRG is restricted to comprise at most only N parts. To extend the model on larger datasets which contain N parts with N>N, we divide the big GRG into
smaller GRGs of N parts each (
We perform multiple experiments to showcase the effectiveness of our model. In Section VII-A, we study the effect of different choices for the reward functions for a single GRG with N=500. Next, in Section VII-B, we compare the performance of the proposed model to an open-source nesting software.
Nesting environment. For our experiments, we developed a dummy environment that does not solve the layout problem but rather considers only the parts' areas to calculate the reward of the current nested parts. There are several reasons behind the choice of a dummy environment. First, real nesting environment are very slow, in solving the layout problem, compared to the GNNs and will increase their training time drastically by increasing the data collection time. Second, a dummy environment can be considered as a more general and abstract case of a real nesting environment as the proposed algorithm is not limited to a specific layout-solver algorithm. This design choice constitutes a proof of concept of the GCI and GRG ideas. Realizing the reward function (Equation (6)) in the dummy environment is impossible since this reward is a function of Area(BBK) which is a non-linear function of the geometries and the areas of the nested parts (Equation (2)) that can only be calculated after solving the layout problem. However, in the dummy environment the layout problem is not solved and the bounding box area cannot be computed. To approximately simulate the non-linearity of the reward in (6), we designed the reward function of the dummy environment to be a non-linear function F of the utilization ratio U. For each subgraph (group of parts), formed by the CVRP to be nested on sheet k with area sk, the utilization ratio Uk and the reward Rk are calculated as follows:
For the selection of F, the effects of two different non-linear functions have been examined in Subsection VII-A.
Dataset. Our dataset consists of 2, 500 CAD files representing different irregular complex geometrical parts from sheet metal production. The parts used are to be nested on sheets of size 3000 mm×3000 mm. The CAD files of the parts are translated into Scalable Vector Graphics (SVG) format. To capture the difference of dimensions between parts, the canvas is set as a constant frame of reference. Each part is placed at the top left corner of the canvas and is rasterized into a 128×128 pixels binary image as shown in
In this set of experiments, we select only 500 parts from the training set to train the models, which can be grouped into one GRG. We experiment with two different non-linear functions F for the reward calculation to test the generalization ability of the proposed model. We train the first model using a sinusoidal function of the utilization ratio as follows: Rk=sin ((Uk−0.5)·π). The range of the utilization is set to [−0.5, 0.5] to make the reward range between [−1, 1]. The second model uses a sigmoid function for the reward. This reward is also non-linear and represents a different challenge to the agent. The reward function is expressed as follows:
In this case, the range of the reward is [0, 1].
Model a. In this model, the reward function is a non-linear sinusoidal function.
Model b. In this model, we use a Sigmoid reward function.
We show the estimated GCI for models a and b on test split 1 in
To the best of our knowledge, the nesting sub-problem of grouping the parts to be nested into clusters before doing the nesting itself has never been handled before by any nesting software. Almost all of the current nesting software are trying to solve two other nesting sub-problems, namely finding the best order of the parts to nest, and selecting the angle and xy-position of each part on the sheet, i.e., the nesting/packing itself. After selecting the nesting order of the parts, usually through meta-heuristics, and during packing the parts on the sheet, the parts that do not fit on the current sheet are placed on a new one. That's how the clustering sub-problem is solved in the nesting software without taking into consideration the suitability of the parts to be nested together.
To get a sense of how our approach compares to other existing frameworks, we conducted an experiment to compare the performance of our framework to the performance of an open-source nesting software called DeepNestPort. DeepNest-Port is substantially a port for a browser-based vector nesting tool called SVGNest to handle different input/output image formats. We choose DeepNestPort as a baseline to compare with for three reasons: (1) it's an open-source software which makes it easily accessible for research purposes, (2) SVGNest claims to have a similar performance to commercial software and (3) other learning frameworks which solve the layout problem operate only on a smaller number of regular parts, and are not suitable to operate on a large number of regular and irregular parts. It should be noted that we used only a simple dummy environment throughout the training of our model which we expect to affect the results negatively. Training with one of the existing nesting software as environment would be impossible, as they are very slow and therefore not suitable for an RL training which needs huge amounts of samples to learn from.
Baseline and models. In this experiment, we first give all parts in each test split to the DeepNestPort framework to nest. The performance of this experiment is considered the baseline. Then, we report the performance of four models: models a and b trained twice, on 500 parts and 2, 000 parts. For each model, we estimate the GCI values of the parts and split them with CVRP. Then, we nest each group of parts, corresponding to a specific route from the CVRP problem, on a sheet using DeepNestPort. The main difference is that DeepNestPort assigns the parts to each sheet on its own, while in our case, the parts are assigned according to their GCIs.
Metrics. We evaluate the performance of our model using two metrics: time (T) and wasted material (WM). Time (in seconds) is calculated by measuring the nesting time of all used sheets after the proposed grouping operation. Wasted material (expressed as a percentage) is the ratio of the sum of wasted areas in all used sheets over the total area of the sheets. The wasted area of a sheet is considered as only the unused area inside the rectangular bounding box enclosing all the parts nested on a sheet. The unenclosed area could be reused to nest new parts. Therefore it is not considered scrap.
Results and Discussion The results are reported in Table I. In case of using DeepNestPort, a total number of four and two sheets each of the dimension 3000 mm×3000 mm were needed to nest the required 113 and 124 parts of test split 1 and 2, respectively (refer to Appendix VIII for layouts visualization). Test splits 1 and 2 were nested in an average time of 600 sec and 761 sec and the material wasted percentage in this case was 13% and 20% of the total area of the used sheets respectively. In the case of using GCIs, a total number of 4 sheets was suggested for test split 1 and 2 sheets for test split 2.
From the table, we first notice that Model a generalizes better than Model b in all combinations. This shows empirically that the sinusoidal reward is better suited than the sigmoid reward. Second, both models achieve better than the baseline on test split 2, with Model b resulting in only 7% material waste, almost 3 times less than DeepNestPort, when trained on 2000 parts. Model b still achieves a considerable reduction when trained only on 500 parts. The difference in the two results can be explained away by the number of parts during training. Both models a and b however experience a slight degradation in performance on test split 1. We hypothesize that this effect could be mitigated by designing a more realistic nesting environment or tuning the choice of the reward function.
Overall, the framework consistently achieves a lower operating time than the classical nesting approach in all combinations. The operating time is reduced on average by 48% on test split 1 and by 30% on test split 2. The longer time in test split 2 is attributed to the irregular shapes of the parts. This stems from the fact that solving the grouping problem implicitly during the layout problem results in a large number of combinations which the nesting environment should consider. In contrast, the proposed pipeline divides the parts to be nested into small groups with more compatible parts, which in turn can be nested directly on the sheets in fewer combinations.
Limitations. One limitation of this work is that no nesting environment was used during the training. However, this is a promising result, because the model can achieve a considerable reduction in time and waste material on irregular parts. We believe that the use of a realistic nesting environment during the training will further reduce the material waste. However, the design of such an environment is out-of-the-scope of this work and is considered in future works.
Another limitation of the proposed framework is that the use of meta-heuristics to solve the CVRP problem might lead to sub-optimal results or even no results at all in an acceptable time frame. We plan to address this issue in future works by replacing meta-heuristics with a plug-and-play learning-based approach, e.g. [60]. Overall, these results validate our hypothesis, that a different pipeline design (where the grouping problem is solved before the layout problem) can significantly speed up the nesting process and reduce the scrap produced.
The above tabel (TABLE I) shows a comparison between GRG and DeepNestPort. Test Split 1 contains regular parts, while Test Split 2 contains irregular parts. Best numbers are marked in bold.
In this work, we revisit the conventional nesting pipeline by directly solving the grouping problem of parts before the arrangement problem. To achieve this, we introduced and formally defined two new concepts, namely GRG and GCI. We proposed an RL-based framework to estimate the GCIs of parts in an unsupervised way. The framework consists of two GNNs trained in an actor-critic-like fashion, where the actor estimates the GCIs and the critic judges their quality by fitting the reward function of a nesting environment. The proposed framework was tested on two dummy environments with different non-linear reward functions. Comparison with an open-source nesting software was conducted to showcase the performance of the proposed grouping and nesting pipeline. We demonstrate the effectiveness of the framework by achieving a three-fold improvement in the waste material on a test split with irregular shapes and a 34% improvement in operating time. Similarly, the model achieves a 50% reduction in time with a minimal sacrifice in waste material on another test split with regular parts. In future works, we plan on completing the pipeline by developing a smart nesting algorithm for the layout problem.
In a fifth step 110, a reward function value for each subgraph is determined as a measure of how much of the surface area of the respective sheet is covered by the parts on cach subgraph after the parts are nested on the respective sheet. In a sixth step 112, a suitability value for each subgraph is determined in the form of an (in particular) arithmetic average of output values for the respective subgraph, where the output values take into account the estimated values of the GCI. The output values are in particular calculated by a critic-like module using Graph Convolutional Neural Networks. In a seventh step 114, a reward loss is determined on each subgraph, where the reward loss depends on the reward function value and the suitability value. In an eighth step 116, the GCI on cach subgraph are redetermined such that the reward loss is reduced on each subgraph. In a ninth step 118, the steps 110 through 116 are repeated until the reward loss mects a first termination criterion. In particular, values of the GCI in the critic-like module are determined in this way. In a tenth step 120, second edge weights of the edges of the graph are estimated. The tenth step 120 is in particular carried out by an actor-like module. Furthermore, edge weight losses at the edges of the graph are determined, wherein the edge weight losses depend on the second edge weights and the GCI determined in the ninth step 118 at the respective edges.
In an eleventh step 122, the step 120 is repeated, wherein estimating the second edge weights is performed such that the edge weight losses are minimized until the edge weight losses meet a second termination criterion. In a twelfth step 124, values of the GCI are obtained from the procedure according to step 122. Steps 106 through 124 are repeated thereafter, wherein the estimated values of the GCI in step 106 are set to be the second edge weights last determined in step 124 until the estimated values of the GCI meet a third termination criterion.
While subject matter of the present disclosure has been illustrated and described in detail in the drawings and foregoing description, such illustration and description are to be considered illustrative or exemplary and not restrictive. Any statement made herein characterizing the invention is also to be considered illustrative or exemplary and not restrictive as the invention is defined by the claims. It will be understood that changes and modifications may be made, by those of ordinary skill in the art, within the scope of the following claims, which may include any combination of features from different embodiments described above.
The terms used in the claims should be construed to have the broadest reasonable interpretation consistent with the foregoing description. For example, the use of the article “a” or “the” in introducing an element should not be interpreted as being exclusive of a plurality of elements. Likewise, the recitation of “or” should be interpreted as being inclusive, such that the recitation of “A or B” is not exclusive of “A and B,” unless it is clear from the context or the foregoing description that only one of A and B is intended. Further, the recitation of “at least one of A, B and C” should be interpreted as one or more of a group of elements consisting of A, B and C, and should not be interpreted as requiring at least one of each of the listed elements A, B and C, regardless of whether A, B and C are related as categories or otherwise. Moreover, the recitation of “A, B and/or C” or “at least one of A, B or C” should be interpreted as including any singular entity from the listed elements, e.g., A, any subset from the listed elements, e.g., A and B, or the entire list of elements A, B and C.
Number | Date | Country | Kind |
---|---|---|---|
10 2022 120 516.9 | Aug 2022 | DE | national |
10 2022 130 459.0 | Nov 2022 | DE | national |
This application is a continuation of International Application No. PCT/EP2023/070265 (WO 2024/037825), filed on Jul. 21, 2023, and claims benefit to German Patent Application No. DE 10 2022 130 459.0, filed on Nov. 17, 2022 and to German Patent Application No. DE 10 2022 120 516.9, filed on Aug. 15, 2022. The aforementioned applications are hereby incorporated by reference herein.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/EP2023/070265 | Jul 2023 | WO |
Child | 19053456 | US |