An automatic nesting method for irregular pieces based on deep reinforcement learning

By using deep reinforcement learning and the DRQN ​​model to optimize irregular pattern layout, this method solves the local optimum problem caused by the large solution space in existing technologies, and achieves efficient and stable pattern layout, which is suitable for actual production environments.

CN115270599BActive Publication Date: 2026-03-24ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies have a large solution space when dealing with irregular pattern layout problems, which makes the algorithm prone to getting trapped in local optima, resulting in unstable solution performance and making it difficult to apply in practical engineering.

Method used

A deep reinforcement learning approach is adopted, which involves preprocessing cut pieces, calculating critical polygons and inner adjoining rectangles, and combining a deep recurrent Q-learning network model for iterative optimization of layout. The DRQN ​​model and training algorithm are designed to simplify the layout decision process.

Benefits of technology

It improves the stability and efficiency of irregular pattern making, increases production efficiency and saves production costs, and is suitable for large-scale pattern making tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115270599B_ABST
    Figure CN115270599B_ABST
Patent Text Reader

Abstract

The application discloses an automatic layout method for irregular cutting pieces based on deep reinforcement learning. The method comprises the following steps: firstly, preprocessing each batch of original irregular cutting pieces to obtain corresponding preprocessed irregular cutting pieces, and arranging the preprocessed irregular cutting pieces in descending order according to areas to obtain an initial layout sequence; then, solving and obtaining a critical polygon and an inner abutting rectangle of the current batch; then, based on the initial layout sequence of the current batch of cutting pieces, the preprocessed irregular cutting pieces of the current batch are laid out to obtain an initial layout result and an initial length of a rectangular plate; finally, the initial layout result is iteratively optimized by using a deep recurrent Q learning network model, and the length of the rectangular plate is continuously reduced until the layout time exceeds a specified time, and a final layout result is output. The application is aimed at a complex decision-making task with a large-scale state and action space, such as two-dimensional irregular cutting piece layout, and realizes automatic layout of irregular cutting pieces, which is efficient and stable in an actual production environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an automatic nesting method for irregular cut pieces in the field of computer graphics, specifically an automatic nesting method for irregular cut pieces based on deep reinforcement learning. Background Technology

[0002] The problem of irregular pattern layout in two-dimensional fabric lies in determining a suitable pattern layout order. A high-quality pattern layout order can significantly improve the utilization rate of the final layout scheme. The optimization problem of irregular pattern layout order has a vast solution space, making it difficult to design a targeted optimal algorithm. Currently, methods for optimizing the irregular pattern layout order mainly fall into two categories: one is based on constructing a pattern layout process using mathematical models and combining geometric principles to solve for a suitable pattern layout order; the other is based on iterative optimization using intelligent optimization algorithms to find a suitable pattern layout order.

[0003] For small-scale or geometrically specific pattern-making problems, precise mathematical models can solve for the optimal arrangement order of irregular pattern pieces. Alvarez-Valdes et al. proposed a branch-and-bound algorithm based on mixed-integer formulas, applicable to pattern-making problems with no more than 12 pattern pieces. Cherri et al. proposed a novel mixed-integer quadratic constraint programming model that allows pattern pieces to rotate freely and combines convex decomposition with symmetry breaking constraints, demonstrating excellent performance in solving small-scale pattern-making problems. Toledo et al. proposed a mixed-integer model based on raster representation, capable of solving larger-scale pattern-making problems, but with certain restrictions on the placement of irregular pattern pieces. Li Jinrui proposed a mixed-integer programming model that restricts the placement constraints of pattern pieces, solves the corresponding model within an improved genetic algorithm framework, and adds constraints during iterative optimization, effectively improving the computational performance of the algorithm.

[0004] As the number of irregular cut pieces increases, the solution space grows explosively, and precise mathematical models can no longer demonstrate good solution performance, limiting their applicability. Therefore, for medium-to-large-scale layout problems, metaheuristic algorithms and their hybrid algorithms are often considered an effective solution. Liang Lidong et al. proposed a layout order optimization method based on an immune genetic algorithm, which effectively improved the overall search speed of the algorithm and increased the search range. Compared with the layout scheme obtained by the standard genetic algorithm, the layout utilization rate of rectangular boards was significantly improved. Zhou Zilin combined the hybrid positioning rule of centroid NFP and edge fitness to address the problem that the genetic algorithm performs poorly in local search and gets trapped in local optima too early. She combined the tabu search algorithm to more effectively search the solution space of the layout order optimization problem. Pinheiro et al. and Amaro et al. proposed using a random key genetic algorithm to iteratively optimize the layout order and rotation angle of irregular cut pieces, and combined it with the principle of parallel computing to improve the optimization effect of the algorithm. Building upon this, Mundim et al. improved the crossover and mutation mechanism using a partially randomized genetic algorithm. They also constrained the positioning rules of irregular pieces to reduce the search space and combined critical grid maps to accelerate collision detection between irregular pieces, thus obtaining a higher quality layout scheme.

[0005] When dealing with the problem of optimizing the arrangement order of irregular fabric pieces, the aforementioned scholars often employ heuristic or metaheuristic algorithms to search for the optimal solution due to the enormous solution space of such problems. Common algorithms include genetic algorithms, ant colony optimization, simulated annealing, and some hybrid intelligent optimization algorithms. These algorithms can find feasible arrangement orders for irregular fabric pieces through iterative optimization, but due to their inherent characteristics, they are prone to getting trapped in local optima during the iteration process. Furthermore, these algorithms exhibit a certain degree of randomness during iteration, and the resulting arrangement is often difficult to reproduce, resulting in unstable performance. This significantly reduces their applicability in practical engineering. Summary of the Invention

[0006] In view of the problems existing in the prior art, the present invention proposes an automatic nesting method for irregular cut pieces based on deep reinforcement learning.

[0007] This invention includes the following steps:

[0008] S1: Preprocess each original irregular cut piece in each batch to obtain the corresponding preprocessed irregular cut pieces, and then sort the preprocessed irregular cut pieces in the current batch in descending order according to their area to obtain the initial layout order of the preprocessed irregular cut pieces in the current batch.

[0009] S2: Solve and obtain the critical polygon between every two pre-processed irregular pieces in the current batch, as well as the inner adjoining rectangle of each pre-processed irregular piece for the rectangular plate.

[0010] S3: Based on the initial layout order of the irregular cut pieces after preprocessing in the current batch, according to the critical polygon between every two preprocessed irregular cut pieces in the current batch and the inner adjoining rectangle of each preprocessed irregular cut piece relative to the rectangular plate, the irregular cut pieces in the current batch are laid out on the rectangular plate to obtain the initial layout result and the initial length of the rectangular plate.

[0011] S4: Based on the critical polygon between every two pre-processed irregular pieces in the current batch and the inner rectangle of each pre-processed irregular piece relative to the rectangular board, the initial layout result is iteratively optimized using a deep recurrent Q-learning network model. The length of the rectangular board is continuously reduced until the layout time exceeds the specified time, and the final layout result is output.

[0012] In S1, each original irregular cut piece in each batch is first reduced by point set to obtain the corresponding irregular cut piece after point set reduction.

[0013] Next, the irregular cut pieces after the reduction of each point are expanded outward to obtain the corresponding irregular cut pieces after the expansion outward. The irregular cut pieces after the expansion outward are used as the pre-processed irregular cut pieces.

[0014] Specifically, S3 is:

[0015] S31: Select the pieces to be placed from the irregular pieces after preprocessing in the current batch according to the initial layout order. Calculate the placement position evaluation parameter s of the current piece to be placed based on the critical polygon between each pair of the piece to be placed and the already placed pieces, as well as the inner adjoining rectangle of the current piece to be placed relative to the rectangular plate. Select the optimal placement position of the current piece to be placed on the rectangular plate based on the placement position evaluation parameter s, until the number of placed pieces is greater than the preset threshold of placed pieces.

[0016] S32: Following the initial layout order, continue to select irregular pieces to be placed from the pre-processed irregular pieces of the current batch. Select A2 pieces to be placed and record them as a local search candidate set. Calculate the placement position evaluation parameter s of each piece to be placed in the local search candidate set. Then place the piece to be placed corresponding to the best placement position evaluation parameter s in the current local search candidate set. Continue to select the next piece to be placed according to the initial layout order and put it into the local search candidate set. Calculate the placement position evaluation parameter s of each piece to be placed in the current local search candidate set. Then place the piece to be placed corresponding to the best placement position evaluation parameter s in the current local search candidate set. Continue until there are no more pieces to be placed.

[0017] S33: Arrange the pieces to be placed in the current local search candidate set in descending order of the evaluation parameter s of the placement position of each piece, until the layout is completed, and generate the initial layout result and the initial length of the rectangular board.

[0018] The calculation formula for the placement position evaluation parameter s of the cut piece to be placed is as follows:

[0019] s = f + w + p

[0020]

[0021]

[0022]

[0023] Where f represents the fit and adaptability of the cut piece to be placed at its corresponding position, w represents the waiting number parameter for the cut piece to be placed, p represents the performance improvement parameter for the cut piece to be placed; l represents the ideal usable length of the rectangular board, u represents the usable length of the rectangular board, k represents the fit and adaptability selection parameter, f1 represents the fit parameter, S1 represents the intersection area between the pre-processed irregular cut pieces corresponding to the cut piece to be placed and the cut piece already placed, S2 represents the area of ​​the pre-processed irregular cut piece corresponding to the cut piece to be placed that exceeds the area of ​​the rectangular board, S3 represents the area difference between the cut piece to be placed and the corresponding pre-processed irregular cut piece; f2 represents the position parameter; x represents the maximum horizontal coordinate value of the pre-processed irregular cut piece corresponding to the cut piece to be placed after it is placed in the rectangular board.

[0024] In step S31, the performance improvement parameter p of the cut piece to be placed is 0;

[0025] In S32, the performance improvement parameter p of the cut pieces to be placed is set using the following method:

[0026] In each round of placement, the fit and adaptability of the placement position of each piece to be placed in the local search candidate set is recorded; if in the next round of placement, the fit and adaptability f' of the current piece to be placed in the local search candidate set is... new Higher than historical fit and adaptability f' old Then the performance improvement parameter p of the current piece to be placed satisfies p = (f' new -f' old ) / f' old It updates the fit and adaptability of the current cut piece to be placed at its corresponding placement position. If the fit and adaptability does not improve, the performance improvement parameter p of the current cut piece to be placed is 0.

[0027] Specifically, S4 is:

[0028] S41: Take the initial layout as the initial iterative layout result, and record the layout order under the initial iterative layout result as the initial set of cut pieces to be laid out.

[0029] S42: Randomly select a piece to be arranged from the current set of pieces to be arranged with probability ε, or select a piece to be arranged that maximizes the Q value from the current set of pieces to be arranged with probability 1-ε. Then calculate the revenue value of the selected piece to be arranged. A piece transfer sequence is formed by the current set of pieces to be arranged, the selected piece to be arranged, and the corresponding revenue value and numbered. Then remove the selected piece to be arranged from the current set of pieces to be arranged and update the set of pieces to be arranged.

[0030] S43: Repeat S42 until the current set of cut pieces to be arranged is empty. Obtain the cut piece transfer sequence corresponding to each cut piece to be arranged in the initial set of cut pieces to be arranged. Sort the cut piece transfer sequences corresponding to each cut piece to be arranged according to the number. Obtain the current iteration layout result and update the iteration layout result and the set of cut pieces to be arranged.

[0031] S44: Repeat S42-S43 multiple times to obtain multiple rounds of iterative sorting results;

[0032] S45: Randomly select K rounds of iterative sorting results and input them into a deep recurrent Q-learning network model for training. In each round of iterative sorting results, the set of cut pieces to be sorted in each cut piece transfer sequence is used as the input of the network model. The Q value of the selected cut pieces to be sorted under the current set of cut pieces to be sorted is calculated based on the benefit value of each cut piece transfer sequence and used as the optimization objective Q' of the network model to obtain the trained network model.

[0033] S46: Input the initial set of cut pieces to be arranged into the trained network model. The trained network model outputs the Q value of each cut piece to be arranged from the initial set of cut pieces to be arranged. The cut piece with the largest Q value is taken as the optimal cut piece to be placed. The placement position of the current optimal cut piece to be placed is determined according to the fit fitness f of the placement position of the optimal cut piece to be placed and placed on the initial length of the rectangular board. Then, the placed cut pieces to be arranged are removed from the initial set of cut pieces to be arranged and the set of cut pieces to be arranged is updated.

[0034] S47: Use the updated set of cut pieces to be arranged as the initial set of cut pieces to be arranged, and repeat S46 until the updated set of cut pieces to be arranged is an empty set;

[0035] S48: If the rectangular plate can be successfully placed within its initial length, the layout is successful, and the optimized layout result and the length of the rectangular plate under the current optimized layout result are obtained; otherwise, the layout fails, and S46-S47 are repeated for re-layout.

[0036] S49: If the total layout time after the initial set of cut pieces to be laid out is input into the trained network model is less than the preset layout time, the initial set of cut pieces to be laid out and the initial length of the rectangular board will be updated according to the current optimized layout result, and S46-S48 will be repeated for layout optimization. Otherwise, the optimized layout result with the shortest length of the rectangular board will be used as the final layout result and output.

[0037] The formulas for calculating the Q value and corresponding revenue value of the cut pieces to be arranged are as follows:

[0038] Q π (s,a)=E π [R(T)|s0=s,a0=a]

[0039]

[0040]

[0041]

[0042] Among them, Q π (s,a) represents the Q value corresponding to the current set of cut pieces s to be arranged and the selected cut piece a to be arranged under the current iteration layout result π; E π [R(T)|s0=s,a0=a] represents the mathematical expectation operation of the total revenue value R(T) under the initial layout result π when s0=s, a0=a, where s0 represents the initial set of cut pieces to be arranged, a0 represents the initial set of cut pieces to be arranged, γ represents the discount factor, and T represents the total number of cut pieces to be arranged in the current set s; R(T) represents the total revenue value, r t S represents the revenue value of the t-th piece in the current set of pieces to be arranged, and S represents the sum of the areas of all pieces to be arranged in the initial set of pieces to be arranged. now S represents the total area of ​​the successfully placed cut pieces. last q represents the total area of ​​the remaining pieces after placement failure; q is a Boolean variable, which is true when the t-th piece in the current set of pieces to be placed is successfully placed, and false when placement fails; L represents the initial length of the rectangular board; l represents the ideal usable length of the rectangular board; and ε represents the ratio of the initial length to the ideal usable length of the rectangular board.

[0043] The beneficial effects of this invention are as follows:

[0044] First, each batch of original irregular cut pieces is preprocessed to obtain the corresponding preprocessed irregular cut pieces, which are then arranged in descending order of area to obtain the initial layout order. Next, the critical polygon and the inner adjoining rectangle of the current batch are solved and obtained. Then, based on the initial layout order of the current batch of cut pieces, the preprocessed irregular cut pieces of the current batch are laid out to obtain the initial layout result and the initial length of the rectangular panels. Then, the behavioral characteristics of the irregular cut piece layout decision process are analyzed, and the layout process is simplified into a layout sequence decision process based on reinforcement learning, and the model is completed. For complex decision-making tasks with large-scale state and action spaces, such as the two-dimensional irregular cut piece layout problem, a DRQN ​​model and corresponding training algorithm for the irregular cut piece layout decision process are designed. The automatic layout method designed in this paper has high efficiency and stability.

[0045] This invention provides an effective solution for the sorting task in actual production, which greatly improves production efficiency and saves production costs. Attached Figure Description

[0046] Figure 1 This is a diagram of the algorithm structure of the present invention.

[0047] Figure 2 Flowchart for solving the initial layout scheme for irregular cut pieces.

[0048] Figure 3 A flowchart for iteratively optimizing the layout of irregular cut pieces.

[0049] Figure 4 This is a flowchart of the training process for the DRQN ​​model.

[0050] Figure 5 This is a network structure diagram of the DRQN ​​model for the decision-making process of irregular pattern cutting.

[0051] Figure 6 This is a diagram of the final layout scheme for Albano.

[0052] Figure 7 This is the final layout diagram for Blaz.

[0053] Figure 8 This is the final layout diagram of Dagli.

[0054] Figure 9 This is the final layout diagram for Mao.

[0055] Figure 10 This is the final layout diagram for Shapes0.

[0056] Figure 11 This is the final layout diagram for Shapes1.

[0057] Figure 12 This is the final layout diagram for the Shirts.

[0058] Figure 13 This is the final layout diagram for Marques.

[0059] Figure 14 This is the final layout diagram of Swim.

[0060] Figure 15 This is the final layout diagram for Trousers. Detailed Implementation

[0061] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified and changed based on different viewpoints and applications without departing from the spirit of the present invention.

[0062] like Figure 1 As shown, it includes the following steps:

[0063] S1: Preprocess each original irregular cut piece in each batch to obtain the corresponding preprocessed irregular cut pieces, so as to meet the production needs and reduce the overall computational complexity of the automatic nesting method. Then, sort the preprocessed irregular cut pieces of the current batch in descending order according to the area to obtain the initial nesting order of the preprocessed irregular cut pieces of the current batch.

[0064] In S1, point set reduction is first performed on each original irregular piece in each batch. Specifically, all vertices of each original irregular piece are traversed sequentially, and it is determined whether the lengths of both sides of each vertex are less than a preset side length threshold. If they are both less than the preset side length threshold, it is further determined whether the outline of the piece after deleting the vertex completely covers the outline of the piece before deleting the vertex. That is, the area of ​​the piece after deleting the vertex is greater than the area of ​​the piece before deleting the vertex. If so, the vertex is successfully deleted; otherwise, the vertex is restored. The corresponding irregular piece after point set reduction is obtained.

[0065] Next, the irregular pieces after point reduction are expanded outwards. Parallel lines with a preset distance are drawn on each side of the irregular pieces after point reduction. The intersection of the two parallel lines corresponding to each pair of adjacent sides is taken as a new vertex of the expanded outline. The new outline formed by each new vertex is taken as the irregular piece after outline expansion corresponding to the irregular piece after point reduction. The corresponding irregular piece after outline expansion is obtained and used as the preprocessed irregular piece.

[0066] S2: Solve and obtain the critical polygon NFP between every two pre-processed irregular pieces in the current batch and the inner abutment rectangle IFR of each pre-processed irregular piece for the rectangular plate, so as to speed up the positioning process.

[0067] S2 specifically refers to:

[0068] S21: Solve for the critical polygon NFP between every two preprocessed irregular pieces. Specifically: Given two irregular pieces, where the first preprocessed irregular piece A is a fixed piece and the second preprocessed irregular piece B is a moving piece, first, align the vertex with the smallest vertical coordinate value in the first preprocessed irregular piece A with the vertex with the largest vertical coordinate value in the second preprocessed irregular piece B, and select a suitable reference point. The reference point can be any point, but it must follow the movement of the second preprocessed irregular piece B and always maintain its relative position to the second piece B; then, based on the current two preprocessed irregular pieces... Given the relative positions of the pre-processed irregular pieces, ensuring that the first pre-processed irregular piece A and the second pre-processed irregular piece B are always in contact but not intersecting during the movement, determine the movement direction of the second pre-processed irregular piece B. Then, calculate the collision distance of the second pre-processed irregular piece B in the corresponding movement direction, assuming that the two pre-processed irregular pieces are always in contact but not intersecting, thus obtaining the new position of the second pre-processed irregular piece. Repeat the above process until the moving polygon B returns to the starting position. During this process, the trajectory of the reference point is the desired NFP.

[0069] S22: Solve for the inner contact rectangle of each pre-processed irregular piece with respect to the rectangular board. Specifically: First, traverse all vertices of each pre-processed irregular piece, and record the maximum and minimum values ​​of the x-axis and y-axis coordinates of all vertices of the current pre-processed irregular piece. The maximum difference in the x-axis coordinates is the width of the current pre-processed irregular piece, and the maximum difference in the y-axis coordinates is the height of the current pre-processed irregular piece. The width of the rectangular board minus the width of the current pre-processed irregular piece is the IFR width, and the height of the rectangular board minus the height of the current pre-processed piece is the IFR height. Thus, the IFR outline of the current pre-processed irregular piece can be determined. Then, the corresponding IFR can be solved based on the position of the reference point.

[0070] S3: The width of the rectangular sheet is fixed. Assuming the length of the rectangular sheet is large enough, based on the initial layout order of the irregular pieces after preprocessing in the current batch, the layout is performed on the rectangular sheet according to the critical polygon between every two preprocessed irregular pieces in the current batch and the inner rectangle of each preprocessed irregular piece relative to the rectangular sheet, to obtain the initial layout result and the initial length of the rectangular sheet. In practice, the length of the rectangular sheet is set to 5 times the ideal usable length of the original irregular pieces in the current batch. The ideal usable length of the original irregular pieces in the current batch is calculated by dividing the sum of the areas of each original irregular piece by the fixed width of the rectangular sheet. At this time, the worst-case layout utilization rate is 20%, and most of the piece samples can be successfully laid out.

[0071] like Figure 2 As shown, S3 specifically refers to:

[0072] S31: Select the pieces to be placed from the irregular pieces after preprocessing in the current batch according to the initial layout order. Calculate the placement position evaluation parameter s of the current piece to be placed based on the critical polygon between each pair of the piece to be placed and the already placed pieces, and the inner adjoining rectangle of the current piece to be placed relative to the rectangular board. Select the optimal placement position of the current piece to be placed on the rectangular board based on the placement position evaluation parameter s, until the number of placed pieces is greater than the preset placed piece threshold A1. Then execute S32. The preset placed piece threshold A1 represents the number of placed pieces set when the local search starts, and is recorded as the local search start threshold.

[0073] The formula for calculating the placement parameter s of the cut pieces to be placed is as follows:

[0074] s = f + w + p

[0075]

[0076]

[0077]

[0078] Where f represents the fit and adaptability of the placement position of the piece to be placed; w represents the waiting number parameter of the piece to be placed, which is the ratio of the number of times the piece to be placed has participated in the comparison to the number of pieces already placed, i.e., the ratio of the number of times the piece is selected into the candidate set to wait for placement to the number of pieces already placed, with a value ranging from 0 to 1; p represents the performance improvement parameter of the piece to be placed; l represents the ideal usable length of the rectangular board; u represents the usable length of the rectangular board; k represents the fit and adaptability selection parameter, which is a constant. f1 represents the fit parameter; S1 represents the intersection area between the pre-processed irregular pieces corresponding to the current piece to be placed and the pieces already placed; S2 represents the area of ​​the pre-processed irregular piece corresponding to the piece to be placed that exceeds the rectangular board; S3 represents the area difference between the piece to be placed and the corresponding pre-processed irregular piece, which is a positive number; f2 represents the position parameter; x represents the maximum horizontal coordinate value of the pre-processed irregular piece corresponding to the piece to be placed after it is placed in the rectangular board.

[0079] In S31, the performance improvement parameter p of the cut piece to be placed is 0;

[0080] In S32, the performance improvement parameter p of the cut pieces to be placed is set using the following method:

[0081] The performance improvement parameter 'p' for the piece to be placed represents the highest fit fitness value (denoted as f') obtained by the piece that failed to compete in each round of placement. In each round of placement, the fit fitness of each piece to be placed in the local search candidate set corresponding to its placement position is recorded; if in the next round of placement, the fit fitness of the current piece to be placed in the local search candidate set corresponding to its placement position is lower than the previous round... new Higher than historical fit and adaptability f' old Then the performance improvement parameter p of the current piece to be placed satisfies p = (f' new -f' old ) / f' old It updates the fit and adaptability of the current cut piece to be placed at its corresponding placement position. If the fit and adaptability does not improve, the performance improvement parameter p of the current cut piece to be placed is 0.

[0082] S32: Following the initial layout order, continue selecting irregular cut pieces to be placed from the current batch of pre-processed pieces. Select A2 pieces to be placed and record them as a local search candidate set. The threshold A2 represents the number of pieces to be placed in the local search candidate set, and is recorded as the capacity of the local search candidate set. Calculate the placement position evaluation parameter s for each piece to be placed in the local search candidate set. Then place the piece to be placed corresponding to the optimal placement position evaluation parameter s in the current local search candidate set, and delete the pieces to be placed after placement in the current local search candidate set. Continue selecting the next piece to be placed according to the initial layout order and put it into the local search candidate set. Calculate the placement position evaluation parameter s for each piece to be placed in the current local search candidate set, and then place the piece to be placed corresponding to the optimal placement position evaluation parameter s in the current local search candidate set, until there are no more pieces to be placed.

[0083] S33: Arrange each piece of fabric to be placed in the current local search candidate set in descending order of the evaluation parameter s of the placement position of each piece of fabric to be placed, until the pattern arrangement is completed, and generate the initial pattern layout and the initial length of the rectangular board.

[0084] S4: Based on the critical polygon between every two pre-processed irregular pieces in the current batch and the inner rectangle of each pre-processed irregular piece relative to the rectangular board, the initial layout result is iteratively optimized using a deep recurrent Q-learning network model. The length of the rectangular board is continuously reduced until the layout time exceeds the specified time, and the final layout result is output.

[0085] like Figure 3 , Figure 4 and Figure 5 As shown, S4 specifically refers to:

[0086] S41: Take the initial layout as the initial iterative layout result, and record the layout order under the initial iterative layout result as the initial set of cut pieces to be laid out.

[0087] S42: Randomly select a piece to be arranged from the current set of pieces to be arranged with probability ε, or select a piece to be arranged that maximizes the Q value from the current set of pieces to be arranged with probability 1-ε and place it. Determine the placement position based on the fit fitness f of the selected piece to be arranged and place it on the initial length of the rectangular board. Then calculate the benefit value of the selected piece to be arranged. A piece transfer sequence is formed by the current set of pieces to be arranged, the selected piece to be arranged, and the corresponding benefit value and numbered. Then remove the selected piece to be arranged from the current set of pieces to be arranged and update the set of pieces to be arranged.

[0088] The formulas for calculating the Q value and corresponding revenue of the cut pieces to be arranged are as follows:

[0089] Qπ (s,a)=E π [R(T)|s0=s,a0=a]

[0090]

[0091]

[0092]

[0093] Among them, Q π (s,a) represents the Q value corresponding to the current set of cut pieces s to be arranged and the selected cut piece a to be arranged under the current iteration layout result π; E π [R(T)|s0=s,a0=a] represents the mathematical expectation operation of the total revenue value R(T) under the initial layout result π when s0=s, a0=a, where s0 represents the initial set of cut pieces to be arranged, a0 represents the initial set of cut pieces to be arranged, γ represents the discount factor, and T represents the total number of cut pieces to be arranged in the current set s; R(T) represents the total revenue value, r t S represents the revenue value of the t-th piece in the current set of pieces to be arranged, and S represents the sum of the areas of all pieces to be arranged in the initial set of pieces to be arranged, St. now S represents the total area of ​​the successfully placed cut pieces. last q represents the total area of ​​the remaining pieces after placement failure; q is a Boolean variable, which is true when the t-th piece in the current set of pieces to be placed is successfully placed, and false when placement fails; L represents the initial length of the rectangular board; l represents the ideal usable length of the rectangular board; and ε represents the ratio of the initial length to the ideal usable length of the rectangular board.

[0094] S43: Repeat S42 until the current set of cut pieces to be arranged is empty, that is, all the cut pieces in the initial set of cut pieces to be arranged have been selected. Obtain the cut piece transfer sequence corresponding to each cut piece to be arranged in the initial set of cut pieces to be arranged. After sorting the cut piece transfer sequences corresponding to each cut piece to be arranged according to the number, obtain the current round of iteration layout result and update the iteration layout result and the set of cut pieces to be arranged.

[0095] S44: Repeat S42-S43 multiple times to obtain multiple rounds of iterative sorting results;

[0096] S45: Randomly select K rounds of iterative sorting results and input them into a deep recurrent Q-learning network model for training. In each round of iterative sorting results, the set of cut pieces to be sorted in each cut piece transfer sequence is used as the input of the network model. The Q value of the selected cut pieces to be sorted under the current set of cut pieces to be sorted is calculated based on the benefit value of each cut piece transfer sequence and used as the optimization objective Q' of the network model to obtain the trained network model.

[0097] The formula for calculating the Q value of the selected cut piece from the current set of cut pieces is as follows:

[0098] Q π' (s)'=E π' (R(T)|s0=s,a0=a)

[0099] Where Q' represents the Q value of the selected cut piece in the current set of cut pieces to be arranged, s represents the current set of cut pieces to be arranged, and π' represents the layout result of the current iteration;

[0100] In practice, the network weights θ are updated using gradient descent based on the loss function, and θ is updated every C steps. * , such that θ * =θ, where θ is the initial DRQN ​​network weight, θ * The network weights are the initial target values, and the specific formula for calculating the loss function is as follows:

[0101] loss=(Q'-Q(s j ,a j ;θ)) 2

[0102] Where Q(s) j ,a j ;θ) represents the situation where, in the j-th placement of the cut pieces, the set to be placed is s. j Select to place the cut piece a j The network output Q value is given by the network structure parameter θ.

[0103] S46: Input the initial set of cut pieces to be arranged into the trained network model. The trained network model outputs the Q value of each cut piece to be arranged from the initial set of cut pieces to be arranged. The cut piece with the largest Q value is taken as the optimal cut piece to be placed. The placement position of the current optimal cut piece to be placed is determined according to the fit fitness f of the placement position of the optimal cut piece to be placed and placed on the initial length of the rectangular board. Then, the placed cut pieces to be arranged are removed from the initial set of cut pieces to be arranged and the set of cut pieces to be arranged is updated.

[0104] S47: Use the updated set of cut pieces to be arranged as the initial set of cut pieces to be arranged, and repeat S46 until the updated set of cut pieces to be arranged is an empty set;

[0105] S48: If the rectangular plate can be successfully placed at its initial length, the layout is successful. The optimized layout result and the length of the rectangular plate under the current optimized layout result are obtained. The length of the rectangular plate under the current optimized layout result is less than the initial length of the rectangular plate. Otherwise, the layout fails. The initial length of the rectangular plate remains unchanged, and S46-S47 are repeated for re-layout.

[0106] S49: If the total layout time after the initial set of cut pieces to be laid out is input into the trained network model is less than the preset layout time, the initial set of cut pieces to be laid out and the initial length of the rectangular board will be updated according to the current optimized layout result, and S46-S48 will be repeated for layout optimization. Otherwise, the optimized layout result with the shortest length of the rectangular board will be used as the final layout result and output.

[0107] The embodiments of the present invention solve 10 internationally recognized nesting benchmark cases provided by ESIUP, and compare the nesting results obtained by the algorithm under each benchmark case with the nesting results of three existing effective automatic nesting algorithms: Paired Precise Placement Algorithm (PEPA), Hybrid Intelligent Algorithm of Genetic Algorithm and Tabu Search Algorithm (GATS), and Partially Randomized Key Genetic Algorithm (BRKGA).

[0108] The specific hyperparameter values ​​of the DRQN ​​model are shown in Table 1.

[0109] Table 1: Hyperparameters of the DRQN ​​model

[0110]

[0111] The nesting baseline test case experiment used the irregular fabric pattern automatic nesting algorithm proposed in this chapter to perform 10 independent calculations on each baseline test case. The nesting results of the algorithm in each independent calculation were recorded. η′ represents the optimal utilization rate in the nesting results. This represents the average utilization rate of the layout results. The scale of the layout benchmark cases is not the same, therefore different layout time limits are set for different layout benchmark cases. The average running time of the algorithm is denoted as t, in seconds (s). Table 2 shows a comparison of the optimal utilization rate and layout time of the four algorithms, where the optimal utilization rate of the four algorithms under each benchmark case is indicated in bold and underlined. Table 3 shows a comparison of the average utilization rate of the layout results, again indicating the optimal average utilization rate after comparison in bold and underlined. The final layout scheme for irregular cut pieces obtained by this invention is as follows: Figures 7 to 15 As shown.

[0112] Table 2: Comparison of Optimal Utilization Rate and Nesting Time for Four Sort Results

[0113]

[0114] Table 3: Comparison of Average Utilization Rate of Slotting Results

[0115]

[0116] As demonstrated by the above embodiments, the automatic nesting algorithm proposed in this invention can obtain high-quality irregular pattern layout schemes, which is valuable for practical production applications. It also proves the efficiency and stability of the DRQN ​​model. Especially for mass-produced customized goods, where it is necessary to obtain nesting layout schemes with the highest possible utilization rate to reduce production costs, longer nesting times are often tolerable. In this case, the automatic nesting algorithm under the DRQN ​​model will be more competitive. This illustrates the applicability of this invention in actual production environments and is of great significance for improving production efficiency and reducing production costs in sewing workshops.

[0117] The above specific embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. An automatic nesting method for irregular cut pieces based on deep reinforcement learning, characterized in that, Includes the following steps: S1: Preprocess each original irregular cut piece in each batch to obtain the corresponding preprocessed irregular cut pieces, and then sort the preprocessed irregular cut pieces in the current batch in descending order according to their area to obtain the initial layout order of the preprocessed irregular cut pieces in the current batch. S2: Solve and obtain the critical polygon between every two pre-processed irregular pieces in the current batch, as well as the inner adjoining rectangle of each pre-processed irregular piece for the rectangular plate. S3: Based on the initial layout order of the irregular cut pieces after preprocessing in the current batch, according to the critical polygon between every two preprocessed irregular cut pieces in the current batch and the inner adjoining rectangle of each preprocessed irregular cut piece relative to the rectangular plate, the irregular cut pieces in the current batch are laid out on the rectangular plate to obtain the initial layout result and the initial length of the rectangular plate. S4: Based on the critical polygon between every two pre-processed irregular pieces in the current batch and the inner contact rectangle of each pre-processed irregular piece with the rectangular board, use a deep recurrent Q-learning network model to iteratively optimize the initial layout result, continuously reduce the length of the rectangular board until the layout time exceeds the specified time, and output the final layout result. Specifically, S4 is: S41: Take the initial layout as the initial iterative layout result, and record the layout order under the initial iterative layout result as the initial set of cut pieces to be laid out. S42: with probability Randomly select a piece to be arranged from the current set of pieces to be arranged, or select a piece with a probability of 1- Select from the current set of cut pieces that maximize The value of the cut pieces to be arranged is calculated, and the revenue value of the selected cut pieces to be arranged is calculated. A cut piece transfer sequence is formed by the current set of cut pieces to be arranged, the selected cut pieces to be arranged, and the corresponding revenue value, and numbered. Then, the selected cut pieces to be arranged are removed from the current set of cut pieces to be arranged and the set of cut pieces to be arranged is updated. S43: Repeat S42 until the current set of cut pieces to be arranged is empty. Obtain the cut piece transfer sequence corresponding to each cut piece to be arranged in the initial set of cut pieces to be arranged. Sort the cut piece transfer sequences corresponding to each cut piece to be arranged according to the number. Obtain the current iteration layout result and update the iteration layout result and the set of cut pieces to be arranged. S44: Repeat S42-S43 multiple times to obtain multiple rounds of iterative sorting results; S45: Random selection After each iteration of the nesting results, the results are input into a deep recurrent Q-learning network model for training. In each iteration of the nesting results, the set of cut pieces to be arranged in each cut piece transfer sequence is used as the input of the network model. The Q value of the selected cut pieces to be arranged in the current set of cut pieces to be arranged is calculated based on the benefit value of each cut piece transfer sequence and used as the optimization objective Q' of the network model to obtain the trained network model. S46: Input the initial set of cut pieces to be arranged into the trained network model. The trained network model outputs the selected cut pieces from the initial set of cut pieces to be arranged. Value, will The cut piece with the highest value is selected as the optimal cut piece to be placed, and the placement is based on the fit and adaptability of the optimal cut piece. Determine the optimal placement position of the cut pieces to be placed and place them along the initial length of the rectangular board. Then remove the placed cut pieces from the initial set of cut pieces to be placed and update the set of cut pieces to be placed. S47: Use the updated set of cut pieces to be arranged as the initial set of cut pieces to be arranged, and repeat S46 until the updated set of cut pieces to be arranged is an empty set; S48: If the rectangular plate can be successfully placed within its initial length, the layout is successful, and the optimized layout result and the length of the rectangular plate under the current optimized layout result are obtained; otherwise, the layout fails, and S46-S47 are repeated for re-layout. S49: If the total layout time after the initial set of cut pieces to be laid out is input into the trained network model is less than the preset layout time, the initial set of cut pieces to be laid out and the initial length of the rectangular board will be updated according to the current optimized layout result, and S46-S48 will be repeated for layout optimization. Otherwise, the optimized layout result with the shortest length of the rectangular board will be used as the final layout result and output.

2. The automatic nesting method for irregular cut pieces based on deep reinforcement learning according to claim 1, characterized in that, In S1, each original irregular cut piece in each batch is first reduced by point set to obtain the corresponding irregular cut piece after point set reduction. Next, the irregular cut pieces after the reduction of each point are expanded outward to obtain the corresponding irregular cut pieces after the expansion outward. The irregular cut pieces after the expansion outward are used as the pre-processed irregular cut pieces.

3. The automatic nesting method for irregular cut pieces based on deep reinforcement learning according to claim 1, characterized in that, Specifically, S3 is: S31: Select the pieces to be placed from the irregular pieces after preprocessing in the current batch according to the initial layout order. Calculate the placement position evaluation parameter s of the current piece to be placed based on the critical polygon between each pair of the piece to be placed and the already placed pieces, as well as the inner adjoining rectangle of the current piece to be placed relative to the rectangular plate. Select the optimal placement position of the current piece to be placed on the rectangular plate based on the placement position evaluation parameter s, until the number of placed pieces is greater than the preset threshold of placed pieces. S32: Following the initial layout order, continue to select irregular pieces to be placed from the pre-processed irregular pieces of the current batch. Select A2 pieces to be placed and record them as a local search candidate set. Calculate the placement position evaluation parameter s of each piece to be placed in the local search candidate set. Then place the piece to be placed corresponding to the best placement position evaluation parameter s in the current local search candidate set. Continue to select the next piece to be placed according to the initial layout order and put it into the local search candidate set. Calculate the placement position evaluation parameter s of each piece to be placed in the current local search candidate set. Then place the piece to be placed corresponding to the best placement position evaluation parameter s in the current local search candidate set. Continue until there are no more pieces to be placed. S33: Arrange each piece of fabric to be placed in the current local search candidate set in descending order of the evaluation parameter s of the placement position of each piece of fabric to be placed, until the layout is completed, and generate the initial layout result and the initial length of the rectangular board.

4. The automatic nesting method for irregular cut pieces based on deep reinforcement learning according to claim 3, characterized in that, The calculation formula for the placement position evaluation parameter s of the cut piece to be placed is as follows: Where f represents the fit and adaptability of the cut piece to be placed to the corresponding placement position, w represents the waiting number parameter of the cut piece to be placed, and p represents the performance improvement parameter of the cut piece to be placed. This represents the ideal usable length of the rectangular sheet material, u represents the length of the rectangular sheet material already used, and k represents the fit selection parameter. Indicates the fitting parameters. This represents the intersection area between the pre-processed irregular cut pieces corresponding to the cut pieces to be placed and those already placed. This indicates that the pre-processed irregular cut piece corresponding to the cut piece to be placed exceeds the area of ​​the rectangular board. This represents the area difference between the cut piece to be placed and the corresponding pre-processed irregular cut piece; The position parameter is represented by x; x represents the maximum horizontal coordinate value of the irregularly shaped cut piece after preprocessing, which corresponds to the cut piece to be placed in the rectangular board.

5. The automatic nesting method for irregular cut pieces based on deep reinforcement learning according to claim 4, characterized in that, In step S31, the performance improvement parameter p of the cut piece to be placed is 0; In S32, the performance improvement parameters for the cut pieces to be placed Configure it using the following method: In each round of placement, the fit and adaptability of the placement position of each piece to be placed in the local search candidate set is recorded; if in the next round of placement, the fit and adaptability of the placement position of the current piece to be placed in the local search candidate set is... Higher than historical fit and adaptability Then the performance improvement parameter p of the current cut piece to be placed satisfies It updates the fit and adaptability of the current cut piece to be placed at its corresponding placement position. If the fit and adaptability does not improve, the performance improvement parameter p of the current cut piece to be placed is 0.

6. The automatic nesting method for irregular cut pieces based on deep reinforcement learning according to claim 1, characterized in that, The cut pieces to be arranged The formulas for calculating the value and the corresponding return are as follows: in, This represents the current set of cut pieces to be arranged, s, and the selected cut pieces to be arranged, under the current iteration's nesting result π. corresponding value; Indicates seeking , Under the condition of the initial sampling result π, the total revenue value Mathematical expectation operation, This represents the initial set of cut pieces to be arranged. represents the initial set of cut pieces to be arranged, 𝛾 represents the conversion factor, and T represents the total number of cut pieces to be arranged in the current set of cut pieces to be arranged, s. Represents the total revenue value. Let represent the revenue value of the t-th piece in the current set of pieces to be arranged, and let represent the sum of the areas of all pieces to be arranged in the initial set of pieces to be arranged, denoted as . 𝑛𝑜𝑤 This represents the total area of ​​the successfully placed cut pieces, 𝑆 l𝑎𝑠𝑡 represents the total area of ​​the remaining pieces after placement failure; q is a Boolean variable, which is true when the t-th piece in the current set of pieces to be placed is successfully placed, and false when placement fails; 𝐿 represents the initial length of the rectangular board; l represents the ideal usable length of the rectangular board; and 𝜀 represents the ratio of the initial length to the ideal usable length of the rectangular board.

Citation Information

Patent Citations

  • Urban road traffic state prediction system based on deep learning

    CN111402576A

  • Two-dimensional irregular part layout method based on genetic algorithm

    CN113435094A