Natural language control robot based on improved PSO algorithm and control method
By training and optimizing the natural language processing model using the improved PSO algorithm, and combining labeled and unlabeled datasets, the running trajectory of the robot's execution components is optimized. This solves the execution error problem of the natural language controlled robot in a variable environment and achieves higher accuracy in understanding and executing task instructions.
Patent Information
- Application Number
- CN202511285461.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-09-10
AI Technical Summary
Existing natural language controlled robots struggle to adapt to changing real-world environments when executing task commands, and there are discrepancies between their actual and theoretical operating trajectories, leading to inaccurate execution of task commands.
An improved particle swarm optimization (PSO) algorithm is used to train and optimize the natural language processing model. By combining labeled and unlabeled datasets, an adversarial example set is generated to optimize the running trajectory of the robot's execution parts. Errors are reduced through real-time monitoring and iterative optimization.
It improves the robot's ability to understand and execute task instructions, reduces the error between the actual running trajectory and the theoretical running trajectory, and improves the accuracy of task execution and the generalization ability of the model.
Smart Images

Figure CN120773067B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of natural language control robots, and particularly relates to a natural language control robot based on an improved PSO algorithm and a control method. BACKGROUND
[0002] A natural language control robot refers to a robot capable of understanding and executing instructions issued by humans through natural language. However, the existing natural language control robots need a large amount of training data before executing tasks, especially demonstration data with natural language annotations. The acquisition of such data is not only time-consuming and labor-intensive, but also very costly. In addition, the diversity and complexity of natural language mean that generating accurate annotations for every possible task or instruction is a huge challenge. Converting natural language instructions into specific actions of a robot involves a complex process of semantic understanding and task planning, which not only requires understanding the literal meaning of the instructions, but also needs to interpret their implied task intentions according to the context. Therefore, the existing robot control models often have difficulty in coping with new scenarios or new instructions outside the training data. This is mainly because these models are over-optimized on specific data sets and lack sufficient generalization ability to adapt to changing real-world environments. This makes it difficult for robots to accurately understand all task instructions during task execution.
[0003] From another perspective, even if the existing natural language control robots can accurately understand all task instructions, there will be errors between the actual running trajectory and the theoretical running trajectory in the task instructions when the robot's mechanical arm or other components execute the corresponding task instructions, resulting in the final task instructions being unable to be accurately executed.
[0004] Therefore, how to improve the control method of the existing natural language control robot to improve the robot's understanding ability of task instructions and reduce the error between the actual running trajectory and the theoretical running trajectory in the task instructions to improve the accuracy of task instruction execution is a technical problem that needs to be solved at present. SUMMARY
[0005] The purpose of the present application is to provide a natural language control robot based on an improved PSO algorithm and a control method, which improves the control method of the existing natural language control robot to improve the robot's understanding ability of task instructions and reduce the error between the actual running trajectory and the theoretical running trajectory in the task instructions to improve the accuracy of task instruction execution.
[0006] To solve the above technical problems, the technical solutions adopted by the present application are as follows:
[0007] In a first aspect, a control method for a natural language control robot based on an improved PSO algorithm is provided, comprising the following steps:
[0008] S1: create a natural language processing model, and train the natural language processing model through a training set composed of a labeled language data set and an unlabeled language data set, verify the natural language processing model through a verification set, determine whether the natural language processing model meets a specified performance indicator, if yes, execute step S2, and if not, retrain the model until the specified performance indicator is met;
[0009] S2: real-time collection of language in the environment through a language collection module, identification and extraction of task instructions in the collected language through a language recognition module, and input of the extracted task instructions into the natural language processing model for real-time natural language processing;
[0010] S3: generating an adversarial sample set based on the language data after real-time natural language processing, and inputting the adversarial sample set into the training set;
[0011] S4: generating a control instruction based on the natural language processing result, and inputting the control instruction into a natural language control robot, the natural language control robot performing a corresponding action based on the control instruction, and optimizing the running track of the execution component of the natural language control robot through the improved PSO algorithm in the process of performing the corresponding action;
[0012] S5: the natural language control robot performing a related action based on the optimized running track, the action detection module real-time monitoring the action of the robot, and determining whether the difference between the actual running track of the robot execution component and the theoretical running track of the control instruction is within a preset error range, if not, executing step S6, and if yes, continuing to execute the current control instruction;
[0013] S6: continuously optimizing the running track of the execution component of the natural language control robot through the improved PSO algorithm in step S4 until the difference between the actual running track of the robot execution component and the theoretical running track of the control instruction is within the preset error range or a preset iteration number is reached.
[0014] Preferably, the specific process of training the natural language processing model through the training set composed of the labeled language data set and the unlabeled language data set in step S1 is as follows:
[0015] S11: parameter initialization of the created natural language processing model, and training of the parameter initialized natural language processing model through the labeled language data set to obtain an initial natural language processing model;
[0016] S12: prediction of the unlabeled language data set through the initial natural language processing model, and use of the prediction results with high confidence as a pseudo-label data set;
[0017] S13: input the labeled language data set and the pseudo-label data set into the natural language processing model for retraining of the model, and iteratively use the new pseudo-label data set to train and update the natural language processing model until the model reaches a preset performance index or a preset number of iterations.
[0018] Preferably, the specific process of inputting the extracted task instructions into the natural language processing model for real-time natural language processing in step S2 is as follows:
[0019] S21: cleaning, word segmentation and stop word removal processing are performed on the obtained natural language data, and the voice data is converted into text data;
[0020] S22: a vocabulary table is constructed by extracting words from the text data, and the vocabulary table is obtained by extracting a set of all non-repeated words in the text data;
[0021] S23: the text data is segmented into individual words or phrases, and the frequency of each word in the vocabulary table is obtained based on the segmented words or phrases;
[0022] S24: the statistical word frequency is converted into a vector, each element in the vector corresponds to a word in the vocabulary table, and the value of each element is the number of times the word appears in the text data.
[0023] Preferably, the specific process of optimizing the running trajectory of the execution component of the natural language controlled robot by improving the PSO algorithm in step S4 is as follows:
[0024] S41: the optimization of the running trajectory of the execution component of the natural language controlled robot is converted into kinematic parameter compensation of the execution component, and the to-be-solved kinematic parameters are converted into a high-dimensional nonlinear equation group for solving;
[0025] S42: a group of particle kinematic parameters are generated as an initial particle population, including the position, velocity and fitness value of each particle in the initial particle population, and the initial particle population is optimized;
[0026] S43: a local optimal solution and a global optimal solution are set, the local optimal solution refers to the optimal solution of each particle, and the global optimal solution refers to the optimal solution in the entire particle population;
[0027] S44: the position and velocity of each particle are updated;
[0028] S45: the fitness value of each particle is calculated, and when the fitness value of the current particle is better than its historical optimal solution, the local optimal solution of the current particle is updated;
[0029] S46: When the fitness value of a certain particle is better than the current global optimum, calculate the global optimum of the entire particle swarm and update the global optimum.
[0030] S47: Iterate through steps S43-S46 until the maximum number of iterations is reached or the deviation between two adjacent generations is within a preset range.
[0031] Preferably, the specific process of optimizing the initial particle population in step S42 is as follows:
[0032] S421: Generate a set of individual kinematic parameters as an initial particle population, let the initial particle population be... P (0), P (0)={ X 1, X 2, X 3, ... X N}, of which individual population particles X i Acquired from historical kinematic parameter data or generated randomly;
[0033] S422: Define the fitness function F ( X ), through the fitness function F ( X The fitness of each particle in the initial particle population is evaluated to obtain a fitness value for each particle. For a single population of particles... X i fitness value fi The calculation formula is: fi=F ( X i );
[0034] S423: Based on each individual population particle X i The fitness value is used to select particles through a selection operation, and the selected particles are used to generate the next generation.
[0035] S424: Perform a crossover operation on the selected specified particles to generate new particles. The crossover operation is a multi-point crossover.
[0036] S425: Mutate the newly generated particles with a specified probability, and add the new particles after crossover and mutation to the initial population to generate the next generation population.
[0037] Preferably, the specific formula for updating the position and velocity of each particle in step S44 is as follows:
[0038] v i t+1 = w·v i t +c 1 r 1( p i t - x i t )+ c 2 r 2( p g t - x i t );
[0039] wherein, v i t+1 is a particle X i In t the speed of the iteration of the order of 1, w is an inertia weight, c 1 and c 2 are learning factors, r 1 and r 2 are random numbers, p i t is a history optimal position of the particle X i , p g t is a global optimal position, x i t is a current position of the particle X i .
[0040] Preferably, after step S42, the particle population is further processed, including the following specific steps:
[0041] An optimized population is established based on the position of each particle after optimization, each particle in the optimized population is iteratively approached to the particle with the optimal position or a randomly selected particle, and the fitness value of the particle is calculated after each particle moves, if the new position of the particle has a better fitness, the current optimal solution is updated;
[0042] The position change formula for approaching the particle with the optimal position or the randomly selected particle is:
[0043] X ( t +1)=X t r X X t
[0044] wherein, X t represents the position of the current particle, X * represents the position of the optimal particle, r is a random number, which is a random number between [-1, 1].
[0045] In a second aspect, a natural language control robot based on the improved PSO algorithm is provided for implementing any one of the control methods of the natural language control robot based on the improved PSO algorithm, comprising a language collection module, a language recognition module, a model creation module, a natural language processing model, an adversarial sample generation module, a control instruction generation module, and a PSO algorithm optimization module; the model creation module is connected with the natural language processing model, the language collection module is connected with the language recognition module, the language recognition module is connected with the natural language processing model and the adversarial sample generation module, the natural language processing model is connected with the control instruction generation module, and the PSO algorithm optimization module is connected with the natural language control robot execution component.
[0046] The language collection module is configured to collect languages in the environment in real time.
[0047] The language recognition module is configured to recognize and extract task instructions in the collected languages and input the extracted task instructions into the natural language processing model.
[0048] The model creation module is configured to create a natural language processing model.
[0049] The natural language processing model is configured to perform real-time natural language processing on the extracted task instructions.
[0050] The adversarial sample generation module is configured to generate an adversarial sample set based on the language data processed in real time and input the adversarial sample set into the training set.
[0051] The control instruction generation module is configured to generate a control instruction based on the natural language processing result and input the control instruction to the natural language control robot.
[0052] The PSO algorithm optimization module is configured to optimize the running track of the execution component of the natural language control robot.
[0053] The action detection module is configured to monitor the action of the robot in real time, and determine whether the difference between the actual running track of the robot execution component and the theoretical running track of the control instruction is within a preset error range.
[0054] The beneficial effects of the present application include:
[0055] The natural language control robot based on the improved PSO algorithm and the control method provided by the present application create a natural language processing model and train it, collect languages in the environment in real time through a language collection module, input the extracted task instructions into the natural language processing model for real-time natural language processing, generate control instructions based on the natural language processing results and deliver them to the natural language control robot, optimize the running track of the execution component through the improved PSO algorithm in the process of the natural language control robot performing corresponding actions, and the natural language control robot performs related actions based on the optimized running track. At the same time, the action detection module monitors the action of the robot in real time, and iteratively optimizes the running track of the execution component of the natural language control robot through the improved PSO algorithm. The understanding ability of the robot for task instructions and the accuracy of the robot in executing task instructions are improved.
[0056] Firstly, the created natural language processing model is initialized by parameters, and the labeled language data set is input into the model for training to obtain an initial natural language processing model; the unlabeled language data set is predicted based on the initial natural language processing model, and the prediction results with high confidence are used as pseudo-label data set; the labeled language data set and the pseudo-label data set are input into the natural language processing model for model retraining, and the new pseudo-label data set is iteratively used to train and update the natural language processing model until the model reaches a preset performance index or a preset iteration number. The model in the prior art is only trained using the labeled data, which makes the processing performance of the model for unknown data insufficient, and effectively improves the generalization ability of the model.
[0057] Secondly, the obtained natural language data is cleaned, segmented and stop words are removed, and the voice data is converted into text data; the words are extracted from the text data to construct a vocabulary table, the text data is segmented into individual words or phrases, and the vocabulary table is counted to obtain the word frequency of each word; the process of converting the counted word frequency into a vector realizes real-time natural language processing, and the robot can perform corresponding actions based on natural language input.
[0058] Thirdly, the execution component's running track optimization of the natural language control robot is converted into kinematic parameter compensation of the execution component, and the kinematic parameters to be solved are converted into high-dimensional nonlinear equation groups for solving; a group of particle kinematic parameters are generated as initial particle population and are optimized; local optimal solution and global optimal solution are set; the position and speed of each particle are updated; the fitness value of each particle is calculated, and when the fitness value of the current particle is better than the historical optimal solution, the local optimal solution is updated; when the fitness value of a particle is better than the current global optimal solution, the global optimal solution of the entire particle group is calculated, and the global optimal solution is updated, effectively reducing the error between the actual running track and the theoretical running track in the task instruction, and improving the execution precision of the robot action.
[0059] Finally, a group of individual kinematic parameters are generated as initial particle population, a fitness function is defined, each particle is fitness evaluated, and according to the fitness value of each single population particle X i , the particles are selected by selection operation, the specified particles selected are used to generate the next generation; the specified particles selected are crossed to generate new particles; the generated new particles are subjected to mutation processing, different optimization methods and optimization logic are introduced, the PSO algorithm is improved, the global search ability of the optimization algorithm is improved, over-convergence is avoided, the convergence speed is improved, the compensation accuracy is improved, and an effective solution is provided for the complex optimization problem of the robot running track. BRIEF DESCRIPTION OF DRAWINGS
[0060] Fig. 1 It is a flowchart of the control method of the natural language control robot based on the improved PSO algorithm of the application.
[0061] Fig. 2 It is a flowchart of real-time natural language processing.
[0062] Fig. 3 It is an architecture diagram of the natural language control robot control system based on the improved PSO algorithm of the application. DETAILED DESCRIPTION
[0063] The application will be further described below in combination with the accompanying Fig. 1~Fig. 3 The application will be further described below in combination with the accompanying
[0064] Example 1
[0065] Referring to the accompanying Fig. 1 , a control method of a natural language control robot based on an improved PSO algorithm includes the following steps:
[0066] S1: create a natural language processing model, train the natural language processing model through a training set composed of a labeled language data set and an unlabeled language data set, verify the natural language processing model through a verification set, determine whether the natural language processing model meets a specified performance index, if yes, execute step S2, and if not, retrain the model until the specified performance index is met;
[0067] S2: collect languages in the environment in real time through a language collection module, identify and extract task instructions in the collected languages through a language recognition module, and input the extracted task instructions into the natural language processing model for real-time natural language processing;
[0068] S3: generate an adversarial sample set based on the language data after real-time natural language processing, and input the adversarial sample set into the training set;
[0069] S4: generate a control instruction based on the natural language processing result, and input the control instruction into a natural language control robot, wherein the natural language control robot executes a corresponding action based on the control instruction, and optimizes a running track of an execution component of the natural language control robot through the improved PSO algorithm in the process of executing the corresponding action;
[0070] S5: the natural language control robot executes a related action based on the optimized running track, while a motion detection module monitors the motion of the robot in real time, and determines whether a difference between an actual running track of the execution component of the robot and a theoretical running track of the control instruction is within a preset error range, if not, executes step S6, and if yes, continues to execute the current control instruction;
[0071] S6: continuously optimize the running track of the execution component of the natural language control robot through the improved PSO algorithm in step S4 until the difference between the actual running track of the execution component of the robot and the theoretical running track of the control instruction is within the preset error range or a preset iteration number is reached. The advantage of the PSO algorithm lies in its simplicity, ease of implementation and fast convergence speed, but due to its problems of being easy to fall into local optimal solution and requiring high model parameter settings, the present application improves the existing PSO algorithm to avoid falling into local optimal solution and reduce the requirement for model parameter settings.
[0072] In the embodiment, the specific process of training the natural language processing model through the training set composed of the labeled language data set and the unlabeled language data set in step S1 is as follows:
[0073] S11: initialize parameters of the created natural language processing model, and input the labeled language data set into the parameter-initialized natural language processing model to obtain an initial natural language processing model.
[0074] S12: predicting the unlabeled language data set by the initial natural language processing model, and taking the prediction result with high confidence as the pseudo-label data set. The model is trained by the labeled language data set and the unlabeled data set. If only the labeled data is used to train the model, the model needs to have a certain generalization ability, and a huge labeled data set is needed for training. However, the training of the model by the labeled language data set and the unlabeled language data set in the present application needs only a small amount of labeled data for training, and the unlabeled language data set is combined to improve the training efficiency and achieve a relatively ideal model generalization ability.
[0075] S13: inputting the labeled language data set and the pseudo-label data set into the natural language processing model for retraining of the model, and iteratively training the natural language processing model with the new pseudo-label data set until the model reaches the preset performance index or the preset iteration number.
[0076] The above process of initializing the created natural language processing model, training the model by inputting the labeled language data set into the model to obtain an initial natural language processing model, predicting the unlabeled language data set based on the initial natural language processing model, and taking the prediction result with high confidence as the pseudo-label data set, inputting the labeled language data set and the pseudo-label data set into the natural language processing model for retraining of the model, and iteratively training the natural language processing model with the new pseudo-label data set until the model reaches the preset performance index or the preset iteration number avoids the problem in the prior art that the model training is performed only with the labeled data, which results in insufficient processing performance of the model for unknown data, and effectively improves the generalization ability of the model.
[0077] Embodiment 2
[0078] Based on Embodiment 1, referring to FIG. 2, the specific process of inputting the extracted task instruction into the natural language processing model for real-time natural language processing in step S2 is as follows: Fig. 2
[0079] S21: cleaning, tokenizing and removing stop words from the obtained natural language data, and converting the voice data into text data. Since the data input into the robot can be voice data, the voice data is first converted into text data for subsequent understanding and processing of the robot. The cleaning, tokenizing and removing stop words are the first crucial step, which removes noise and standardizes the text format for subsequent algorithm processing through the steps of text cleaning, tokenizing and removing stop words.
[0080] S22: Extracting words from the text data to build a vocabulary, the vocabulary being obtained by extracting a set of all non-repeated words in the text data;
[0081] S23: Dividing the text data into individual words or phrases, and counting the number of occurrences of each word in the vocabulary based on the divided words or phrases to obtain the word frequency of each word;
[0082] S24: Converting the counted word frequency into a vector, each element in the vector corresponding to a word in the vocabulary, and the value of each element being the number of occurrences of the word in the text data. Word vectorization processing ancient city converts each word into a vector, which not only contains the semantic information of the word itself, but also reflects the relationship between the word and other words.
[0083] In another embodiment, the user input text can also be divided into word units to facilitate subsequent processing, and the divided words are tagged with parts of speech to determine their grammatical role in the sentence, analyze the sentence structure, and determine the relationship between the words. Semantic analysis: According to the results of syntactic analysis, extract the key information in the sentence, understand the intent of the input data, and then generate control commands.
[0084] Embodiment 3
[0085] On the basis of embodiment 1 or embodiment 2, the specific process of optimizing the running trajectory of the execution component of the natural language controlled robot in step S4 by improving the PSO algorithm is as follows:
[0086] S41: Convert the running trajectory optimization of the execution component of the natural language controlled robot into kinematic parameter compensation of the execution component, and convert the to-be-solved kinematic parameters into a high-dimensional nonlinear equation set for solving;
[0087] S42: Generate a set of particle kinematic parameters as an initial particle population, including the position, velocity and fitness value of each particle in the initial particle population, and optimize the initial particle population;
[0088] S43: Set a local optimal solution and a global optimal solution, the local optimal solution being the optimal solution of each particle, and the global optimal solution being the optimal solution in the entire particle population;
[0089] S44: Update the position and velocity of each particle;
[0090] S45: Calculate the fitness value of each particle, and when the fitness value of the current particle is better than its historical optimal solution, update its local optimal solution;
[0091] S46: When the fitness value of a certain particle is better than the current global optimum, calculate the global optimum of the entire particle swarm and update the global optimum.
[0092] S47: Iterate through steps S43-S46 until the maximum number of iterations is reached or the deviation between two adjacent generations is within a preset range.
[0093] The above process improves the efficiency of particle swarm initialization in solving kinematic parameter PSO optimization problems, promotes reasonable partitioning and rapid convergence of the initial particle swarm, enhances the model's global search capability and performance optimization capability, and avoids premature convergence to a local optimum during the iteration process.
[0094] In this embodiment, the specific process of optimizing the initial particle population in step S42 is as follows:
[0095] S421: Generate a set of individual kinematic parameters as an initial particle population, let the initial particle population be... P (0), P (0)={ X 1, X 2, X 3, ... X N}, of which individual population particles X i Data is obtained from historical kinematic parameter data or generated randomly. Population size and maximum velocity range are set to prevent exceeding the search space.
[0096] S422: Define the fitness function F ( X ), through the fitness function F ( X The fitness of each particle in the initial particle population is evaluated to obtain a fitness value for each particle. For a single population of particles... X i fitness value fi The calculation formula is: fi=F ( X i Define the fitness function according to the specific requirements of the problem. The fitness function is used to measure the quality of individual solutions.
[0097] S423: Based on each individual population particle X i The fitness value is used to select particles through a selection operation, and the selected particles are used to generate the next generation.
[0098] S424: Perform a crossover operation on the selected specified particles to generate new particles. The crossover operation is a multi-point crossover.
[0099] S425: The generated new particles are subjected to mutation processing, and the new particles after the crossover operation and mutation processing are added to the initial population to generate the next generation population. Randomness is introduced to increase the diversity of the population. Mutation operation usually randomly changes some genes of individuals with a certain probability.
[0100] The specific formula for updating the position and velocity of each particle in step S44 is as follows:
[0101] v i t+1 = w·v i t +c 1 r 1( p i t - x i t )+ c 2 r 2( p g t - x i t );
[0102] wherein, v i t+1 is the particle X i in t +1thiteration of velocity, w is the inertia weight, c 1and c 2are learning factors, r 1and r 2are random numbers, p i t is the historical optimal position of the particle X i , p g t is the global optimal position, x i t is the current position of the particle X i .
[0103] By generating a set of individual kinematic parameters as an initial particle population, defining a fitness function, performing fitness evaluation on each particle, and selecting the best individual in each single populationX i The fitness value of each particle is calculated, the particles are selected by selection operation, the selected specified particles are used to generate the next generation, the selected specified particles are crossed to generate new particles, and the generated new particles are subjected to mutation processing. By introducing different optimization methods and optimization logic, the PSO algorithm is improved, the global search ability of the optimization algorithm is improved, excessive convergence is avoided, the convergence speed is improved, the compensation accuracy is improved, an effective solution is provided for the complex optimization problem of the robot running track.
[0104] The initialization population is updated to improve the division quality and rationality of the initial particle group of PSO. First, the GA algorithm is used to generate an initial population with higher diversity and fitness, and then the WOA algorithm is used to further optimize the population to obtain an optimal PSO initial particle population with the global search ability of the WOA algorithm and the performance optimization ability of the GA algorithm. The behaviors of genetic, mutation and selection in the biological evolution process are simulated to systematically sort out the complex optimization problem, and the potential feasible solution is selected, crossed and mutated to gradually approach the optimal solution of the problem.
[0105] In another implementation manner of the embodiment, after step S42, the particle population is further processed, including the following specific steps:
[0106] Based on the position of each particle after optimization, each particle in the optimized population is iteratively close to the particle with the optimal position or a randomly selected particle, and the fitness value of the particle is calculated after the movement of each particle. If the new position of the particle has a better fitness, the current optimal solution is updated;
[0107] The position change formula for approaching the particle with the optimal position or the randomly selected particle is:
[0108] X ( t +1)= X ( t )+ r ( X *- X ( t ));
[0109] Wherein, X ( t ) represents the position of the current particle, X * represents the position of the optimal particle, r is a random number, which is a random number between [-1, 1].
[0110] The application discloses a natural language control robot based on an improved PSO algorithm, and relates to the technical field of robots.
[0111] The language collection module is used for collecting languages in the environment in real time; the language recognition module is used for recognizing and extracting task instructions in the collected languages and inputting the extracted task instructions into the natural language processing model; the model creation module is used for creating the natural language processing model; the natural language processing model is used for performing real-time natural language processing on the extracted task instructions; the adversarial sample generation module is used for generating an adversarial sample set based on the language data after the real-time natural language processing and inputting the adversarial sample set into the training set; the control instruction generation module is used for generating a control instruction based on the natural language processing result and inputting the control instruction into the natural language control robot; the PSO algorithm optimization module is used for optimizing the running track of the execution component of the natural language control robot; and the action detection module is used for monitoring the action of the robot in real time and judging whether the difference between the actual running track of the execution component of the robot and the theoretical running track of the control instruction is within a preset error range.
[0112] In summary, the improved PSO algorithm-based natural language control robot and control method provided by the application initialize parameters of a created natural language processing model, input an annotated language data set into the model for training to obtain an initial natural language processing model, predict an unannotated language data set based on the initial natural language processing model, and use a prediction result with a high confidence as a pseudo-label data set, input the annotated language data set and the pseudo-label data set into the natural language processing model for model retraining, and iteratively use new pseudo-label data sets to train and update the natural language processing model until the model reaches a preset performance index or a preset number of iterations. This avoids the insufficient processing performance of a model on unknown data in the prior art due to the use of only annotated data for model training, and effectively improves the generalization capability of the model. The acquired natural language data is cleaned, segmented, and processed to remove stop words, and the voice data is converted into text data; words are extracted from the text data to construct a vocabulary, the text data is segmented into individual words or phrases, and the vocabulary is counted to obtain the word frequency of each word; and the process of converting the counted word frequency into a vector realizes real-time natural language processing, and the robot can execute corresponding actions based on natural language input.
[0113] The running track optimization of the execution component of the natural language control robot is converted into kinematic parameter compensation of the execution component, and the to-be-solved kinematic parameters are converted into high-dimensional nonlinear equation groups for solving; a group of particle kinematic parameters are generated as an initial particle population and are optimized; a local optimal solution and a global optimal solution are set; the position and speed of each particle are updated; the fitness value of each particle is calculated, and if the fitness value of the current particle is better than the historical optimal solution, the local optimal solution is updated; and if the fitness value of a particle is better than the current global optimal solution, the global optimal solution of the entire particle group is calculated, and the global optimal solution is updated. This effectively reduces the error between the actual running track and the theoretical running track in the task instruction, and improves the execution precision of the robot action. By generating a group of individual kinematic parameters as an initial particle population, defining a fitness function, evaluating the fitness of each particle, and selecting particles by selection operation according to the fitness value of each single population particle X i The selected specified particles are used to generate the next generation; the selected specified particles are subjected to cross operation to generate new particles; and the generated new particles are subjected to mutation processing. By introducing different optimization methods and optimization logic, the PSO algorithm is improved, the global search capability of the optimization algorithm is improved, over-convergence is avoided, the convergence speed is improved, the compensation accuracy is improved, and an effective solution is provided for the complex optimization problem of the running track of the robot.
Claims
1. A control method of a natural language control robot based on an improved PSO algorithm, characterized by, The method comprises the following steps: S1: creating a natural language processing model, training the natural language processing model through a training set composed of a labeled language data set and an unlabeled language data set, verifying the natural language processing model through a verification set, determining whether the natural language processing model meets a specified performance index, executing step S2 if the natural language processing model meets the specified performance index, and retraining the model until the specified performance index is met if the natural language processing model does not meet the specified performance index; S2: collecting languages in the environment in real time through a language collection module, recognizing and extracting task instructions in the collected languages through a language recognition module, and inputting the extracted task instructions into the natural language processing model for real-time natural language processing; S3: generating an adversarial sample set based on the language data after real-time natural language processing, and inputting the adversarial sample set into the training set; S4: generating a control instruction based on the natural language processing result, and inputting the control instruction into a natural language control robot, the natural language control robot executing a corresponding action based on the control instruction, and optimizing the running track of the execution component of the natural language control robot through the improved PSO algorithm in the process of executing the corresponding action; S5: the natural language control robot executes the related action based on the optimized running track, a motion detection module monitors the motion of the robot in real time, and determines whether the difference between the actual running track of the execution component of the robot and the theoretical running track of the control instruction is within a preset error range, executes step S6 if the difference is not within the preset error range, and continues to execute the current control instruction if the difference is within the preset error range; S6: iteratively optimizing the running track of the execution component of the natural language control robot through the improved PSO algorithm in step S4 until the difference between the actual running track of the execution component of the robot and the theoretical running track of the control instruction is within the preset error range or a preset iteration number is reached; The specific process of optimizing the running track of the execution component of the natural language control robot through the improved PSO algorithm in step S4 is as follows: S41: converting the optimization of the running track of the execution component of the natural language control robot into kinematic parameter compensation of the execution component, and converting the to-be-solved kinematic parameters into a high-dimensional nonlinear equation group for solving; S42: generating a group of particle kinematic parameters as an initial particle population, including the position, velocity and fitness value of each particle in the initial particle population, and optimizing the initial particle population; S43: setting a local optimal solution and a global optimal solution, the local optimal solution being the optimal solution of each particle, and the global optimal solution being the optimal solution of the entire particle population; S44: updating the position and velocity of each particle; S45: calculating the fitness value of each particle, and updating the local optimal solution of the current particle when the fitness value of the current particle is better than the historical optimal solution of the current particle; S46: calculating the global optimal solution of the entire particle population and updating the global optimal solution when the fitness value of a certain particle is better than the current global optimal solution; S47: iteratively executing steps S43-S46 until a maximum iteration number is reached or the deviation between adjacent two generations is within a preset range. The specific process of optimizing the initial particle population in step S42 is as follows: S421: Generate a set of individual kinematic parameters as an initial particle population, let the initial particle population be... P (0), P (0)={ X 1, X 2, X 3, ... X N }, of which individual population particles X i Acquired from historical kinematic parameter data or generated randomly; S422: define fitness function F X F X X i fi fi=F X i ; S423: Based on each individual population particle X i The fitness value is used to select particles through a selection operation, and the selected particles are used to generate the next generation. S424: Cross the selected specified particles to generate new particles, and the cross operation mode is multi-point cross; S425: Perform mutation processing on the generated new particles, randomly change the particles with a specified probability, and add the new particles after the cross operation and mutation processing to the initial population to generate the next generation population; The specific formula for updating the position and speed of each particle in step S44 is as follows: v i t+1 = w·v i t +c 1 r 1( p i t - x i t )+ c 2 r 2( p g t - x i t ); wherein, v i t+1 is a particle X i In t the speed of the +1 iteration, w is an inertia weight, c 1 and c 2 are learning factors, r 1 and r 2 are random numbers, p i t is a particle X i the historical best position, p g t is the global best position, x i t is the current position of the particle X i . After step S42, the particle population is further processed, including the following specific steps: Based on the position of each particle after optimization, an optimized population is established, each particle in the optimized population is iteratively close to the particle with the optimal position or a randomly selected particle, and the fitness value of the particle is calculated after the particle moves. If the new position of the particle has a better fitness, update the current optimal solution; The position change formula for approaching the particle with the optimal position or the randomly selected particle is: X ( t +1)= X ( t )+ r ( X *- X ( t )); where, X t represents the position of the current particle, X represents the position of the optimal particle, r is a random number, which is a random number between [-1, 1]. 2.The control method of a robot controlled by a natural language based on an improved PSO algorithm according to claim 1, characterized in that, The specific process of training the natural language processing model in step S1 by using the training set composed of the labeled language data set and the unlabeled language data set is as follows: S11: Initialize the parameters of the created natural language processing model, and input the labeled language data set into the parameter initialized natural language processing model to train an initial natural language processing model; S12: Predict the unlabeled language data set by using the initial natural language processing model, and use the prediction results with high confidence as the pseudo-label data set; S13: Input the labeled language data set and the pseudo-label data set into the natural language processing model for model retraining, and iteratively use the new pseudo-label data set to train and update the natural language processing model until the model reaches the preset performance index or the preset iteration number. 3.The control method of a robot controlled by a natural language based on an improved PSO algorithm according to claim 1, characterized in that, The specific process of inputting the extracted task instruction into the natural language processing model for real-time natural language processing in step S2 is as follows: S21: Clean, tokenize, and remove stop words from the obtained natural language data, and convert the voice data into text data; S22: Extract words from the text data to construct a vocabulary table, and the vocabulary table is obtained by extracting a set of all non-repeated words in the text data; S23: Divide the text data into individual words or phrases, and count the occurrence frequency of each word in the vocabulary table based on the divided words or phrases to obtain the word frequency of each word; S24: Convert the counted word frequency into a vector, and each element in the vector corresponds to a word in the vocabulary table, and the value of each element is the occurrence frequency of the word in the text data.
4. The natural language controlled robot based on the improved PSO algorithm, for implementing the control method of the natural language controlled robot based on the improved PSO algorithm according to any one of claims 1-3, characterized in that, The application relates to a natural language control robot, which comprises a language collection module, a language recognition module, a model creation module, a natural language processing model, an adversarial sample generation module, a control instruction generation module and a PSO algorithm optimization module; the model creation module is connected with the natural language processing model; the language collection module is connected with the language recognition module; the language recognition module is connected with the natural language processing model and the adversarial sample generation module; the natural language processing model is connected with the control instruction generation module; the PSO algorithm optimization module is connected with a robot execution component of the natural language control robot. The language collection module is used for collecting languages in an environment in real time. The language recognition module is used for recognizing and extracting task instructions in the collected languages and inputting the extracted task instructions into the natural language processing model. The model creation module is used for creating the natural language processing model. The natural language processing model is used for processing the extracted task instructions in real time. The adversarial sample generation module is used for generating an adversarial sample set based on the language data processed in real time and inputting the adversarial sample set into the training set. The control instruction generation module is used for generating control instructions based on the natural language processing results and inputting the control instructions into the natural language control robot. The PSO algorithm optimization module is used for optimizing the running track of the robot execution component of the natural language control robot. The action detection module is used for monitoring the actions of the robot in real time and judging whether the difference between the actual running track of the robot execution component and the theoretical running track of the control instructions is within a preset error range.
Citation Information
Patent Citations
Text adversarial sample generation method and device, electronic equipment and storage medium
CN116911374A
Lightweight natural language processing large model training method
CN119862925A
Mechanical arm trajectory planning method based on improved particle swarm optimization
CN120363172A
Robot motion control method and system based on voice interaction
CN120461427A