Path planning method and product
Generating high-quality path images through a generative dual adversarial network, the problem of particle swarm optimization algorithm falling into local optimal solutions in high-dimensional search space is solved, and the efficiency and accuracy of path planning are improved.
Patent Information
- Application Number
- CN202411992724.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Particle swarm optimization algorithms are prone to fall into local optimal solutions in path planning, especially in high-dimensional and complex search spaces, which leads to a decrease in search efficiency and makes it difficult to find high-quality planning paths.
By obtaining noise information, obstacle information and target point information of the target map, input it to the trained generator to generate a first image corresponding to the target map, and the image includes areas of multiple feasible paths. Then, the optimal planning path is determined in the region using a particle swarm optimization algorithm.
Generating high-quality path images through a generative dual adversarial network reduces unnecessary exploration of particle swarms in the target map, and improves the efficiency and accuracy of finding the optimal planning path.
Smart Images

Figure CN119845278A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of path planning, and in particular to a path planning method and product. Background Art
[0002] Path planning is an important guarantee for mobile equipment to complete its tasks, which directly affects the time and efficiency of mobile equipment to perform tasks. Particle swarm optimization algorithm has the advantages of fast convergence speed, strong adaptability, easy implementation and application, etc. At present, most of them use particle swarm optimization algorithm for path planning.
[0003] However, the particle swarm optimization algorithm is prone to fall into the local optimal solution in path planning, especially in high-dimensional and complex search spaces. Since the position and velocity updates of particles are affected by the current optimal solution and individual experience, the algorithm may not be able to search for the optimal solution globally, but only converge to the local optimal solution. As the dimension of the problem increases, the scale of the search space grows exponentially, resulting in a decrease in the search efficiency of the algorithm, making it more difficult to find a high-quality planning path.
[0004] How to improve the efficiency and accuracy of using particle swarm optimization algorithm to find the optimal planning path has become an urgent problem to be solved. Summary of the invention
[0005] The main purpose of the embodiments of the present application is to propose a path planning method and product, aiming to improve the efficiency and accuracy of finding the optimal planning path using a particle swarm optimization algorithm.
[0006] The present application provides a path planning method, including: obtaining first information; the first information includes noise information and second information of a target map of a path to be planned; the second information includes obstacle information and target point information; the target point information includes information of a starting point and an end point of the path planning of the target map; the first information is input into a trained generator to obtain a first image corresponding to the target map; the first image includes a first area having a plurality of first feasible paths; the first feasible path is a path from the starting point to the end point; and the optimal planning path of the target map is determined in the first area by using a particle swarm optimization algorithm.
[0007] In one embodiment, before the first information is input into the trained generator to obtain the first image corresponding to the target map, the path planning method further includes: obtaining a training data set and a preset generative dual adversarial network; the training data set includes a plurality of training samples, each of which includes a noise sample, a third information of a map sample, and a second image corresponding to the map sample; the second image includes a second area with a plurality of second feasible paths; the third information includes an obstacle sample and a target point sample; the target point sample includes a starting point sample and an end point sample; the second feasible path is a path from the starting point sample to the end point sample. path; using the training data set, training the preset generative double adversarial network until the training stop condition is met, and obtaining a trained generative double adversarial network; the trained generative double adversarial network includes the trained generator; wherein the preset generative double adversarial network includes a preset generator, a preset point discriminator and a preset map discriminator; the preset point discriminator is used to determine the authenticity of the output result of the preset generator based on the target point sample and the second image; the preset map discriminator is used to determine the authenticity of the output result of the preset generator based on the obstacle sample and the second image.
[0008] In one embodiment, the preset generative dual adversarial network is trained using the training data set until a training stop condition is met to obtain a trained generative dual adversarial network, including: for each of the training samples, the following steps are performed respectively: the obstacle sample, the target point sample and the noise sample are input into the preset generator to obtain a third image corresponding to the map sample; the third image includes a third area with multiple third feasible paths; the third feasible path is a path from the starting point sample to the end point sample; the second image, the third image and the target point sample are input into the preset point discriminator to obtain a first determination result of the third image; the second image, the third image and the obstacle sample are input into the preset point discriminator to obtain a first determination result of the third image; the second image, the third image and the obstacle sample are input into the preset point discriminator to obtain a first determination result of the third image; the third .... , input into the preset map discriminator to obtain the second judgment result of the third image; according to the first judgment result and the second judgment result, determine the value of the loss function of the preset generative double adversarial network; the value of the loss function includes the value of the objective function of the preset generative double adversarial network, the value of the loss function of the preset generator, the value of the loss function of the preset point discriminator and the value of the loss function of the preset map discriminator; according to the value of the loss function, adjust the parameters of the preset generative double adversarial network to obtain an updated generative double adversarial network, and when the training stop condition is not met, use the next training sample to train the updated generative double adversarial network until the training stop condition is met, so as to obtain a trained generative double adversarial network.
[0009] In one embodiment, the objective function of the preset generative dual adversarial network is:
[0010]
[0011] Wherein, u represents the second image, z represents the noise sample, y represents the given condition of the target point sample or the obstacle sample, logD(u,y) is the logarithmic value of the probability that the preset point discriminator or the preset map discriminator determines the second image as true under the given condition y, is the joint distribution expectation of the second image and the given condition y, log(1-D(z,y),y) is the negative value of the logarithm of the probability that the preset point discriminator or the preset map discriminator determines the third image to be true under the given condition y, E z~P(z),y~P(y) [1-logD(z,y),y] is the joint distribution expectation of the third image and the given condition y, It indicates that the training process of the preset generative dual adversarial network is a dual-objective problem, the training goal of the preset generator is to minimize the value of the objective function, and the training goal of the preset point discriminator or the preset map discriminator is to maximize the value of the objective function.
[0012] In one embodiment, the loss function of the preset point discriminator is:
[0013]
[0014] The loss function of the preset map discriminator is:
[0015]
[0016] Among them, L Dmaps represents the loss function of the preset map discriminator, L Dpoints is the loss function of the preset point discriminator, H represents the third image, z represents the noise sample, map represents the obstacle sample, point represents the target point sample, D maps (H,map) represents the probability that the preset map discriminator determines the second image as true, D points (H, point) represents the probability that the preset point discriminator determines the second image as true, E[logD maps (H,map)] represents the correct judgment degree of the preset map discriminator on the second image, E[logD points (H, point)] represents the correct judgment degree of the preset point discriminator on the second image, D maps (G(z,map,point),map) represents the probability that the preset map discriminator determines the third image as true, D points (G(z,map,point),point) is the probability that the preset point discriminator determines the third image as true, E[log(1-D maps (G(z,map,point),map))] represents the average degree to which the preset map discriminator correctly judges the third image as false, E[log(1-D points (G(z,map,point),point))] represents the average degree to which the preset point discriminator correctly judges the third image as false.
[0017] In one embodiment, the fitness function of the particle swarm optimization algorithm includes a path length fitness function, a path time fitness function and a path smoothness fitness function.
[0018] The present application also provides a path planning system, including an acquisition module, a first path module and a second path module; the acquisition module is used to acquire first information; the first information includes noise information and second information of a target map of the path to be planned; the second information includes obstacle information and target point information; the target point information includes information of the starting point and end point of the path planning of the target map; the first path module is used to input the first information into a trained generator to obtain a first image corresponding to the target map; the first image includes a first area with multiple first feasible paths; the first feasible path is a path from the starting point to the end point; the second path module is used to use a particle swarm optimization algorithm to determine the optimal planning path of the target map in the first area.
[0019] The present application also provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned path planning method when executing the computer program.
[0020] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned path planning method is implemented.
[0021] The present application also provides a computer program product, which is stored in a storage medium and implements the above-mentioned path planning method when the computer program product is executed by at least one processor.
[0022] The present application provides a path planning method and product, which obtains a first image corresponding to a target map by inputting first information into a trained generator, wherein the first image includes a first area having multiple first feasible paths. Based on the first area, a particle swarm can be heuristically guided to move toward a high concentration of pheromones, thereby reducing unnecessary exploration areas of the particle swarm in the target map, thereby narrowing the area range for the particle swarm to search for the optimal planning path of the target map, and improving the efficiency and accuracy of using a particle swarm optimization algorithm to search for the optimal planning path. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flowchart of a path planning method provided in an embodiment of the present application;
[0024] Figure 2 is a schematic diagram of obstacle information provided by an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of target point information provided by an embodiment of the present application;
[0026] Figure 4It is a training diagram of a generative dual adversarial network provided in an embodiment of the present application;
[0027] Figure 5 It is a schematic diagram of a process for determining an optimal planning path provided in an embodiment of the present application;
[0028] Figure 6 is a schematic diagram of the structure of a path planning system provided in an embodiment of the present application;
[0029] Figure 7 It is a schematic diagram of the structure of an embodiment of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0032] The path planning method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the path planning method, etc., but is not limited to the above forms.
[0033] The path planning method provided in the embodiment of the present application is described in detail below through specific embodiments in conjunction with the accompanying drawings.
[0034] This application embodiment provides a path planning method, see Figure 1 , the path planning method may include:
[0035] Step S101: Acquire first information; the first information includes noise information and second information of a target map of a path to be planned; the second information includes obstacle information and target point information; the target point information includes information of a starting point and an end point of the path planning of the target map;
[0036] Step S102: inputting the first information into the trained generator to obtain a first image corresponding to the target map; the first image includes a first area having a plurality of first feasible paths; the first feasible path is a path from the starting point to the end point;
[0037] Step S103: using a particle swarm optimization algorithm to determine the optimal planning path of the target map in the first area.
[0038] A path planning method provided in an embodiment of the present application obtains a first image corresponding to a target map by inputting first information into a trained generator, wherein the first image includes a first area having multiple first feasible paths. Based on the first area, a particle swarm can be heuristically guided to move toward a high concentration of pheromones, thereby reducing unnecessary exploration areas of the particle swarm in the target map, thereby narrowing the area range for the particle swarm to search for the optimal planning path of the target map, and improving the efficiency and accuracy of using a particle swarm optimization algorithm to search for the optimal planning path.
[0039] Optionally, the obstacle information in the above step S101 is information used to characterize the distribution position of the obstacle in the target map; the target point information in the above step S101 is information used to characterize the distribution position of the target point in the target map, wherein the target point includes the starting point and end point of the path planning of the target map; the noise information in the above step S101 is information used to characterize random noise.
[0040] Preferably, the obstacle information is an obstacle distribution image corresponding to the target map, such as Figure 2 Preferably, the target point information is a target point distribution image corresponding to the target map, such as Figure 3 Preferably, the noise information is a noise image, which is a random image of the same size as the obstacle distribution image or the target point image, and each pixel value thereof is randomly generated. Optionally, the target point distribution image has the same size as the obstacle distribution image.
[0041] It is worth mentioning that using the obstacle distribution image, target point distribution image, and noise image corresponding to the target map as the input of the generator can simplify the preprocessing requirements of the target map, thereby saving path planning time and having good practical value.
[0042] In one embodiment, before inputting the first information into the trained generator in the above step S102 to obtain the first image corresponding to the target map, the path planning method provided in the embodiment of the present application further includes:
[0043] A training data set and a preset generative dual adversarial network are obtained; the training data set includes a plurality of training samples, each training sample includes a noise sample, third information of a map sample, and a second image corresponding to the map sample; the second image includes a second area having a plurality of second feasible paths; the third information includes an obstacle sample and a target point sample; the target point sample includes a starting point sample and an end point sample; the second feasible path is a path from the starting point sample to the end point sample;
[0044] Using the training data set, the preset generative dual adversarial network is trained until the training stop condition is met, thereby obtaining a trained generative dual adversarial network; the trained generative dual adversarial network includes a trained generator;
[0045] Among them, the preset generative dual adversarial network includes a preset generator, a preset point discriminator and a preset map discriminator; the preset point discriminator is used to determine the authenticity of the output result of the preset generator based on the target point sample and the second image; the preset map discriminator is used to determine the authenticity of the output result of the preset generator based on the obstacle sample and the second image.
[0046] like Figure 4 As shown in the figure, the generative dual adversarial network includes a generator and two discriminators, namely the point discriminator and the map discriminator. During the training process of the generative dual adversarial network, the generator competes with the point discriminator and the map discriminator respectively, and improves the generation ability of the generator and the discrimination ability of the discriminator by continuously optimizing its own parameters, ultimately achieving the goal of enabling the generator to generate high-quality data.
[0047] The embodiment of the present application utilizes a point discriminator and a map discriminator to perform dual adversarial training on the generator, so that the trained generator can accurately obtain the first image corresponding to the target map, thereby improving the efficiency and accuracy of using the particle swarm optimization algorithm to find the optimal planning path in the first area of the first image.
[0048] In one embodiment, the preset generative dual adversarial network is trained using the training data set until the training stop condition is met to obtain a trained generative dual adversarial network, including:
[0049] For each training sample, perform the following steps:
[0050] The obstacle samples, the target point samples and the noise samples are input into a preset generator to obtain a third image corresponding to the map sample; the third image includes a third area having a plurality of third feasible paths; the third feasible path is a path from the starting point sample to the end point sample;
[0051] Input the second image, the third image and the target point sample into a preset point discriminator to obtain a first determination result of the third image;
[0052] Inputting the second image, the third image and the obstacle sample into a preset map discriminator to obtain a second determination result of the third image;
[0053] According to the first determination result and the second determination result, determining the value of the loss function of the preset generative dual adversarial network; the value of the loss function includes the value of the preset objective function of the generative dual adversarial network, the value of the preset generator loss function, the value of the preset point discriminator loss function and the value of the preset map discriminator loss function;
[0054] According to the value of the loss function, the parameters of the preset generative dual adversarial network are adjusted to obtain an updated generative dual adversarial network. When the training stop condition is not met, the updated generative dual adversarial network is trained using the next training sample until the training stop condition is met, thereby obtaining a trained generative dual adversarial network.
[0055] Continue to refer Figure 4 The generator may include a particle swarm optimization (PSO) algorithm module and a map drawing module. The PSO algorithm module may be used to determine image information corresponding to the map sample based on the target point sample and the noise sample, the image information may include third area information having multiple third feasible path information, and the map drawing module may be used to convert the image information processed by the noise sample into a third image corresponding to the map sample.
[0056] Optionally, the obstacle samples, target point samples and noise samples are samples in image format. In the training process of the generative dual adversarial network, the parameters in the generator must be fixed first. When using the Adam optimizer, the parameters can be set as follows: the first-order dynamic attenuation rate β1 = 0.5, the second-order dynamic attenuation rate β2 = 0.99, and the learning rates of the two discriminators can be set to 0.00001, and the learning rate of the generator can be set to 0.0001.
[0057] Then, the 64×64×3-dimensional obstacle samples, target point samples and 64×64×1-dimensional noise samples can be used as the input of the generator. After the obstacle samples and target point samples are input into the generator, they are respectively sent to the convolution layer with 16 channels for processing, while the noise samples are input into the generator and sent to the convolution layer with 32 channels for processing. Finally, the generator outputs the third image corresponding to the map sample and sends the third image to the point discriminator and the map discriminator respectively. The size of the third image is 64×64×3 dimensions.
[0058] Next, when the point discriminator receives the third image sent by the generator, it uses the target point samples to determine whether the third image meets the distribution conditions of the target points, and combines the comparison results of the second image and the third image corresponding to the map sample to comprehensively determine the authenticity of the third image output by the generator, and obtains a first determination result indicating whether the third image is true / false. Optionally, the first determination result is the probability that the point discriminator determines the third image to be true. When the map discriminator receives the third image sent by the generator, it uses the obstacle samples to determine whether the third image meets the distribution conditions of the obstacles, and combines the comparison results of the second image and the third image corresponding to the map sample to comprehensively determine the authenticity of the third image output by the generator, and obtains a second determination result indicating whether the third image is true / false. Optionally, the first determination result is the probability that the point discriminator determines the third image to be true.
[0059] Next, the value of the loss function of the generative dual adversarial network can be determined according to the first judgment result and the second judgment result, and the parameters of the preset generative dual adversarial network can be adjusted according to the value of the loss function to obtain an updated generative dual adversarial network.
[0060] Furthermore, it can be determined whether the training stop condition is met. If the training stop condition is not met, the updated generative dual adversarial network can be trained using the next training sample; if the training stop condition is met, the updated generative dual adversarial network can be determined as the trained generative dual adversarial network.
[0061] Optionally, the training stop condition includes at least one of the following: the number of training iterations of the generative dual adversarial network reaches a preset number, the probability that the third image corresponding to the map sample output by the generator is judged to be true by the point discriminator is higher than a first preset probability, and the probability that the third image corresponding to the map sample output by the generator is judged to be true by the map discriminator is higher than a second preset probability.
[0062] In the embodiment of the present application, obstacle samples, target point samples and noise samples are input into a preset generator to obtain a third image corresponding to the map sample, and then the second image, the third image and the target point sample are input into a preset point discriminator to obtain a first determination result of the third image, and the second image, the third image and the obstacle sample are input into a preset map discriminator to obtain a second determination result of the third image, and then the value of the loss function of the preset generative dual adversarial network is determined according to the first determination result and the second determination result, and the parameters of the preset generative dual adversarial network are adjusted according to the value of the loss function to obtain an updated generative dual adversarial network, and then, if the training stop condition is not met, the updated generative dual adversarial network is trained with the next training sample until the training stop condition is met to obtain a trained generative dual adversarial network, so as to realize iterative adversarial training between the point discriminator, the map discriminator and the generator, and improve the training effect of the generator, the point discriminator and the map discriminator, so that the trained generator can accurately obtain the first image corresponding to the target map, thereby improving the efficiency and accuracy of finding the optimal planning path in the first area of the first image using the particle swarm optimization algorithm.
[0063] In one embodiment, the objective function of the preset generative dual adversarial network is:
[0064]
[0065] Wherein, u represents the second image, z represents the noise sample, y represents the given condition of the target point sample or obstacle sample, logD(u,y) is the logarithmic value of the probability of judging the second image as true under the given condition y by the preset point discriminator or the preset map discriminator, is the joint distribution expectation of the second image and the given condition y, log(1-D(z,y),y) is the negative value of the logarithm of the probability that the third image is judged to be true under the given condition y by the preset point discriminator or the preset map discriminator, E z~P(z),y~P(y) [1-logD(z,y),y] is the joint distribution expectation of the third image and the given condition y, It indicates that the training process of the preset generative dual adversarial network is a dual-objective problem, the training goal of the preset generator is to minimize the value of the objective function, and the training goal of the preset point discriminator or the preset map discriminator is to maximize the value of the objective function.
[0066] The embodiment of the present application is based on the dual adversarial training characteristics of the point discriminator, the map discriminator and the generator. The probability of the point discriminator or the map discriminator judging the second image as true under the given condition y, and the probability of the point discriminator or the map discriminator judging the third image as true under the given condition y are used as reference variables to set the objective function of the generative dual adversarial network. The accuracy of the value of the objective function of the generative dual adversarial network determined during the training process can be ensured, thereby ensuring the effectiveness of the adversarial training of the generator and the point discriminator and the map discriminator.
[0067] In one embodiment, the loss function of the preset point discriminator is:
[0068]
[0069] Among them, L Dpoints is the loss function of the preset point discriminator, H represents the third image, z represents the noise sample, map represents the obstacle sample, point represents the target point sample, and D points (H, point) represents the probability that the preset point discriminator judges the second image as true, E[logD points (H, point)] represents the correct judgment degree of the preset point discriminator on the second image, D points (G(z,map,point),point) is the probability that the preset point discriminator judges the third image as true, E[log(1-D points (G(z,map,point),point))] represents the average degree to which the preset point discriminator correctly judges the third image as fake.
[0070] The embodiment of the present application is based on the adversarial training characteristics of the generator and the point discriminator. The probability that the point discriminator judges the second image as true, and the probability that the point discriminator judges the third image as true based on the target point sample and the second image are used as basic variables to set the loss function of the point discriminator. This can ensure the accuracy of the value of the loss function of the point discriminator determined during the training process, thereby ensuring the effectiveness of the adversarial training of the generator and the point discriminator.
[0071] In one embodiment, the loss function of the preset map discriminator is:
[0072]
[0073] Among them, L Dmaps represents the loss function of the preset map discriminator, D maps (H,map) represents the probability that the preset map discriminator determines the second image as true, E[logD maps (H,map)] represents the correct judgment degree of the preset map discriminator on the second image, Dmaps (G(z,map,point),map) represents the probability that the preset map discriminator determines the third image as true, E[log(1-D maps (G(z,map,point),map))] represents the average degree to which the preset map discriminator correctly judges the third image as false.
[0074] The embodiment of the present application is based on the adversarial training characteristics of the generator and the map discriminator. The probability that the map discriminator determines the second image as true and the probability that the map discriminator determines the third image as true based on the obstacle sample and the second image are used as basic variables to set the loss function of the map discriminator. This can ensure the accuracy of the value of the loss function of the map discriminator determined during the training process, thereby ensuring the effectiveness of the adversarial training of the generator and the map discriminator.
[0075] like Figure 5 As shown, the above step S103: using the particle swarm optimization algorithm to determine the optimal planning path of the target map in the first area may include the following steps:
[0076] Step S201: randomly initializing the speed of each particle in the particle group and the position of each particle in the first area;
[0077] Step S202: Based on the speed of each particle and the position of each particle in the first area, the fitness function of the particle swarm optimization algorithm is combined to evaluate the fitness;
[0078] Step S203: based on the fitness, updating the individual optimal position of each particle in the first area and the global optimal position of the particle group in the first area;
[0079] Step S204: Determine whether the termination condition is met;
[0080] If the termination condition is not met, execute step S205: update the speed of each particle and the position of each particle in the first area, and return to execute step S202;
[0081] When the termination condition is met, step S206 is executed: based on the individual optimal position of each particle in the first area and the global optimal position of the particle group in the first area, the optimal planning path of the target map is output.
[0082] Specifically, in the particle swarm optimization algorithm, each particle represents a search individual in the search space. The path planning problem can usually be understood as gradually approaching the optimal planning path by continuously adjusting the particle speed and the particle position in the search space. Assume that I is the total number of particle swarms. In the search control, each particle i has a position s i and speed v i, s represents the direction of the particle moving area, v represents the speed of the particle moving, and the values of position and speed are randomized. The coordinates of the i-th particle in the X-dimensional search space are defined as s i =(s1,s2,...,s X ), where 1≤i≤X, and the velocity vector is defined as v i =(v1,v2,...,v X ).
[0083] Optionally, the velocity formula of particle i in the x-dimensional search space (1≤x≤X) is:
[0084]
[0085] Alternatively, the position formula of particle i in the x-dimensional search space (1≤x≤X) is:
[0086]
[0087] in, represents the velocity of particle i at time t, represents the position of particle i at time t, represents the individual historical optimal position of the i-th particle, It represents the global optimal historical position of the particle. w, c1, c2 are parameters, and rand() is a random number function. represents the position of the i-th particle at time t+1, represents the velocity of the i-th particle at time t+1.
[0088] Optionally, the fitness function of the particle swarm optimization algorithm includes a path length fitness function, a path time fitness function and a path smoothness fitness function.
[0089] Optionally, the fitness function of the particle swarm optimization algorithm is:
[0090]
[0091] in, The particle swarm optimization algorithm targets the path The fitness function value of For the path The path length fitness function is For the path The path time fitness function is For the path is the path smoothness fitness function, a1, a2 and a3 are the weight coefficients of the path length fitness function, the path time fitness function and the path smoothness fitness function, respectively, which are used to adjust the influence of each factor in the fitness function of the particle swarm optimization algorithm.
[0092] Optionally, the path length fitness function is:
[0093]
[0094] Where n is the total number of nodes that particle i passes through (including the starting point and the end point), p i ,q i Represent the horizontal and vertical coordinates of particle i respectively.
[0095] Optionally, the path time fitness function is:
[0096]
[0097] Among them, t goal Is the path The time to reach the target state, t init It is to find the path The start time record.
[0098] Optionally, the path smoothness fitness function is:
[0099]
[0100] Where n is the total number of nodes that particle i passes through (including the starting point and the end point), θ i It is the angle between the coordinates of each node along the path.
[0101] The embodiment of the present application comprehensively evaluates the fitness of the process of finding the optimal planning path in the first area using the particle swarm optimization algorithm based on the path length fitness function, the path time fitness function and the path smoothness fitness function, and can improve the quality of the optimal planning path of the target map found using the particle swarm optimization algorithm.
[0102] In one application scenario, the target map may be a work area map of a mobile robot. First, the work area map may be preprocessed to obtain obstacle images and target point images corresponding to the work area map; then, the randomly generated noise image, as well as the obstacle image and target point image corresponding to the work area map, may be input into a trained generator to obtain a first image corresponding to the work area map; the first image has a first area with multiple first feasible paths; finally, the particle swarm optimization algorithm is used to determine the optimal planning path of the work area map in the first area.
[0103] The path planning method provided in the embodiment of the present application can quickly and accurately determine the effective search area of the particle swarm through the generative dual adversarial network, and then use the particle swarm optimization algorithm to quickly and accurately find the optimal planning path in the search area. It can be applicable to various path planning scenarios, especially complex path planning scenarios, and has good practical value. In addition, the traditional particle swarm optimization algorithm can often only search for local optimal solutions and it is difficult to obtain a variety of paths. After the introduction of the generative dual adversarial network, multiple candidate paths can be generated, thereby increasing the diversity and richness of the path. In addition, in traditional path planning, only a single goal such as path length is often considered, and the comprehensive optimization of multiple goals cannot be considered. Combining the generative dual adversarial network with the particle swarm optimization algorithm can integrate multiple goals into the fitness function of the particle swarm optimization algorithm, so that a high-quality planning path can be obtained.
[0104] See also Figure 6 The embodiment of the present application also provides a path planning system 600, including an acquisition module 601, a first path module 602 and a second path module 603.
[0105] The acquisition module 601 is used to acquire first information; the first information includes noise information and second information of the target map of the path to be planned; the second information includes obstacle information and target point information; the target point information includes information of the starting point and end point of the path planning of the map;
[0106] The first path module 602 is used to input the first information into the trained generator to obtain a first image corresponding to the target map; the first image includes a first area having a plurality of first feasible paths; the first feasible path is a path from the starting point to the end point;
[0107] The second path module 603 is used to determine the optimal planning path of the target map in the first area by using a particle swarm optimization algorithm.
[0108] The path planning system provided in the embodiment of the present application can implement the various steps of the above-mentioned path planning method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0109] Optionally, an embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, each step of the above-mentioned path planning method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. It should be noted that the electronic device in the embodiment of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.
[0110] Figure 7A schematic diagram of the hardware structure of an electronic device for implementing an embodiment of the present application is provided, wherein the electronic device includes:
[0111] The processor 701 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0112] The memory 702 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 702 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 702, and the processor 701 calls and executes the path planning method of the embodiment of this application;
[0113] Input / output interface 703, used to implement information input and output;
[0114] Communication interface 704, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0115] A bus 705 that transmits information between the various components of the device (e.g., the processor 701, the memory 702, the input / output interface 703, and the communication interface 704);
[0116] The processor 701 , the memory 702 , the input / output interface 703 and the communication interface 704 are connected to each other in communication within the device via a bus 705 .
[0117] The electronic device provided in the embodiment of the present application can implement each step of the above-mentioned path planning method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0118] An embodiment of the present application also provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various steps of the above-mentioned path planning method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0119] The processor is the processor in the electronic device described in the above embodiment. The computer-readable storage medium includes a computer-readable storage medium such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0120] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various steps of the above-mentioned path planning method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0121] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0122] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various steps of the above-mentioned path planning method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0123] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0125] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A path planning method, characterized in that: include: Acquire first information; the first information includes noise information and second information of a target map of a path to be planned; The second information includes obstacle information and target point information; The target point information includes the information of the starting point and the end point of the path planning of the target map; Inputting the first information into a trained generator to obtain a first image corresponding to the target map; the first image includes a first area having a plurality of first feasible paths; The first feasible path is a path from the starting point to the end point; Using a particle swarm optimization algorithm, an optimal planning path of the target map is determined in the first area.
2. The path planning method according to claim 1, characterized in that: Before inputting the first information into the trained generator to obtain the first image corresponding to the target map, the path planning method further includes: A training data set and a preset generative dual adversarial network are obtained; the training data set includes a plurality of training samples, each of the training samples includes a noise sample, third information of a map sample, and a second image corresponding to the map sample; the second image includes a second area having a plurality of second feasible paths; the third information includes an obstacle sample and a target point sample; the target point sample includes a starting point sample and an end point sample; the second feasible path is a path from the starting point sample to the end point sample; Using the training data set, the preset generative dual adversarial network is trained until a training stop condition is met, thereby obtaining a trained generative dual adversarial network; the trained generative dual adversarial network includes the trained generator; Among them, the preset generative dual adversarial network includes a preset generator, a preset point discriminator and a preset map discriminator; the preset point discriminator is used to determine the authenticity of the output result of the preset generator based on the target point sample and the second image; the preset map discriminator is used to determine the authenticity of the output result of the preset generator based on the obstacle sample and the second image.
3. The path planning method according to claim 2, characterized in that: The method of using the training data set to train the preset generative dual adversarial network until a training stop condition is met to obtain a trained generative dual adversarial network includes: For each of the training samples, the following steps are performed respectively: Inputting the obstacle sample, the target point sample and the noise sample into the preset generator to obtain a third image corresponding to the map sample; the third image includes a third area having a plurality of third feasible paths; the third feasible path is a path from the starting point sample to the end point sample; Inputting the second image, the third image and the target point sample into the preset point discriminator to obtain a first determination result of the third image; Inputting the second image, the third image and the obstacle sample into the preset map discriminator to obtain a second determination result of the third image; Determine the value of the loss function of the preset generative dual adversarial network according to the first determination result and the second determination result; the value of the loss function includes the value of the objective function of the preset generative dual adversarial network, the value of the loss function of the preset generator, the value of the loss function of the preset point discriminator, and the value of the loss function of the preset map discriminator; According to the value of the loss function, the parameters of the preset generative dual adversarial network are adjusted to obtain an updated generative dual adversarial network. When the training stop condition is not met, the updated generative dual adversarial network is trained using the next training sample until the training stop condition is met to obtain a trained generative dual adversarial network.
4. The path planning method according to claim 3, characterized in that: The objective function of the preset generative dual adversarial network is: Wherein, u represents the second image, z represents the noise sample, y represents the given condition of the target point sample or the obstacle sample, logD(u,y) is the logarithmic value of the probability that the preset point discriminator or the preset map discriminator determines the second image as true under the given condition y, is the joint distribution expectation of the second image and the given condition y, log(1-D(z,y),y) is the negative value of the logarithm of the probability that the preset point discriminator or the preset map discriminator determines that the third image is true under the given condition y, is the joint distribution expectation of the third image and the given condition y, It indicates that the training process of the preset generative dual adversarial network is a dual-objective problem, the training goal of the preset generator is to minimize the value of the objective function, and the training goal of the preset point discriminator or the preset map discriminator is to maximize the value of the objective function.
5. The path planning method according to claim 3, characterized in that: The loss function of the preset point discriminator is: The loss function of the preset map discriminator is: Among them, L Dmaps represents the loss function of the preset map discriminator, L Dpoints is the loss function of the preset point discriminator, H represents the third image, z represents the noise sample, map represents the obstacle sample, point represents the target point sample, D maps (H,map) represents the probability that the preset map discriminator determines the second image as true, D points (H, point) represents the probability that the preset point discriminator determines the second image as true, E[logD maps (H,map)] represents the correct judgment degree of the preset map discriminator on the second image, E[logD points (H, point)] represents the correct judgment degree of the preset point discriminator on the second image, D maps (G(z,map,point),map) represents the probability that the preset map discriminator determines the third image as true, D points (G(z,map,point),point) is the probability that the preset point discriminator determines the third image as true, E[log(1-D maps (G(z,map,point),map))] represents the average degree to which the preset map discriminator correctly judges the third image as false, E[log(1-D points (G(z,map,point),point))] represents the average degree to which the preset point discriminator correctly judges the third image as false.
6. The path planning method according to claim 1, characterized in that: The fitness function of the particle swarm optimization algorithm includes a path length fitness function, a path time fitness function and a path smoothness fitness function.
7. A path planning system, characterized in that: It includes an acquisition module, a first path module and a second path module; The acquisition module is used to acquire first information; the first information includes noise information and second information of a target map of a path to be planned; the second information includes obstacle information and target point information; the target point information includes information of a starting point and an end point of the path planning of the target map; The first path module is used to input the first information into the trained generator to obtain a first image corresponding to the target map; the first image includes a first area having multiple first feasible paths; The first feasible path is a path from the starting point to the end point; The second path module is used to determine the optimal planning path of the target map in the first area by using a particle swarm optimization algorithm.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the path planning method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the path planning method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product is stored in a storage medium, and when the computer program product is executed by at least one processor, the path planning method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Robot path planning method based on generative adversarial network and ant colony algorithm
CN114167865A
Path planning method and system based on mining area material loading and unloading
CN118670408A