A path planning cross-domain migration method and device based on knowledge distillation

By pre-training teacher models in different source domains and using knowledge distillation techniques to guide the training of temporary models, combined with teacher-student matching strategies and gradient updates, the performance degradation and high computational cost of domain adaptation methods in different domains are solved, achieving efficient cross-domain transfer in low-resource environments.

CN120975185BActive Publication Date: 2026-02-06BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511500749.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-02-06
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Existing domain-adaptive methods struggle to maintain high performance and incur high computational costs when facing different domains, especially in resource-constrained application scenarios where model inference time is long and network model parameters are too large, leading to deployment difficulties.

Method used

A cross-domain transfer learning method based on knowledge distillation is adopted. By pre-training source teacher models on data distributions in different source domains, knowledge distillation technology is used to guide the training of temporary models. Combined with teacher-student matching strategies and gradient updates, the number of network model parameters is reduced and the generalization performance is improved.

Benefits of technology

It enables cross-domain migration with low computing resources, improves the generalization performance and robustness of the model, and is applicable to a variety of practical problems, especially in the path planning scenario of hotel service robots, reducing the consumption of computing resources and the difficulty of hardware deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120975185B_ABST
    Figure CN120975185B_ABST
Patent Text Reader

Abstract

The present disclosure provides a kind of path planning cross-domain migration method and device based on knowledge distillation, belong to the field adaptive technology field of path planning.The present application pretrains corresponding source teacher model on different source field data distribution respectively;Determine the target data distribution of multiple different tasks, allocate a temporary model to each task;When training student model, based on the similarity of source field data distribution and target data distribution, determine more than one source teacher model matched to each temporary model;Based on knowledge distillation technology, the training direction of temporary model is guided using all matched source teacher models, and the iterative training of temporary model is completed;Student model parameter gradient is determined based on all temporary model parameter gradients, and student model parameter is updated by gradient;The path planning task under different fields is executed using the trained student model.The present application can realize cross-domain migration under low computing resource.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of path planning and specifically to a path planning cross-domain migration method and device based on knowledge distillation. BACKGROUND

[0002] Domain adaptation methods play an important role in the field of artificial intelligence. They help computer systems adjust and optimize models to adapt to the characteristics of the target domain when facing different but related domains, so as to maintain high performance in the case of inconsistent data distribution between the target domain and the source domain. In addition, domain adaptation methods can effectively transfer the knowledge of the source domain to the target domain while considering the unique characteristics of the target domain, thereby providing more accurate and robust decision-making solutions and helping computers extract valuable key information from cross-domain complex data to achieve intelligent data analysis and decision support tasks. Domain adaptation methods have a wide range of applications in many practical problems, including hotel robot path planning and warehouse scheduling.

[0003] For some complex decision-making tasks, inconsistencies between domains often make it difficult for network models to adapt to the data distribution of the target, resulting in a decline in the performance of network models on the target. When facing complex decision-making tasks under different domain distributions, the computational cost of retraining network models is also very high. The performance degradation and cost increase caused by this domain shift pose high requirements on the generalization performance of network models. At the same time, for some real-time applications with limited computing resources, the large number of network model parameters can lead to long model inference time and difficulty in deploying local hardware. Therefore, how to reduce the number of network model parameters while ensuring the generalization performance of the model is an important problem in the field of domain adaptation.

[0004] There are many academic studies on domain adaptation methods, such as using feature mapping, multi-task learning, and domain alignment techniques to apply source domain models to target models, so this technology covers the development of multiple fields and can be applied to many different practical application scenarios. However, the above methods have limited improvement in model generalization ability and ignore the possibility of limited hardware resources in practical applications. SUMMARY

[0005] Therefore, the present application provides a path planning cross-domain migration method and device based on knowledge distillation, which can effectively reduce the number of network model parameters while improving the generalization performance of the network model, and ultimately achieve cross-domain migration under low computing resources.

[0006] To solve the above technical problems, the present application is implemented as follows.

[0007] A path planning cross-domain migration method based on knowledge distillation, comprising:

[0008] Step 1: For the path planning task scene, pre-train corresponding source teacher models on different source domain data distributions; determine the target data distribution of multiple different tasks, and assign a temporary model to each task;

[0009] Step 2: Initialize the parameters of each temporary model to the parameters of the current student model;

[0010] Step 3: Based on the similarity of the source domain data distribution and the target data distribution, determine more than one source teacher model matched with each temporary model;

[0011] Step 4: Temporary model training: based on the target data distribution, construct a first example, input the temporary model to be trained and the matched source teacher model; based on the knowledge distillation technology, use all matched source teacher models to guide the training direction of the temporary model, and complete the iterative training of the temporary model;

[0012] Step 5: Student model training: based on the target data distribution, construct a second example, input the trained temporary model and the matched source teacher model; based on the parameter gradient of all temporary models, determine the parameter gradient of the student model, and update the parameter of the student model by gradient;

[0013] Step 6: Repeat steps 2 to 5 to obtain the final student model through iterative training; use the final student model to perform path planning tasks in different domains to achieve cross-domain migration.

[0014] Preferably, in the temporary model training step, each iteration, the temporary model to be trained and the matched source teacher model input the training set example under the corresponding target data distribution; calculate the loss function value of the temporary model according to the output of the temporary model and all source teacher models, and calculate the gradient according to the loss function value; take the mean of the gradients of all examples in the training set as the update gradient of the current iteration, and update the parameter of the temporary model to be trained by gradient descent.

[0015] Preferably, in the student model training step, the gradient update of the student model parameter based on the parameter gradient of all temporary models is:

[0016] Input the verification set example under the target data distribution to a temporary model and its matched source teacher model, calculate the loss function value of the temporary model according to the output of the temporary model and all source teacher models, calculate the first gradient of the temporary model parameter according to the loss function value, take the partial derivative of the first gradient to the student model parameter to obtain the second gradient; take the mean of the second gradients corresponding to all examples in the verification set as the target data distribution corresponding student model parameter gradient;

[0017] Let the total gradient of the student model parameters be the weighted sum of the student model gradients under each target data distribution;

[0018] Based on the total gradient of the student model parameters, the student model parameters are updated by gradient descent.

[0019] Preferably, in the temporary model training and student model training, the loss function of the temporary model includes a distillation loss term; the distillation loss term is the weighted sum of the distillation loss between the temporary model and each matched source teacher model.

[0020] Preferably, the distillation loss term is constructed in the following manner:

[0021] Let the temporary model match source teacher models;

[0022] target data distribution , calculate the output data KL divergence between the temporary model and the matched source teacher model , denoted as ; , the value is 1 ; the upper subscripts and are used to distinguish the temporary model and the source teacher model;

[0023] The distillation loss term is ; wherein, is the similarity between the source domain data distribution corresponding to the j th source teacher model and the target data distribution corresponding to the temporary model.

[0024] Preferably, the loss function of the temporary model further includes a task loss term; the task loss term and the distillation loss term are weighted.

[0025] Preferably, the similarity between the source domain data distribution and the target data distribution is determined in the following manner:

[0026] Calculate the Wasserstein distance between the source domain data distribution and the target data distribution, perform negative exponential mapping and normalization processing on the Wasserstein distance to obtain a numerical expression of the similarity; the higher the similarity, the larger the value.

[0027] Preferably, the negative exponential mapping is a nonlinear transformation of the Wasserstein distance;

[0028] The nonlinear transformation is:

[0029]

[0030] wherein, represents a numerical representation of similarity obtained after a nonlinear transformation, represents a Wasserstein distance before a nonlinear transformation, is a temperature parameter for controlling the diversity of the model matching between the teacher and the student.

[0031] Preferably, the determining of the one or more source teacher models matched with each temporary model comprises:

[0032] arranging the similarity values of all source teacher models from large to small, and selecting the source teacher model with the largest similarity value each time to join the matching set until the sum of the similarity values of all source teacher models in the matching set is greater than a set threshold , or the number of source teacher models in the matching set reaches a set number.

[0033] The application also provides a path planning cross-domain migration device based on knowledge distillation, comprising D source teacher models, F temporary models, one student model, a teacher pre-training module, and an iterative training module.

[0034] Each source teacher model corresponds to a source domain data distribution; target data distributions of F different tasks are determined, and each task is assigned a temporary model;

[0035] The teacher pre-training module pre-trains the source teacher models on different D source domain data distributions;

[0036] The iterative training module obtains the final student model through iterative training; the iterative training module comprises an initialization module, a matching module, a temporary model training module, and a student model training module.

[0037] The initialization module initializes the parameters of each temporary model as the current student model parameters in each iteration training;

[0038] The matching module determines one or more source teacher models matched with each temporary model based on the similarity between the source domain data distribution and the target data distribution;

[0039] The temporary model training module uses all the matched source teacher models to guide the training direction of the temporary model based on the knowledge distillation technology, and completes the iterative training of the temporary model;

[0040] The student model training module determines the student model parameter gradient based on the parameter gradient of all temporary models, and performs gradient update on the student model parameters;

[0041] The final student model performs path planning tasks in different domains to realize cross-domain migration.

[0042] Advantages:

[0043] (1) The application provides a path planning cross-domain migration method based on knowledge distillation. Compared with the form of direct guidance of teachers to student training in existing knowledge distillation methods, the application creates multiple temporary models for synchronous training under different domains, and collects gradient information for the training of student models. The method proposed by the application has higher generalization performance and stronger robustness, and can be widely applied to various practical problems, such as intelligent services, intelligent manufacturing, intelligent logistics and the like. Taking the application to the hotel service robot path planning scene as an example, the application can be quickly applied to different hotel map environments.

[0044] (2) The application provides a path planning cross-domain migration method based on knowledge distillation. Compared with the form of fixed teacher-student matching relationship in existing knowledge distillation methods, the application proposes a teacher-student matching strategy. Based on similarity analysis between teachers and students and combined with the adaptive matching strategy, the most suitable source teacher model can be matched for the training guidance of each temporary model, thereby improving the automation degree and performance effect of the algorithm.

[0045] (3) The application provides a path planning cross-domain migration method based on knowledge distillation. Compared with the form of direct training of student models in existing knowledge distillation methods, the application calculates the gradient of the student model based on the model gradient of all temporary models under different domains. The method proposed by the application can help the student to find a training direction that takes into account the performance of multiple domains, thereby obtaining a network model with higher generalization performance.

[0046] (4) The application provides a path planning cross-domain migration method based on knowledge distillation. Through the mode of simultaneous training in multiple preset domains, the generalization ability of the model is effectively improved by combining the teacher-student matching strategy, so that the network model does not need to be trained from scratch when facing different domain scenarios, and a large amount of computing resource consumption is saved. Taking the application to the hotel service robot path planning scene as an example, the application makes it more intelligent and more convenient for hotel managers to deploy hotel service robots.

[0047] (5) The application provides a path planning cross-domain migration method based on knowledge distillation. By introducing the technology of knowledge distillation in the training process, the relevant domain knowledge can be learned from the pre-trained source teacher model, the decision quality of the network model is effectively improved, and the parameter amount of the network model is reduced. Taking the application to the hotel service robot path planning scene as an example, the hotel service robot can be successfully deployed under the condition that the hardware resources of the hotel service robot are limited, and the service effect is guaranteed.

[0048] (6) The application provides a path planning cross-domain migration method based on knowledge distillation, which is applicable to various network model structures and effectively improves the universality of the method by improving the network model training process. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 A component relationship diagram of the path planning cross-domain migration method based on knowledge distillation in the embodiment of the application.

[0050] Figure 2 A flowchart of the path planning cross-domain migration method based on knowledge distillation in the embodiment of the application.

[0051] Figure 3 A teacher-student matching diagram of the path planning cross-domain migration method based on knowledge distillation in the embodiment of the application.

[0052] Figure 4 A structural diagram of the path planning cross-domain migration device based on knowledge distillation in the embodiment of the application. DETAILED DESCRIPTION

[0053] The application will be described in detail below with reference to the accompanying drawings and embodiments.

[0054] The application provides a path planning cross-domain migration method based on knowledge distillation, which can improve the generalization performance of the network model while effectively reducing the parameter quantity of the network model, and finally realize cross-domain migration that can be deployed under low computing resources.

[0055] The basic idea of the method is as follows: for the path planning task scene, corresponding source teacher models are pre-trained on different source domain data distributions. A plurality of target data distributions of different tasks are determined, and each task is allocated a temporary model; the parameters of each temporary model are initialized as the parameters of the student model. Based on the similarity between the source domain data distribution and the target data distribution, one or more source teacher models matched with each temporary model are determined. Based on the knowledge distillation technology, all the matched source teacher models are used to guide the training direction of the temporary model, and the iterative training of the temporary model is completed. Based on the parameter gradient of all the temporary models, the parameter gradient of the student model is determined, and the parameter of the student model is updated. After the iterative training meets the termination condition, the final student model is obtained. The trained student model is used to perform path planning tasks in different domains, and cross-domain migration is realized.

[0056] Figure 1The component relationship diagram of the present application is shown, which includes three models: a source teacher model, a temporary model and a student model. The source teacher model is larger in parameter scale than the student model. The source teacher model is pre-trained with source domain knowledge and is responsible for indirectly guiding the training direction of the student model during training. The student model is the final output network model, and because it has a smaller parameter scale, it has lower computational cost during inference.

[0057] Taking the hotel service robot path planning scene as an implementation example, the goal of this scene is to make reasonable delivery routes for hotel robots, minimize the delivery time of hotel robots to improve customer satisfaction, as shown in Figure 2 The method is implemented by the following steps:

[0058] Step one, source teacher model pre-training.

[0059] For a specified problem scene, a different source data distribution is preset, and a source teacher model is pre-trained for each source data distribution , wherein . is the set of source data distributions, and D is the number of elements in the set.

[0060] For example, in the hotel service robot path planning scene, the data distribution refers to the distribution of order demand points in the hotel, and the maps of different hotels are also different, so the difference in data distribution will cause the problem of domain bias for the network model. In addition, the pre-trained source teacher model is used to jointly guide the training direction of the student model after teacher-student matching, helping the convergence of training and improving performance. The specific network structure of the source teacher model can be freely designed by the user, and is irrelevant to the proposed method, which embodies the universality of the method.

[0061] Step two, student model initialization and task allocation.

[0062] The network parameters of the student model are initialized to , and tasks under the target training distribution are initialized, and a temporary model is allocated for each task, wherein , is the set of target data distributions, and F is the number of elements in the set.

[0063] The following steps three to eight are an iteration process:

[0064] Step three, temporary model initialization.

[0065] At the beginning of a new iteration process, the network parameters of each temporary model are initialized as the network parameters of the current student model, i.e. .

[0066] For example, in the hotel service robot path planning scenario, the student model, i.e., the network model finally to be obtained, is used for final deployment on the robot, which has smaller network parameters and higher generalization performance. The temporary models on different target data distributions are responsible for collecting gradient information for the update of the student model, guiding the update direction of the student model.

[0067] Step four, field similarity calculation and teacher-student matching.

[0068] This step is based on the similarity between the source domain data distribution and the target data distribution to determine more than one source teacher model matched for each temporary model, as shown in Figure 3 .

[0069] Here, the similarity estimation method can use the similarity estimation based on the Wasserstein distance. Specifically, the similarity index between each source domain data distribution and the target data distribution is calculated based on the distribution estimation method , where and The similarity index is calculated using the Wasserstein distance:

[0070]

[0071] wherein represents the Wasserstein distance.

[0072] For example, in the hotel service robot path planning scenario, the distributions and represent the position coordinate distributions of demand points. Specifically, the position coordinates of the distribution and the distribution can be represented as and , wherein and represent the horizontal and vertical coordinates, respectively. The Wasserstein distance is calculated for the horizontal coordinate and the vertical coordinate , and the sum of the two is taken as the final similarity index . Then, negative exponential mapping and normalization processing are performed.

[0073] The similarity index After the calculation, the negative exponential mapping and normalization processing are performed to obtain the numerical expression of similarity. The higher the similarity is, the larger the value is, so that it can reflect the change relationship between similarity and weight. Based on the final normalized score obtained, the teacher-student model is matched.

[0074] The negative exponential mapping in this step can adopt a nonlinear transformation to the similarity . Assuming that the current target data distribution has been determined as , the similarity corresponding to each source data distribution can be denoted as , , and the specific calculation formula of the nonlinear transformation is as follows:

[0075] (1)

[0076] wherein represents the similarity after the nonlinear transformation, is a temperature parameter for controlling the diversity of teacher-student matching, and the greater the similarity after the transformation is, the higher the similarity weight is.

[0077] The normalization in this step refers to the normalization calculation of the similarity of all candidate source teacher models of the current target data distribution, and the calculation formula is as follows:

[0078] (2)

[0079] wherein , that is, the similarity after the normalization. For the same target data distribution, the similarity weight sum of all source teachers is 1, and the value size means the matching weight between them.

[0080] The teacher-student matching process in step four consists of three parts: temperature adjustment, threshold truncation, and Top-k selection. The temperature adjustment refers to the setting of the temperature parameter of formula (1). The greater the temperature parameter is, the smaller the difference of the weight distribution of each candidate source teacher is, and the smaller the temperature parameter is, the greater the difference is. Therefore, by adjusting the temperature parameter , the diversity of teacher-student matching can be controlled. The threshold truncation refers to arranging all source teacher models from large to small according to the similarity. Each time, the source teacher model with the greatest similarity is selected to join the matching set until the sum of the similarity of all models in the matching set is greater than the threshold . The Top-k selection refers to retaining only The source teacher model with the largest similarity weight is selected, and if there are less than k source teacher models in the matching set, the step is skipped. In practice, threshold truncation can be completed first, and then Top-k selection can be performed. Threshold truncation can also be performed at the same time as determining whether the number of source teacher models in the matching set meets the k defined by Top-k.

[0081] Step five, temporary model loss function calculation.

[0082] Each temporary model corresponds to a target data distribution and a number of matching teacher models . According to the given target data distribution , an example under the corresponding distribution is generated as input to the temporary model , and its output is represented as , where is the output probability distribution of the temporary model.

[0083] The loss function of the temporary model in this embodiment is the sum of the task loss term and the distillation loss term. In practice, other loss terms can also be included.

[0084] For the task loss term, the task loss of the temporary model under the target data distribution is represented as:

[0085] (3)

[0086] where represents the loss of the output of the temporary model under the corresponding task when the example is input, and the specific calculation method of this loss is obtained according to the actual application scenario. represents the mathematical expectation.

[0087] The task loss varies according to the different application tasks. For example, for a hotel robot path planning, the time taken by the robot to complete the task can be used as the loss; for warehouse scheduling, the collision rate between robots can be used as the loss.

[0088] For the distillation loss term, since each temporary model can match J source teacher models, the distillation loss term is the weighted sum of the distillation loss between the current temporary model and each matching teacher model , where and , is the set of matching source teacher models, The number of models is J. The target data distribution The temporary model The first teacher model The distillation loss between the temporary model and the first teacher model is represented by the KL divergence of the data distribution, which is:

[0089] (4)

[0090] wherein, denotes the batch size in the training process, denotes the output of the temporary model , denotes the output probability of the first source teacher model when the example at the first time step is inputted; denotes the output probability of the temporary model when the example at the first time step is inputted. Therefore, for the target data distribution , the loss function of the temporary model training can be represented as: (5)

[0091] wherein, is a weight coefficient for adjusting the balance between the task loss and the distillation loss,

[0092] is the similarity between the source domain data distribution corresponding to the first source teacher model and the target data distribution corresponding to the temporary model. The calculation scheme of is used. j For example, in the hotel service robot path planning scenario, the example represents the demand point distribution generated by random sampling from a given data distribution, which is input information of the network model. The task loss refers to the task completion time of the service robot, and the longer the task completion time, the greater the task loss; the distillation loss refers to the KL divergence value between the teacher model strategy and the action probability distribution of the temporary model strategy, which is used to measure the similarity of the strategy trajectory. Specifically, for the action of the network model at the first

[0093] time step, represents the motion vector of the hotel robot, i.e., the motion direction and motion speed information. Step six, temporary model updating.

[0094] Step six, temporary model updating.

[0095] The temporary model loss function calculated in step five is used to train and optimize the temporary model. Gradient descent training is used to repeatedly train the temporary model for K iterations, and the gradient of the obtained temporary model loss function is calculated.

[0096] For the training set examples (first example) under the target data distribution , the input temporary model and the matching source teacher model are input into the temporary model and the matching source teacher model, and the temporary model and the source teacher model each output data. The loss function value of formula (5) is calculated based on the two model output data, and the gradient is calculated according to the loss function value. The average of the gradients corresponding to all examples of the training set is used as the update gradient of the current iteration, and the gradient descent update is performed on the parameters of the temporary model to be trained.

[0097] The update gradient of the first iteration is represented by formula as follows, :

[0098] (6)

[0099] wherein, represents one of the training set examples under the target data distribution , and there are N examples in the training set, . represents the loss function value calculated under the condition that the input is . represents the gradient calculated according to the loss function value. The average of the gradients corresponding to all N examples in the training set is calculated as the update gradient of the current iteration, that is, .

[0100] After the gradient is obtained, the gradient descent update is performed on the corresponding temporary model, and the update formula is as follows:

[0101] (7)

[0102] wherein, represents the learning rate, which is used to control the amplitude of the gradient descent. Since the temporary model needs to be trained for K iterations, steps five and six need to be repeated times.

[0103] After each temporary model completes K iteration updates, the training of the temporary model is completed.

[0104] Step seven, student model gradient calculation.

[0105] After steps five and six complete iteration training, each target data distribution The corresponding temporary model network parameter update is At this time, the validation set example (second example) is constructed based on the target data distribution, the trained temporary model and the matched source teacher model are input; the temporary model loss function value is calculated based on the output of the temporary model and the source teacher model, and then the temporary model parameter gradient is calculated. The student model parameter gradient is determined based on all temporary model parameter gradients, and the student model parameter is updated by gradient.

[0106] Specifically, the target data distribution The gradient calculation of the student model is as follows:

[0107] (8)

[0108] Wherein, represents the validation set example under the target data distribution , the validation set includes examples, . The formula indicates that: first, the temporary model loss function value under the input is calculated , the first gradient of the temporary model parameter is calculated based on the loss ; the first gradient is taken as the partial derivative of the student model parameter , and the second gradient is obtained; The second gradient of example is averaged as the corresponding student model parameter gradient under the target data distribution .

[0109] Therefore, let the total gradient of the student model parameter be the weighted sum of the student model gradient under each target data distribution, which is represented as follows:

[0110] (9)

[0111] Wherein, is the weight of the gradient corresponding to the target data distribution , which can control the optimization direction of the student model through the weight.

[0112] For example, in the hotel service robot path planning scene, the validation set represents a set of demand point distributions randomly generated from a given data distribution, which is used to verify the performance of the network model, and it satisfies the independent and identically distributed relationship with the examples in the training set.

[0113] Step eight, student model parameter update.

[0114] The gradient For one-time training optimization of the student model, a gradient descent training method is adopted, and the parameter update formula is as follows:

[0115] (10)

[0116] wherein, is a learning rate in the student model parameter training process, used to control the amplitude of gradient descent.

[0117] Step nine, judge whether the termination condition is met. If the termination condition is met, save all parameters of the current student model as the final model parameters, otherwise return to step three for the next iteration.

[0118] Step ten, use the trained student model to perform path planning tasks in different fields to realize cross-field migration.

[0119] In this step, the student model can be applied to perform tasks based on the zero-shot learning or few-shot learning paradigm. Zero-shot learning means directly deploying and verifying the student model without additional fine-tuning and training; few-shot learning means fine-tuning the student model with a few rounds and a small amount of data under the target data distribution, so that the student model can adapt to the target data distribution, thereby improving the corresponding performance.

[0120] For a specified problem scenario, given any data distribution , the zero-shot learning or few-shot learning paradigm can be selected to deploy the strategy. For example, in the hotel service robot path planning scenario, the student model is the final network model deployed in the hotel robot hardware, which has better generalization performance and smaller parameter amount, and can be conveniently deployed to the end side and applied to different demand distributions.

[0121] To achieve the above scheme, the application further provides a path planning cross-field migration method and device based on knowledge distillation, as shown in Figure 4 The device comprises D source teacher models, F temporary models, a student model, a teacher pre-training module and an iterative training module.

[0122] Each source teacher model corresponds to a source field data distribution; the target data distribution of F different tasks is determined, and each task is allocated a temporary model.

[0123] The teacher pre-training module is used to pre-train the corresponding source teacher model on different D source field data distributions for the path planning task scenario.

[0124] The iterative training module obtains the final student model through iterative training. The iterative training module specifically comprises an initialization module, a matching module, a temporary model training module and a student model training module.​

[0125] An initialization module initializes parameters of each temporary model as current student model parameters at each iteration of training.

[0126] A matching module determines more than one source teacher model matched with each temporary model based on similarity of source domain data distribution and target data distribution.

[0127] A temporary model training module is configured to construct a first example based on the target data distribution, input the temporary model to be trained and the matched source teacher model, guide the training direction of the temporary model by using all the matched source teacher models based on the knowledge distillation technology, and complete the iteration training of the temporary model.

[0128] A student model training module is configured to construct a second example based on the target data distribution, input the trained temporary model and the matched source teacher model, determine the student model parameter gradient based on all the temporary model parameter gradients, and perform gradient update on the student model parameters.

[0129] The trained student model performs path planning tasks in different fields to realize cross-field migration.

[0130] The matching module corresponds to step four above, and a similarity estimation method based on Wasserstein distance is adopted. The similarity value is obtained by negative exponential mapping and normalization processing of the Wasserstein distance. When the teacher-student matching is performed based on the similarity value, the source teacher model set corresponding to the temporary model is obtained by combining threshold truncation and Top-k selection.

[0131] The temporary model training module corresponds to steps five and six above, and the loss function calculation and gradient-based training optimization are the same as steps five and six, which are not described here.

[0132] The student model training module corresponds to steps seven and eight above, and the student model gradient calculation and parameter update are the same as steps seven and eight, which are not described here.

[0133] In order to further illustrate the effectiveness of the provided method, the cross-field migration method provided by the application is tested in the hotel service robot path planning scene. The above training process is performed on different order demand point distributions, and is applied to the actual hotel scene for testing. Here, three kinds of models are involved, which are source teacher model, temporary model and student model. Among them, the student model is the network model finally deployed and used; the temporary model is responsible for training under different target data distributions, and provides auxiliary information for the gradient calculation of the student model; the source teacher model is responsible for providing guidance information for the training of the temporary model.

[0134] In the test process, the preset different source data distributions, and pre-train a source teacher model for each distribution. Meanwhile, preset a target training distribution, initialize a temporary model for each distribution, and perform teacher-student matching. Therefore, the most suitable source teacher model needs to be matched for each target training distribution for subsequent loss function calculation. In the parameter setting of the teacher-student matching strategy, set k = 2 in Top-k, and the truncation threshold = 0.4.

[0135] Calculate the similarity matrix between each target data distribution and the source data distribution , and obtain a similarity matrix with a size of :

[0136]

[0137] Each element represents the similarity between the source data distribution and the target data distribution , and the smaller it is, the higher the similarity is. Set the temperature parameter , and perform negative exponential change to obtain the similarity matrix :

[0138]

[0139] Each element represents the similarity between the source data distribution and the target data distribution , and the larger it is, the higher the similarity is. Further normalization operation is performed to obtain the normalized similarity matrix :

[0140]

[0141] Each element represents the normalized similarity between the source data distribution and the target data distribution , and the larger it is, the higher the similarity is. Based on the obtained similarity, subsequent threshold truncation and Top-k selection are performed. Since the truncation threshold is set to , for each target data distribution, the source teacher distribution is selected from large to small until the cumulative similarity is greater than the threshold , so the source teacher distributions selected by the three target data are , , . Then, Top-k selection is performed, and since ​Since the number of source teacher distributions matched with the target data distribution is less than or equal to Therefore, further screening is not required. In summary, the matching result is as shown in Figure 3 After obtaining the matching result, the corresponding loss function can be calculated according to the corresponding similarity weight, and the subsequent training process is continued. Tests prove that the proposed method can realize the transfer based on zero / few-shot field distribution, and has good generalization performance and high inference speed.

[0142] In summary of the above experiments, the path planning cross-field transfer method based on knowledge distillation provided by the present application combines knowledge distillation and teacher-student matching strategy, solves the problem of dynamic and variable field distribution in actual application scenarios, effectively improves the model generalization performance and reduces the parameter size of the model.

[0143] The above specific embodiments only describe the design principles of the present application, and the shapes and names of the components in the description can be different and are not limited. Therefore, the skilled in the art of the present application can modify or equivalently replace the technical solutions recorded in the foregoing embodiments; and these modifications and replacements do not deviate from the purpose and technical solutions of the present application, and should all belong to the protection scope of the present application.​​​

Claims

1. A path planning cross-domain migration method based on knowledge distillation, characterized in that, Comprise: Step 1: for path planning task scene, pre-train corresponding source teacher model on different source domain data distribution respectively; determine the target data distribution of multiple different tasks, and allocate a temporary model to each task; Step 2: the parameters of each temporary model are initialized as the parameters of the current student model; Step 3: based on the similarity of source domain data distribution and target data distribution, determine more than one source teacher model matched with each temporary model; Step 4: temporary model training: based on the target data distribution, construct the first example, input the temporary model to be trained and the matched source teacher model; based on the knowledge distillation technology, use all matched source teacher models to guide the training direction of the temporary model, and complete the iterative training of the temporary model; Step 5: student model training: based on the target data distribution, construct the second example, input the trained temporary model and the matched source teacher model; based on the gradient of all temporary model parameters, determine the gradient of student model parameters, and update the gradient of student model parameters; Step 6: repeat steps 2 to 5 to obtain the final student model through iterative training; use the final student model to execute path planning tasks in different fields to realize cross-field migration.

2. The knowledge distillation based path planning cross-domain transfer method according to claim 1, wherein, In the step of training the temporary model, each iteration, the temporary model to be trained and the matched source teacher model input the training set example under the corresponding target data distribution; the loss function value of the temporary model is calculated according to the output of the temporary model and all source teacher models, and the gradient is calculated according to the loss function value; the mean of the gradient of all examples in the training set is used as the update gradient of the current iteration, and the gradient descent update is performed on the parameters of the temporary model to be trained.

3. The knowledge distillation based path planning cross-domain transfer method of claim 1, wherein, In the step of training the student model, the gradient update of the student model parameters based on the gradient of all temporary model parameters is: Distribute the target data The validation set examples are input with a temporary model and its matched source teacher models. The loss function value of the temporary model is calculated based on the outputs of the temporary model and all source teacher models. The first gradient of the temporary model parameters is calculated based on the loss function value. The partial derivative of the first gradient with respect to the student model parameters is taken to obtain the second gradient. The mean of the second gradients corresponding to all examples in the validation set is calculated and used as the target data distribution. The corresponding gradient of the student model parameters; Let the total gradient of the student model parameters be the weighted sum of the student model gradient under each target data distribution; Based on the total gradient of the student model parameters, the gradient descent update is performed on the student model parameters.

4. The knowledge distillation based path planning cross-domain transfer method according to claim 2 or 3, characterized in that, In the training of temporary model and student model, the loss function of temporary model includes distillation loss term; the distillation loss term is the weighted sum of the distillation loss between temporary model and each matched source teacher model.

5. The knowledge distillation based path planning cross-domain transfer method according to claim 4, wherein, The construction method of the distillation loss term is: Setting temporary model matching a source teacher model; Target data distribution Next, calculate temporary model The output data KL divergence between the matching first Source teacher model , denoted as ; The value is 1 ; The upper index And Used to distinguish temporary model and source teacher model; The distillation loss term is ; wherein, is the similarity between the source domain data distribution corresponding to the jth source teacher model and the target data distribution corresponding to the temporary model. j th source teacher model and the target data distribution corresponding to the temporary model.

6. The knowledge distillation based path planning cross-domain transfer method according to claim 4, wherein, The loss function of the temporary model further includes task loss term; the task loss term and the distillation loss term are weighted.

7. The knowledge distillation based path planning cross-domain transfer method according to claim 1 or 5, wherein, The determination method of the similarity of source domain data distribution and target data distribution is: Calculate the Wasserstein distance between source domain data distribution and target data distribution, perform negative exponential mapping and normalization processing on the Wasserstein distance to obtain the numerical expression of similarity; the higher the similarity, the larger the value.

8. The knowledge distillation based path planning cross-domain transfer method according to claim 7, wherein, The negative exponential mapping is a nonlinear transformation of the Wasserstein distance; The nonlinear transformation is: wherein, a numerical representation of the similarity obtained after the non-linear transformation, a Wasserstein distance before the non-linear transformation, is a temperature parameter to control the diversity of the teacher-student model matching.

9. The knowledge distillation based path planning cross-domain transfer method of claim 1, wherein, The determination of more than one source teacher model matched with each temporary model includes: Ranking the similarity values of all source teacher models from large to small, and selecting the source teacher model with the largest similarity value to join the matching set each time until the sum of the similarity values of all source teacher models in the matching set is greater than a set threshold, or the number of source teacher models in the matching set reaches a set number .

10. An apparatus for path planning cross-domain migration based on knowledge distillation, comprising: Including D source teacher models, F temporary models, 1 student model, teacher pre-training module, iterative training module; Each source teacher model corresponds to a source domain data distribution; target data distributions of F different tasks are determined, and each task is assigned a temporary model; The teacher pre-training module pre-trains the source teacher model on different D source domain data distributions; The iterative training module obtains the final student model through iterative training; the iterative training module includes an initialization module, a matching module, a temporary model training module, and a student model training module; The initialization module initializes the parameters of each temporary model as the current student model parameters in each iteration training; The matching module determines more than one source teacher model matched with each temporary model based on the similarity between the source domain data distribution and the target data distribution; The temporary model training module uses all the matched source teacher models to guide the training direction of the temporary model based on the knowledge distillation technology, and completes the iterative training of the temporary model; The student model training module determines the student model parameter gradient based on the gradient of all temporary model parameters, and updates the student model parameters by gradient; The final student model performs path planning tasks in different domains to realize cross-domain transfer.

Citation Information

Patent Citations

  • Cross-domain small sample point cloud terrain classification method and system

    CN119131467A

  • Self-adaptive personalized federal learning method based on knowledge distillation

    CN119808892A