Path planning and model training method and system, storage medium and robot
By extracting and correlating the connection relationship between indoor area maps, a variant map is formed, and the path planning model is updated using the difference degree, the problem of accuracy and calculation of traditional navigation systems in complex map data processing is solved, and efficient and accurate Path planning.
Patent Information
- Application Number
- CN202410955330.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-08
AI Technical Summary
Traditional robot navigation systems have problems with limited path planning accuracy and high computational cost when processing complex map data, and cannot adapt to dynamically changing environments.
By extracting the connection relationship of nodes from the indoor area map collection, associating them with the corresponding nodes, forming an indoor area variant diagram, simplifying the graph structure, and inputting the variant diagram and navigation instructions into the path planning model, generating a plan based on the connection relationship Path, update model parameters using the degree of difference to achieve efficient and accurate path planning.
Accurate path planning for complex indoor environments is realized, the accuracy and efficiency of path planning is improved, computing resource requirements are reduced, and dynamic environmental changes are adapted to.
Smart Images

Figure CN118913275A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robots, and in particular to a path planning and model training method, system, storage medium and robot. Background Art
[0002] In recent years, large language models have made significant progress in natural language processing, dialogue systems, machine translation and other fields. However, despite their outstanding performance in processing text and language tasks, large language models still face many challenges in understanding and processing non-language information, especially spatial data and graph structured data. As an important form of spatial data, map data is widely used in navigation, path planning, geographic information systems and other fields. Traditional robot navigation systems usually use two-dimensional occupancy grid maps for path planning, but this method has the problems of high update frequency and large amount of calculation, and cannot adapt to dynamically changing environments. Therefore, it is necessary to provide a path planning and model training method, system, storage medium and robot. Summary of the invention
[0003] The present invention provides a training method for a path planning model to solve the problem that the traditional path planning method in the prior art has limitations when processing complex map data, resulting in limited accuracy of the planned path.
[0004] The present invention provides a training method for a path planning model, comprising: obtaining a real path set, a corresponding navigation instruction set and an indoor area map set; wherein each area map of the indoor area map set uses each marked point in the area as a node, and uses edges to connect each connected marked point, and the navigation instruction set includes a starting marked point and an ending marked point of the real path set; extracting a connection relationship of each node from the indoor area map set, associating the connection relationship with the corresponding node, and deleting all edges in the indoor area map set to form an indoor area variant map set; inputting the indoor area variant map set and the navigation instruction set into the path planning model, and generating a planned path set based on the connection relationship in the indoor area variant map set and the starting marked point and the ending marked point of the navigation instruction set; updating the parameters of the path planning model according to the difference between the planned path set and the real path set to obtain a trained path planning model; wherein the path planning model is a large language model.
[0005] In one embodiment of the present invention, the connection relationship of each node is extracted from the indoor area graph set, the connection relationship is associated with the corresponding node, and all the edges in the indoor area graph set are deleted to form an indoor area variant graph set, including: extracting all the nodes and the edges connected to the nodes from the indoor area graph set; for each extracted node: searching for the edge connected to the current node, determining other nodes directly connected to the current node and generating a connection relationship, and storing the connection relationship inside the current node; deleting all the edges from the indoor area graph set to form an indoor area variant graph set.
[0006] In one embodiment of the present invention, the indoor area map set is obtained by data augmentation from an initial indoor area map set, and the process of obtaining the indoor area map set according to the initial indoor area map set is: obtaining the initial indoor area map set; randomly transforming each marking point in the initial indoor area map set to generate new marking points; using the new marking points to update the original marking points, and keeping the original connection relationship of each marking point unchanged, to obtain the indoor area map set.
[0007] In one embodiment of the present invention, the parameters of the path planning model are updated according to the difference between the planned path set and the real path set to obtain a trained path planning model, including: calculating the difference between the planned path set and the real path set; according to the calculated difference, the parameters of the path planning model are updated based on the LoRA method to obtain a trained path planning model.
[0008] In one embodiment of the present invention, the parameters of the path planning model are updated based on the LoRA method according to the calculated difference to obtain a trained path planning model, including: performing matrix decomposition on the weight matrix of the path planning model into a first low-rank matrix and a second low-rank matrix; judging whether the calculated difference is less than a preset difference threshold: if not, updating the weight matrix based on the first low-rank matrix and the second low-rank matrix according to the calculated difference; if so, obtaining a trained path planning model.
[0009] In one embodiment of the present invention, the method of updating the weight matrix based on the first low-rank matrix and the second low-rank matrix according to the calculated difference includes: updating the parameters of the first low-rank matrix and the second low-rank matrix according to the calculated difference and keeping the weight matrix unchanged according to the back propagation algorithm; and calculating and updating the weight matrix based on the updated first low-rank matrix and the second low-rank matrix.
[0010] In one embodiment of the present invention, a path planning method is also provided, the method comprising: obtaining an indoor area map of the area to be planned and a navigation instruction; wherein the indoor area map uses each mark point in the area as a node, and connects each connected mark point with an edge, and the navigation instruction includes a starting mark point and an ending mark point of the area to be planned; extracting the connection relationship of each node from the indoor area map, associating the connection relationship with the corresponding node, and deleting all the edges in the indoor area map to form an indoor area variant map; inputting the indoor area variant map and the navigation instruction into the path planning model obtained by the training method of the path planning model according to any one of claims 1 to 6, and generating a planned path in the area to be planned based on the connection relationship in the indoor area variant map and the starting mark point and the ending mark point of the navigation instruction.
[0011] In one embodiment of the present invention, a training system for a path planning model is also provided, the system comprising: a data acquisition module, used to acquire a real path set, a corresponding navigation instruction set and an indoor area map set; wherein each area map of the indoor area map set uses each marked point in the area as a node, and uses edges to connect each connected marked point, and the navigation instruction set includes a starting marked point and an ending marked point of the real path set; a variant generation module, used to extract the connection relationship of each node from the indoor area map set, associate the connection relationship with the corresponding node, and delete all edges in the indoor area map set to form an indoor area variant map set; a planned path generation module, used to input the indoor area variant map set and the navigation instruction set into the path planning model, and generate a planned path set based on the connection relationship in the indoor area variant map set and the starting marked point and the ending marked point of the navigation instruction set; a parameter updating module, used to update the parameters of the path planning model according to the difference between the planned path set and the real path set to obtain a trained path planning model; wherein the path planning model is a large language model.
[0012] In one embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes any of the above-mentioned path planning model training methods.
[0013] In one embodiment of the present invention, a robot is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the training method of the path planning model described in any one of the above items or the path planning method described above is implemented.
[0014] The present invention proposes a training method, system, device and medium for a path planning model. By extracting the connection relationship of each node from the indoor area graph set and associating these connection relationships with the corresponding nodes, the important information between the nodes is retained. After deleting all edges, a set of indoor area variant graphs is formed, which simplifies the graph structure and is easier to process and understand the model. By inputting the indoor area variant graph set and the navigation instruction set into the path planning model. The model generates a set of planned paths based on the connection relationship in the variant graph and the start and end mark points of the navigation instruction, ensuring that the path planning model can accurately understand and process the complex connection relationship in the indoor environment, thereby achieving efficient and accurate path planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic flow chart of a method for training a path planning model provided by an embodiment of the present invention;
[0016] Figure 2a An osmAG template for the first topological structure analysis created by JOSM software in one embodiment of the present invention;
[0017] Figure 2b An osmAG template for the second topological structure analysis created by JOSM software in one embodiment of the present invention;
[0018] Figure 2c The osmAG template for the third topological structure analysis created by the JOSM software in one embodiment of the present invention;
[0019] Figure 2d The osmAG template for the fourth topological structure analysis created by the JOSM software in one embodiment of the present invention;
[0020] Figure 3 The osmAG template map showing topological analysis and hierarchical analysis in one embodiment of the present invention is shown;
[0021] Figure 4 Shown as a fragment of a traditional osmAG map file;
[0022] Figure 5 A fragment of a first indoor area variant diagram is shown;
[0023] Figure 6 A fragment of a second indoor area variant diagram is shown;
[0024] Figure 7 Shown is the tuning process of different large language models in one embodiment of the present invention;
[0025] Figure 8 Shown is a structural block diagram of a training system for a path planning model provided by an embodiment of the present invention;
[0026] Fig. 9 Shown is a schematic diagram of the robot hardware structure according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0028] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0029] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0030] The present invention provides a training method for a path planning model, which is applied to the automatic addressing of a robot. By extracting the connection relationship of each node from an indoor area graph set and associating these connection relationships with corresponding nodes, important information between nodes is retained. After deleting all edges, a set of indoor area variant graphs is formed, which simplifies the graph structure and is easier to process and understand the model. The indoor area variant graph set and the navigation instruction set are input into the path planning model. The model generates a set of planned paths based on the connection relationship in the variant graph and the start and end mark points of the navigation instruction, ensuring that the path planning model can accurately understand and process the complex connection relationship in the indoor environment, thereby achieving efficient and accurate path planning.
[0031] See also Figure 1 ,The training method of the path planning model includes the following steps:
[0032] S1. Obtain a real path set, a corresponding navigation instruction set and an indoor area map set; wherein each area map of the indoor area map set uses each mark point in the area as a node and uses edges to connect each connected mark point, and the navigation instruction set includes a starting mark point and an ending mark point of the real path set.
[0033] The real path set includes multiple real paths, which are actual optimal paths marked in advance. Each real path consists of two or more marking points, and each marking point is arranged in sequence to form an optimal path from the starting marking point to the ending marking point. The indoor area map set includes multiple indoor area maps, which adopt the osmAG map expression format and are a graph structure composed of marking points and connection relationships. This map expression format can realize the multi-floor positioning and path planning schemes in indoor and outdoor scenes of traditional robot algorithms, and overcome the problems of long path search time in traditional navigation frameworks and inability to navigate across floors. Among them, the marking points are used to represent specific locations or rooms in the indoor area map, and the types of marking points include but are not limited to rooms, coordinate positioning, corridor intersections, etc. The nodes of the indoor map are constructed through these marking points, and the connection relationship between the marking points is represented by edges, thereby forming a complete graph structure. For example, for an office building, the marking points can be the numbers of each office, such as 1d-101, 3d-315, etc. The navigation instruction set includes navigation instructions corresponding to the real path set. In each navigation instruction, a starting mark point and an ending mark point are specified, and the path planning model is required to generate a path from the specified starting mark point to the ending mark point. Exemplarily, the navigation instruction is: In office building A, give the shortest path from 1d-101 to 4d-408 of the building, and give the names of all the rooms I need to pass through, including the starting room and the target room. In the present invention, the navigation instruction is a natural language instruction. Since the natural language instruction is expressed in everyday language, the user can use the navigation method conveniently and intuitively without mastering professional terms, which greatly enhances the user experience.
[0034] It should be noted that the present invention can use the existing osmAG map format as the indoor area map, and can also draw a corresponding map structure according to the building situation and use it as the indoor area map. The specific method is not limited here.
[0035] See also Figure 2a to Figure 2d , Figure 2a The osmAG template for the first topological structure analysis created by the JOSM software in one embodiment of the present invention includes multiple rooms (i.e., marking points), and the room numbers are from 1d-201 to 1d-204. The rooms are connected by corridors to generate a relatively simple topological structure. Figure 2bThis is an osmAG template for the second topological structure analysis created by JOSM software in one embodiment of the present invention. The rooms are connected by corridors and passages, and the generated topological structure is more complex. Figure 2c The osmAG template for the third topological structure analysis created by JOSM software in one embodiment of the present invention. The rooms in the regional layout are connected by multiple channels, and the generated topological structure is relatively Figure 2b Simple. Figure 2d The osmAG template for the fourth topological structure analysis created by JOSM software in one embodiment of the present invention, the rooms in the regional layout are connected by a few channels, and the generated topological structure is relatively simple. Using the method described in the present invention, given the starting point and the end point, the large language model can quickly and accurately give the best path, and realize accurate and rapid understanding of the topological structure.
[0036] In one embodiment of the present invention, the indoor area map set is obtained by data augmentation from the initial indoor area map set, and the process of obtaining the indoor area map set according to the initial indoor area map set is:
[0037] Get the initial indoor area map set;
[0038] Randomly transform each marking point in the initial indoor area map set to generate new marking points;
[0039] The original marking points are updated with new marking points, and the original connection relationship of each marking point is kept unchanged to obtain a set of indoor area maps.
[0040] The initial indoor area set includes multiple indoor area maps, which represent the layout inside the building, and each indoor area map is a graph structure composed of markers and connection relationships. These markers are randomly transformed to generate new marker names that are consistent with the number of original markers. It should be noted that the names of the generated new markers are unique and different from the original names. The original marker names in the initial indoor area map set are replaced with randomly generated new marker names, and when replacing the marker names, the connection relationship between the markers must be kept unchanged. In the final indoor area map set, the marker names are replaced by randomly generated new names, and new markers are generated. The new markers will continue to be connected to other markers according to the original connection relationship. For example. In the initial indoor area map set, there are three markers A, B, and C, and the connection relationship is: A connects B, and B connects C. After the markers are randomly transformed, the new marker names are generated as follows: the original marker "A" is randomly transformed into "T", the original marker "B" is randomly transformed into "Y", and the original marker "C" is randomly transformed into "Q". In the final indoor area graph set, the new nodes are T, Y and Q, and the connection relationship is: T connects to Y, and Y connects to Q.
[0041] S2. Extracting the connection relationship of each node from the indoor area graph set, associating the connection relationship with the corresponding node, and deleting all edges in the indoor area graph set to form an indoor area variant graph set.
[0042] Considering that the original indoor area map is in the osmAG map expression format, osmAG uses nodes in the graph structure to represent rooms, and uses a separate 'way' with an 'osmAG:type' type of 'passage' to represent the connection relationship between each node. For the language model, this expression of the connection relationship of 'way' may be too far away from the node and affect the reasoning result. To solve this problem, in the present invention, since the indoor area map set includes multiple area maps, each map is composed of nodes and edges, which are used to represent the layout inside the building and the connection relationship between each mark point. For each node in the area map: determine the other nodes directly connected to it, and generate connection relationships, and save these connection relationships to the corresponding nodes to represent the connection between the nodes. Then delete all edges from the area map, and only retain the nodes and their internal connection relationships. After all the edges of all area maps are deleted in the above manner, all area maps with deleted edges constitute a set of indoor area variant maps. As Figure 3 As shown, the present invention creates an osmAG template map for topological analysis and hierarchical analysis through JOSM software. "Parbhat" and "Eren" represent node names. The position of the corresponding node in the graph structure can be found through the node name, so that the later model can perform path planning.
[0043] In one embodiment of the present invention, extracting the connection relationship of each node from the indoor area graph set, associating the connection relationship with the corresponding node, and deleting all edges in the indoor area graph set to form an indoor area variant graph set includes:
[0044] Extracting all nodes and edges connected to the nodes from the indoor area graph set;
[0045] For each extracted node: find the edge connected to the current node, determine other nodes directly connected to the current node and generate connection relationships, and store the connection relationships inside the current node;
[0046] All edges are deleted from the indoor area graph set to form an indoor area variant graph set.
[0047] For each indoor area graph in the indoor area graph set: extract all nodes and edges connected to the nodes from the graph, wherein the node represents a specific location or room in the indoor area graph, and the edge represents the connection relationship between these locations or rooms. Exemplarily, one of the indoor area graphs is as follows: nodes: A, B, C, edges: A connected to B, B connected to C. The connection relationship extracted therefrom is: (A, B), (B, C). For each node extracted from the indoor area, find the edge connected to the node, so that other nodes directly connected to the node can be determined, and the connection relationship of the node is formed, and these connection relationships are saved inside the node. Exemplarily, for the above-mentioned node A, find all edges connected to A and obtain (A, B). It can be confirmed that the other node directly connected to A is B, which is recorded in node A as: A: {connected_to: [B]}. Similarly, for the above-mentioned node B, it is recorded in node B as: B: {connected_to: [A, C]}. After the connection relationship is saved inside the node, all edges are deleted from the corresponding indoor area graph, and only the nodes are retained to form an indoor area variant graph. For example, the indoor area variant graph is: A: {connected_to: [B]}; B: {connected_to: [A, C]}; C: {connected_to: [B]}. After all indoor area graphs are processed in the above manner, all indoor area variant graphs obtained constitute the indoor area variant graph set.
[0048] S3. Input the indoor area variant graph set and the navigation instruction set into a path planning model, and generate a planned path set based on the connection relationship in the indoor area variant graph set and the starting mark point and the ending mark point of the navigation instruction set; wherein the path planning model is a large language model.
[0049] The indoor area variant map set and the navigation instruction set are used as training sets and input into the path planning model. Based on the graph search algorithm, for each indoor area variant map and the corresponding navigation instruction, the shortest path from the starting mark point to the ending mark point is calculated as the planned path. Multiple planned paths constitute the planned path set. The large language model includes but is not limited to BERT, LLaMA2, XLNet, etc. Preferably, the large language model is LLaMA2-7B or LLaMA2-13B model.
[0050] S4. According to the difference between the planned path set and the real path set, update the parameters of the path planning model to obtain a trained path planning model.
[0051] The difference between each planned path and the corresponding real path is calculated. The difference reflects the deviation between the planned path and the real path. The smaller the difference, the closer the predicted planned path is to the real path. Based on the gradient descent method, the parameters of the model are updated according to the difference, and the path planning model is iteratively trained. Finally, when the difference is less than the preset difference threshold, the trained path planning model is obtained.
[0052] In one embodiment of the present invention, updating the parameters of the path planning model according to the difference between the planned path set and the real path set to obtain a trained path planning model includes:
[0053] Calculating the difference between the planned path set and the real path set;
[0054] According to the calculated difference, the parameters of the path planning model are updated based on the LoRA method to obtain a trained path planning model.
[0055] During iterative training, the path planning model calculates the difference between the predicted planned path and the corresponding real path. Since the path planning model is a large language model, a large number of parameters need to be adjusted during the training process, resulting in a high demand for training resources for the model. In order to solve this problem, the LoRA (Low-Rank Adaptation) method is used in this embodiment to introduce additive low-rank matrices in the neural network layer. During the parameter fine-tuning process, the LoRA method keeps the original weight matrix unchanged and only updates these low-rank matrices, thereby improving the understanding ability of the large language model. In this way, the number of parameters that need to be trained is greatly reduced, allowing LoRA to effectively train large language models with fewer computing resources.
[0056] In one embodiment of the present invention, the method of updating the parameters of the path planning model based on the LoRA method according to the calculated difference to obtain a trained path planning model includes:
[0057] Performing matrix decomposition on the weight matrix of the path planning model to decompose it into a first low-rank matrix and a second low-rank matrix;
[0058] Determine whether the calculated difference is less than the preset difference threshold:
[0059] If not, updating the weight matrix based on the first low-rank matrix and the second low-rank matrix according to the calculated difference;
[0060] If so, the trained path planning model is obtained.
[0061] The weight matrix W is subjected to low-rank decomposition to obtain two low-rank matrices, a first low-rank matrix A and a second low-rank matrix B. The decomposition must satisfy W≈A·B. Exemplarily, if the dimension of the weight matrix W is m*n, the dimension of the first low-rank matrix A is m×k, and the dimension of the second low-rank matrix B is k×n. The difference between the planned path and the actual path is calculated, and it is determined whether the calculated difference is less than the preset difference threshold. If the difference is greater than or equal to the difference threshold, the gradient of the difference relative to the low-rank matrices A and B is calculated, and the parameters of the low-rank matrices A and B are updated based on the calculated gradient using the gradient descent method, and then the weight matrix W'=A·B is recalculated based on the updated low-rank matrices A and B. On the contrary, if the difference is less than the difference threshold, it means that the path predicted by the model is close enough to the actual path, and a trained path planning model is obtained. The trained path planning model is saved for actual path planning and navigation tasks.
[0062] In one embodiment of the present invention, updating the weight matrix based on the first low-rank matrix and the second low-rank matrix according to the calculated difference comprises:
[0063] According to the calculated difference, the weight matrix is kept unchanged according to the back propagation algorithm, and the parameters of the first low-rank matrix and the second low-rank matrix are updated;
[0064] Based on the updated first low-rank matrix and the second low-rank matrix, a weight matrix is calculated and updated.
[0065] Using the back propagation algorithm, the gradient of the difference relative to the low-rank matrices A and B is calculated. For example, the gradient of the difference L relative to the low-rank matrix A is The gradient with respect to the low-rank matrix B is Using the gradient descent method, the parameters of the low-rank matrices A and B are updated according to the calculated gradients to obtain the updated low-rank matrices A' and B', as shown in Where η is the preset learning rate. Then, the weight matrix W'=A'·B' is recalculated by matrix multiplication using the updated low-rank matrices A' and B' to update the weight matrix. The updated weight matrix is used to update the parameters of the path planning model.
[0066] In one embodiment of the present invention, a path planning method is also provided, the method comprising: obtaining an indoor area map and a navigation instruction of the area to be planned; wherein the indoor area map is to use each mark point in the area as a node, and each connected mark point is connected by an edge, and the navigation instruction includes a starting mark point and an ending mark point of the area to be planned; extracting the connection relationship of each node from the indoor area map, associating the connection relationship with the corresponding node, and deleting all the edges in the indoor area map to form an indoor area variant map; inputting the indoor area variant map and the navigation instruction into the path planning model obtained by the training method of the path planning model, and generating a planned path in the area to be planned based on the connection relationship in the indoor area variant map and the starting mark point and the ending mark point of the navigation instruction. Obtain an indoor area map and a navigation instruction of the area to be planned, wherein the indoor area map uses each mark point in the area as a node, and each connected mark point is connected by an edge, and the navigation instruction includes a starting mark point and an ending mark point of the area to be planned. Extract the connection relationship of each node from the indoor area map, associate these connection relationships with the corresponding node, and delete all the edges in the indoor area map to form an indoor area variant map. Finally, the variant map of the indoor area and the navigation instruction are input into the path planning model, and the planned path in the area to be planned is generated based on the connection relationship in the variant map and the starting and ending mark points of the navigation instruction. For example, the navigation instruction is: give the shortest path from room 2e-115 to 2e-119. After the navigation instruction and the corresponding variant map of the indoor area are input into the trained path planning model, the model will output all the room numbers of the path: ['2e-115', '2e-120', '2e-121', '2e-123', '2e-116', '2e-119'].
[0067] As can be seen from Table 1 below, whether it is Chat GPT3.5 or Chat GPT 4, the second regional variant map (i.e., osmAGVariant 2) has the best effect, and the success rate at each task level (Level) is generally higher than the original map format (i.e., Oriinal osmAG) and the first regional variant map (i.e., osmAG Variant 1). And the performance of ChatGPT4 is significantly better than ChatGPT3.5, indicating that ChatGPT4 has stronger capabilities in path planning tasks. It can be seen that the use of the method described in the present invention to improve the original map format has a significant effect on improving the path planning success rate of the model.
[0068] Table 1 Effect of different osmAG variants on the path planning success rate of ChatGPT3.5 and ChatGPT4
[0069]
[0070] As can be seen from Table 2 below, when the hyperparameters are the GPU type and number, for the topological task: fine-tuning the LLaMA2-7B and LLaMA2-13B models uses NVIDIA A40 and NVIDIA A100 GPUs, both of which are 4; for the hierarchical task: fine-tuning the LLaMA2-7B and LLaMA2-13B models uses NVIDIA A40 and NVIDIA A100 GPUs, both of which are 4. When the hyperparameter is the training time, for the topological task: the training time of the LLaMA2-7B model and the LLaMA2-13B model is 5.5 hours and 6.6 hours, respectively. For the hierarchical task: the training time of the LLaMA2-7B model and the LLaMA2-13B model is 2 hours and 1.5 hours, respectively. When the hyperparameter is the number of training epochs, for topological tasks: the LLaMA2-7B and LLaMA2-13B models are both 12520 epochs. For hierarchical tasks: the LLaMA2-7B and LLaMA2-13B models are both 1056 epochs. When the hyperparameter is the size of training dataset, for topological tasks: the LLaMA2-7B and LLaMA2-13B models are both 12520. For hierarchical tasks: the LLaMA2-7B and LLaMA2-13B models are both 1056. When the hyperparameter is the size of adapter, for topological tasks: the LLaMA2-7B and LLaMA2-13B models are 16.8MB and 26.2MB respectively. For hierarchical tasks: the LLaMA2-7B and LLaMA2-13B models are 16.8MB and 26.2MB respectively. It can be seen that the LLaMA2-13B model performs better than the LLaMA2-7B model on the NVIDIA A100 GPU, and has advantages in training time, dataset size, and adapter size. Therefore, this implementation uses LLaMA2-13B as the final path planning model.
[0071] Table 2 Hyperparameters used in model tuning
[0072]
[0073]
[0074] In the following Table 3, T is a topological task, H is a hierarchical task, and G is a general task. As can be seen from Table 3, if not fine-tuned, the success rates of LLaMA2-7B and LLaMA2-13B are low, especially in the topological task (T), the success rate of LLaMA2-7B ranges from 0.05 to 0.11, and the success rate of LLaMA2-13B ranges from 0.066 to 0.14, indicating that it is difficult to effectively handle complex path planning problems in its original state. After fine-tuning using the method described in the present invention, the success rate of the LLaMA2-7B and LLaMA2-13B models is significantly improved, especially in the case of prompts, the success rate is close to 1.0, which is close to the open source model ChatGPT 4, and significantly better than ChatGPT 3.5, indicating that through fine-tuning, the model can better understand and handle the complex relationships and structures in the task.
[0075] Table 3 Comparison of the success rate of the large language model before and after tuning in topological analysis and hierarchical analysis problems
[0076]
[0077] See also Figure 4 , Figure 4 It is a fragment of a traditional osmAG map file. As can be seen from the figure, the marked point (i.e., node) is represented by a "way" tag, and each "way" tag contains multiple "tag" tags to describe the attributes of the marked point. For example, for node 1, "way id="-134156" represents the unique identifier of the node, "tag k="name"v="1d-204" represents the name of the node is "1d-204", "tag k="osmAG:areaType"v="room" represents the area type of the node is "room", and "tag k="osmAG:type"v="area" represents the type of the node is "area". The description of other nodes is the same as that of node 1, and will not be described in detail here. The connection between nodes is stored in the edge information. "way id="-134199" indicates the unique identifier of the connection relationship. "tag k="from" v="1d-204" indicates that the starting point of the connection is "1d-204". "tag k="osmAG:type" v="passage"" indicates that the type of the connection relationship is "passage". "tag k="to" v="1d-202"" indicates that the end point of the connection is "1d-202". Therefore, Figure 4 Shown are two rooms (1d-204 and 1d-202) and their connection (the passage from 1d-204 to 1d-202).
[0078] The indoor area variation graph of the present invention comprises a first indoor area variation graph and a second indoor area variation graph. Figure 5 This is a fragment of the first indoor area variant map. It can be seen from the figure that it is different from Figure 4 Using independent "way" tags to define the connection relationship, the first indoor area variant graph stores the connection relationship directly inside the node, using multiple "connected_area" tags to represent it. For example, the node "1d-202" contains the connection relationships "1d-204", "1d-203", and "1d-207" with other nodes. By storing the connection relationship directly inside the corresponding node, the large language model can more easily and intuitively extract the connection relationship of each node.
[0079] Figure 6 This is a fragment of the second indoor area variant graph. In the second indoor area variant graph, the "directly_connected_room" label is used to directly point out the connection relationship between the rooms, so that the large language model can more easily understand the connection relationship between the nodes and improve the recognition accuracy.
[0080] See also Figure 7 , this embodiment uses LLaMA2-7B and LLaMA2-13B models as path planning models. For topological tasks: the loss values of LLaMA2-7B and LLaMA2-13B models decrease rapidly in the first training round (Epoch). As the number of training rounds increases, the loss value decreases to close to 0.5 and then gradually stabilizes. For hierarchical tasks: the loss values of LLaMA2-7B and LLaMA2-13B models decrease rapidly in the first Epoch. As the number of training rounds increases, the loss value decreases to about 1 and then tends to be flat, and finally stabilizes at about 0.5. It can be seen that, whether it is a hierarchical task or a topological task, the path planning model trained using the method of the present invention has a rapidly decreasing loss value within the first few training rounds, which indicates that the model can quickly learn effective features. The final loss value is low, indicating that the tuned model can be applied to map-based intelligent path planning tasks, and efficient and accurate path planning can be achieved through the understanding of the hierarchical structure and topological structure.
[0081] See also Figure 8, the training system 100 of the path planning model includes: a data acquisition module 110, a variant generation module 120, a planned path generation module 130 and a parameter update module 140. The data acquisition module 110 is used to obtain a real path set, a corresponding navigation instruction set and an indoor area map set; wherein each area map of the indoor area map set uses each mark point in the area as a node, and uses edges to connect each connected mark point, and the navigation instruction set includes the starting mark point and the ending mark point of the real path set. The variant generation module 120 is used to extract the connection relationship of each node from the indoor area map set, associate the connection relationship with the corresponding node, and delete all the edges in the indoor area map set to form an indoor area variant map set. The planned path generation module 130 is used to input the indoor area variant map set and the navigation instruction set into the path planning model, and generate a planned path set based on the connection relationship in the indoor area variant map set and the starting mark point and the ending mark point of the navigation instruction set. The parameter updating module 140 is used to update the parameters of the path planning model according to the difference between the planned path set and the real path set to obtain a trained path planning model; wherein the path planning model is a large language model.
[0082] For the specific definition of the training system of the path planning model, please refer to the definition of the training method of the path planning model above, which will not be repeated here. Each module in the above-mentioned training system of the path planning model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware format, or can be stored in the memory of the computer device in software format, so that the processor can call the operations corresponding to the above modules.
[0083] It should be noted that, in order to highlight the innovative part of the present invention, the present embodiment does not introduce modules that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other modules in the present embodiment.
[0084] The present invention also provides a robot, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the training method of the path planning model described in any one of the above items or the path planning method described in the above items.
[0085] See also Fig. 9 , Fig. 9 The hardware structure of the robot is shown in the figure. The robot includes:
[0086] The memory 12 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 12 may be an internal storage unit of the electronic device 1, such as a mobile hard disk of the robot. In other embodiments, the memory 12 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the robot. Further, the memory 12 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the robot, such as the training code of the path planning model, but also be used to temporarily store data that has been output or is to be output.
[0087] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the robot, and uses various interfaces and lines to connect various components of the entire robot, and executes or executes programs or modules (such as training programs of path planning models, etc.) stored in the memory 12, and calls data stored in the memory 12 to execute various functions of the robot and process data.
[0088] The processor 13 executes the operating system of the robot and various installed applications. The processor 13 executes the applications to implement the steps in the training method of the path planning model.
[0089] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the robot. For example, the computer program may be divided into a data acquisition module 110, a variant generation module 120, a planning path generation module 130, and a parameter update module 140.
[0090] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the computer-readable storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the training method of the path planning model described in each embodiment of the present application.
[0091] In summary, the training method, system, device and medium of a path planning model disclosed in the present invention extract the connection relationship of each node from the indoor area graph set, and associate these connection relationships with the corresponding nodes, thereby retaining the important information between the nodes. After deleting all edges, a set of indoor area variant graphs is formed, which simplifies the graph structure and is easier to process and understand the model. And the marking point is a fixed object, so it will not be dynamically updated, which solves the problem that there are a large number of dynamic objects in the grid map occupied in the existing method, so the map needs to be updated regularly, and reliable navigation throughout the life cycle cannot be achieved. By inputting the indoor area variant graph set and the navigation instruction set into the path planning model. The model generates a set of planned paths based on the connection relationship in the variant graph and the start and end marking points of the navigation instruction, ensuring that the path planning model can accurately understand and process the complex connection relationship in the indoor environment. The present invention extracts and associates the connection relationship between nodes through structured processing of the indoor area graph, uses a large language model to perform path planning training, and continuously optimizes the model parameters through difference feedback, thereby achieving efficient and accurate path planning. Therefore, the present invention effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.
[0092] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A training method for a path planning model, characterized in that: The training method comprises: Acquire a real path set, a corresponding navigation instruction set and an indoor area map set; wherein each area map of the indoor area map set uses each marked point in the area as a node and uses edges to connect each connected marked point, and the navigation instruction set includes a starting marked point and an ending marked point of the real path set; Extracting connection relationships of various nodes from the indoor area graph set, associating the connection relationships with corresponding nodes, and deleting all edges in the indoor area graph set to form an indoor area variant graph set; Inputting the indoor area variant graph set and the navigation instruction set into a path planning model, and generating a planned path set based on the connection relationship in the indoor area variant graph set and the starting mark point and the ending mark point of the navigation instruction set; According to the difference between the planned path set and the real path set, the parameters of the path planning model are updated to obtain a trained path planning model; wherein the path planning model is a large language model.
2. The training method of the path planning model according to claim 1, characterized in that: The step of extracting the connection relationship of each node from the indoor area graph set, associating the connection relationship with the corresponding node, and deleting all edges in the indoor area graph set to form an indoor area variant graph set includes: Extracting all nodes and edges connected to the nodes from the indoor area graph set; For each extracted node: find the edge connected to the current node, determine other nodes directly connected to the current node and generate connection relationships, and store the connection relationships inside the current node; All edges are deleted from the indoor area graph set to form an indoor area variant graph set.
3. The training method of the path planning model according to claim 1, characterized in that: The indoor area map set is obtained by data augmentation from the initial indoor area map set, and the process of obtaining the indoor area map set according to the initial indoor area map set is: Get the initial indoor area map set; Randomly transform each marking point in the initial indoor area map set to generate new marking points; The original marking points are updated with new marking points, and the original connection relationship of each marking point is kept unchanged to obtain a set of indoor area maps.
4. The training method of the path planning model according to claim 1, characterized in that: The updating of the parameters of the path planning model according to the difference between the planned path set and the real path set to obtain a trained path planning model includes: Calculating the difference between the planned path set and the real path set; According to the calculated difference, the parameters of the path planning model are updated based on the LoRA method to obtain a trained path planning model.
5. The training method of the path planning model according to claim 4, characterized in that: The method of updating the parameters of the path planning model based on the LoRA method according to the calculated difference to obtain a trained path planning model includes: Performing matrix decomposition on the weight matrix of the path planning model to decompose it into a first low-rank matrix and a second low-rank matrix; Determine whether the calculated difference is less than the preset difference threshold: If not, updating the weight matrix based on the first low-rank matrix and the second low-rank matrix according to the calculated difference; If so, the trained path planning model is obtained.
6. The training method of the path planning model according to claim 5, characterized in that: The updating of the weight matrix based on the first low-rank matrix and the second low-rank matrix according to the calculated difference comprises: According to the calculated difference, the weight matrix is kept unchanged according to the back propagation algorithm, and the parameters of the first low-rank matrix and the second low-rank matrix are updated; Based on the updated first low-rank matrix and the second low-rank matrix, a weight matrix is calculated and updated.
7. A path planning method, characterized in that: The method comprises: Obtain an indoor area map and navigation instructions of the area to be planned; wherein the indoor area map uses each mark point in the area as a node and connects each connected mark point with an edge, and the navigation instructions include a starting mark point and an ending mark point of the area to be planned; Extracting connection relationships of various nodes from the indoor area graph, associating the connection relationships with corresponding nodes, and deleting all edges in the indoor area graph to form an indoor area variant graph; The indoor area variant graph and the navigation instruction are input into the path planning model obtained by the training method of the path planning model according to any one of claims 1 to 6, and a planned path within the area to be planned is generated based on the connection relationship in the indoor area variant graph and the starting mark point and the ending mark point of the navigation instruction.
8. A training system for a path planning model, characterized in that: The system comprises: A data acquisition module, used to acquire a real path set, a corresponding navigation instruction set and an indoor area map set; wherein each area map of the indoor area map set uses each mark point in the area as a node and uses edges to connect each connected mark point, and the navigation instruction set includes a starting mark point and an ending mark point of the real path set; A variant generation module, used for extracting the connection relationship of each node from the indoor area graph set, associating the connection relationship with the corresponding node, and deleting all edges in the indoor area graph set to form an indoor area variant graph set; A planning path generation module, used for inputting the indoor area variant graph set and the navigation instruction set into a path planning model, and generating a planning path set based on the connection relationship in the indoor area variant graph set and the starting mark point and the ending mark point of the navigation instruction set; A parameter updating module is used to update the parameters of the path planning model according to the difference between the planned path set and the real path set to obtain a trained path planning model; wherein the path planning model is a large language model.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the training method of the path planning model described in any one of claims 1 to 6 or the path planning method described in claim 7.
10. A robot, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the training method of the path planning model as described in any one of claims 1 to 6 or the path planning method as described in claim 7 is implemented.
Citation Information
Cited By
Machine tool interpolation tool changing method and device and computer readable storage medium
CN119566918A
Machine tool interpolation tool changing method and device, computer readable storage medium
CN119566918B
