Intelligent table tennis serving robot based on AI
By using AI technology in table tennis robots, the serving movement characteristics are extracted and reinforcement learning is carried out, and the problems of inaccurate serving prediction and poor posture in the existing technology are solved, and a faster and more accurate serving effect is achieved.
Patent Information
- Application Number
- CN202410918611.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-10
AI Technical Summary
The existing table tennis robots have volatility and lag in serving predictions in complex environments, resulting in slow serving speed and high error rate, and small working space for parallel robots and poor serving posture.
Using an AI-based intelligent table tennis serving robot, collects athletes' serving action videos through cameras, uses convolutional neural networks to extract features, combines long and short-term memory artificial neural networks and support vector machine classifiers to establish serving models, perform reinforcement learning and transfer learning. Optimize serving strategy.
It improves the flexibility and accuracy of serving, reduces the turnover rate, and allows the robot to learn the serving skills of different athletes faster and optimizes serving movements.
Smart Images

Figure CN118876047A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of AI-based intelligent table tennis serving robots, and specifically refers to an AI-based intelligent table tennis serving robot. Background Art
[0002] A table tennis robot is an auxiliary device designed for table tennis. It can play table tennis with users. Compared with devices such as table tennis serving machines, it can enhance the fun of training, and users can improve their level by playing against the table tennis robot. For table tennis robots, serving is a very important part.
[0003] In the prior art, the table tennis robot serves are mainly implemented by the following methods:
[0004] (1) Establish a table tennis aerodynamic model and collision model to predict the trajectory of the table tennis ball; establish a racket rebound model and a robot kinematic model to determine a reasonable serving strategy;
[0005] (2) Using the physics model method to predict the trajectory and manually setting the serve point based on the physics model;
[0006] (3) The parallel robot is used as the actuator of the serving strategy. The target point of the ball and the height when it crosses the net are manually set, and the robot kinematic model completes the serving strategy.
[0007] The above-mentioned prior art has the following technical problems:
[0008] (1) When predicting the trajectory of a table tennis ball based on physics analysis, the prediction results have large volatility and certain lag in the face of complex and changeable real-world environments. The table tennis ball hitting position calculated by predicting the trajectory and artificially given conditions limits the table tennis robot's ability to autonomously learn to select the appropriate serving point, affecting the table tennis robot's serving performance. The robot learns to serve slowly and has a high serving error rate.
[0009] (2) Although the parallel robot has the advantage of fast response, the robot's working space is too small, so the parallel robot can only be used in special table tennis tables, and the serving posture is not graceful. Summary of the invention
[0010] In order to solve the problems in the above-mentioned prior art that the robot learns to serve slowly, has a high serving error rate, and has low serving flexibility, the present invention proposes an AI-based intelligent table tennis serving robot to improve the above-mentioned problems.
[0011] The specific application is as follows:
[0012] A method for realizing serving of an intelligent table tennis serving robot based on AI, the method comprising:
[0013] S101: collecting the serving action of the table tennis player, collecting the serving action process of the player through a camera, and shooting a complete serving action video, wherein the complete serving action video includes the serving posture, serving tossing posture characteristics, hitting control after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table through the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net, and storing the shot video in a database;
[0014] S102: pre-processing the collected video data, converting the video into images and performing segmentation to eliminate the background;
[0015] S103: extracting features of the serving process through a convolutional neural network (CNN), including the serving posture, serving tossing posture features, hitting control after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net;
[0016] S104: Modeling the extracted serving process features through a long short-term memory artificial neural network LSTM and a SVM classifier, and establishing a dual LSTM model for table tennis serving, wherein the dual LSTM model is divided into LSTM-A and LSTM-B, wherein LSTM-A is used for training before the table tennis ball contacts the table tennis racket, and LSTM-B is used for training after the table tennis ball leaves the table tennis racket, and the output result of the LSTM-A training is used as the input of the LSTM-B, and training is performed;
[0017] S105: inputting the table tennis serving model into the serving robot for serving training, wherein the serving training adopts reinforcement learning and transfer learning, and the transfer learning is mainly used for posture planning of serving;
[0018] S106: setting the training goal of the first stage and the reward and penalty of the learning task of the first stage to perform reinforcement learning of the serve training, and obtaining a first serve reinforcement training model, wherein the first serve reinforcement training model is to make the serving racket contact the ball, and the penalty is determined according to the deviation loss between the training goal of the first stage and the learning task of the first stage;
[0019] S107: setting the training goal of the second stage and the reward and penalty of the learning task of the second stage to perform reinforcement learning of the serve training, and obtaining a second serve reinforcement training model, wherein the second serve reinforcement training model is to make the serve leave the racket and form a landing point trajectory on the own half of the table, and the penalty is determined according to the deviation loss between the training goal of the second stage and the learning task of the second stage;
[0020] S108: setting the training goal of the third stage and the reward and penalty of the learning task of the third stage to perform reinforcement learning of the serve training, and obtaining a third serve reinforcement training model, wherein the third serve reinforcement training model is a movement trajectory of a table tennis ball that bounces from a landing point on the own half of the table over the table tennis net, and the penalty is determined according to the deviation loss between the training goal of the third stage and the learning task of the third stage;
[0021] S109: setting the training goal of the fourth stage and the reward and penalty of the learning task of the fourth stage to perform reinforcement learning of the serve training, and obtaining a fourth serve reinforcement training model, wherein the fourth serve reinforcement training model is to make the trajectory of the table tennis ball landing on the opponent's half of the table after passing the net, and the penalty is determined according to the deviation loss between the training goal of the fourth stage and the learning task of the fourth stage;
[0022] S110: After four stages of intensive training, an output result is obtained, and the robot's serve training is evaluated to evaluate whether the robot has learned to serve a table tennis ball and the learning effect. If the robot has not learned to serve, the robot continues to perform the four-stage learning task until it learns to serve.
[0023] Furthermore, the preprocessing of the collected video data, converting the video into an image and performing segmentation, and eliminating the background specifically includes the following steps:
[0024] S21: Read a complete serving action video data from the database;
[0025] S22: converting the video data into an image sequence, and performing analysis and processing on each frame of the image;
[0026] S23: using a background subtraction algorithm to eliminate the background part of the image, further highlighting the characteristics of the athlete's serve and the characteristics of the table tennis ball's motion trajectory;
[0027] S24: further processing the image after removing the background, extracting the player's serve feature information and the table tennis ball running trajectory feature information and storing them in a new data set Km.
[0028] Furthermore, the process of extracting features of the serving process by using a convolutional neural network (CNN), including the posture of serving, the characteristics of the tossing posture of serving, the control of hitting the ball after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the other half of the table after passing the net, specifically includes the following steps:
[0029] S31: extracting image data from the data set Km for preprocessing, using image smoothing, noise removal, and binarization operation procedures to process the image data in Km, enhancing image quality, and using a convolutional neural network CNN to extract features;
[0030] S32: obtaining serving speed information by calculating the displacement between adjacent frames according to the movement trajectory of the player serving in the image;
[0031] S33: Analyze the continuous changes of the image frames during the athlete's serving process, and extract the posture features of the serving, the posture features of the serving tossing, and the hitting control after tossing by using the YOLOv8 algorithm;
[0032] S34: analyzing the motion trajectory of the table tennis ball, using contour tracking image processing technology to identify and track the motion trajectory of the table tennis ball, thereby extracting motion trajectory features, wherein the motion trajectory features include the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net;
[0033] S35: Integrate and encode the extracted posture features of serving, posture features of tossing the ball, ball hitting control after tossing the ball, motion trajectory of the table tennis ball landing point on the own half of the table after serving, motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and trajectory features of the table tennis ball landing point on the opponent's half of the table after passing the net, and store the encoded data in a new data set Kn, wherein a part of the new data set is used for training set data, and the other part is used for test set data;
[0034] The ball hitting control after throwing the ball specifically includes ball hitting timing control, ball rotation control and ball speed control.
[0035] Furthermore, the LSTM-A is used for training before the table tennis ball contacts the table tennis racket, and the LSTM-B is used for training after the table tennis ball leaves the table tennis racket. The output result of the LSTM-A training is used as the input of the LSTM-B, which is specifically implemented as follows:
[0036] M1: The LSTM-A is a two-layer model, the first layer is used for training the posture features of serving, and the second layer is used for training the posture features of serving and the hitting control after serving;
[0037] M2: The LSTM-B is a single-layer model, which is used for training the first stage learning task, the second stage learning task, the third stage learning task and the fourth stage learning task;
[0038] M3: The output result of the LSTM unit of the first layer of the LSTM-A is the body posture of the serve, which is used as the input of the second layer of the LSTM-A, and the serve action is performed in combination with the tossing posture feature of the serve;
[0039] The transfer learning is mainly used for posture planning of serving. The specific steps are:
[0040] A1: Build the first layer of LSTM-A model to describe the posture process of the robot serving a table tennis ball;
[0041] A2: Acquire and process the player's serving posture data and the target's posture data;
[0042] A3: Use the posture recognition algorithm GaitSet to extract features from the robot's serving posture data and the athlete's serving posture data respectively;
[0043] A4: Use deep reinforcement learning and transfer learning to learn the characteristics of the athlete's serving posture, and then plan the robot's serving posture;
[0044] The step A1 specifically includes the following steps:
[0045] A11: Establish a 4-link robot model with knee arc-shaped feet; the robot model includes 2 thighs, 2 shanks and 2 arc-shaped feet. The legs are connected together by steel rods through hinges. The arc-shaped feet are fixedly connected to the shanks. Two motors are set at the knee joints to apply control torque to the supporting shanks and swinging thighs respectively.
[0046] A12: Analyze the process from when the robot picks up the racket to when it throws the ball up and then the ball collides with the racket;
[0047] The A3 step specifically includes the following steps:
[0048] A31: The process from when the athlete and the robot pick up the racket to when the ball is thrown until it collides with the racket is defined as a posture cycle;
[0049] A32: Taking the robot model as a reference, take the 2D plane horizontal to the athlete's posture, from left to right, define the athlete's posture state as A1, use A1 to represent all the data in the athlete's posture process description, and use A1 as a row vector to combine and obtain the athlete's posture data A1;
[0050] A33: Select a posture cycle from the athlete's posture data A1 as the learning object of the robot, extract the odd frames in the learning object data to form a new data set, and define it as the target posture data A2, wherein any row vector in the target posture data A2 is extracted from A1;
[0051] A34: sampling the robot's posture state A2 in the posture cycle according to the sampling frequency in A1 to form the robot's posture data A3;
[0052] In the A4 step, the deep deterministic policy gradient algorithm PPO is selected as the learning algorithm of the robot. During the continuous serving process, the robot collects data of different body postures and provides them to the deep deterministic policy gradient algorithm for training. At the same time, serving training is performed through transfer learning, so that the deep deterministic policy gradient algorithm finally has the ability to control the robot to complete the serve.
[0053] Furthermore, the extracted serving process features are modeled by using a long short-term memory artificial neural network LSTM model and a SVM classifier, and establishing a table tennis serving model specifically includes the following steps:
[0054] S41: extracting feature vector data from the data set Kn;
[0055] S42: After completing the preprocessing of the data, the preprocessed data is processed using a dual LSTM model to obtain a plurality of serialized feature vectors, a cross entropy loss function is used to calculate the plurality of serialized feature vectors obtained to obtain a loss value of the dual LSTM model, a stochastic gradient descent algorithm is used to train the dual LSTM model, and the training set data is used for training to obtain a trained dual LSTM model;
[0056] S43: Update the SVM classifier according to the trained dual LSTM model to obtain a new SVM classifier, and construct a trained table tennis serve model according to the obtained trained dual LSTM model and the new SVM classifier. The SVM represents a support vector machine, and the output classification feature matrix is Among them, M i Indicates the number of times the serve is trained, i = 1, 2...n, N j represents the jth learning task in a training, and the learning tasks include the learning tasks of the first stage, the learning tasks of the second stage, the learning tasks of the third stage and the learning tasks of the fourth stage.
[0057] Further, the training goal of the first stage is to make the serving racket contact the ball;
[0058] By completing the training objectives of the first stage and the rewards and penalties of the learning tasks of the first stage, reinforcement learning of serve training is performed to obtain the first serve reinforcement training model;
[0059] Based on the first serve reinforcement training model, the training goal of the second stage, and the learning task reward and punishment, reinforcement learning of serve training is performed to obtain a second serve reinforcement training model, wherein the training goal of the second stage is to make the serve leave the racket and form a landing trajectory on the own half of the table;
[0060] Based on the second serve reinforcement training model, the training goal of the third stage, and the learning task reward and punishment, reinforcement learning of serve training is performed to obtain a third serve reinforcement training model, wherein the training goal of the third stage is to make the table tennis ball bounce from the landing point of the own half of the table over the table tennis net.
[0061] Based on the third serve reinforcement training model, the training objectives of the fourth stage, and the learning task rewards and penalties, reinforcement learning of serve training is performed to obtain the fourth serve reinforcement training model. The training objective of the fourth stage is to make the trajectory of the table tennis ball landing on the opponent's half of the table after passing the net.
[0062] Further, the classification feature matrix outputted in step S43 is: Calculate the rewards and penalties for each stage of learning tasks and the deviation loss of each stage of learning tasks;
[0063] The deviation loss is calculated as:
[0064]
[0065] in, represents the goal of the learning task at stage j, Indicates the degree of completion of the j-th stage learning task. The coefficients k0, k1, k2, k3 and the boundaries m1 and m2 of the value range satisfy the following constraints:
[0066]
[0067] The reward weight function of the learning task at each stage is:
[0068] reward j =α*reward all +(1-α)*reward i,j ,
[0069] Among them, reward all Represents the global stage weight, a complete table tennis serve process, reward i,,j Represents the local stage weight, which is the j-th stage learning task in the i-th serve process. The reward weight of the learning task in each stage is composed of the weighted sum of the local stage weight and the global stage weight. The coefficient α determines the importance of the global stage and the local stage in this calculation. The calculation function of the global stage weight is:
[0070]
[0071] The process i,j represents the j-th stage learning task value in the i-th serve process, represents the target value of the j-th stage learning task in the i-th serve process, k is the scaling factor, the coefficient γ determines the range of the function, and i represents the number of serve trainings, starting from 1;
[0072] The calculation function of the local stage weight is:
[0073]
[0074] The rewards for the first stage of learning tasks are:
[0075] A*reward1,
[0076] The rewards for the second stage of learning tasks are:
[0077] B*reward2,
[0078] The learning task rewards for the third stage are:
[0079] C*reward3,
[0080] The learning task rewards for the fourth stage are:
[0081] D*reward4,
[0082] Where A, B, C, and D represent the learning task reward base value of the first stage, the learning task reward base value of the second stage, the learning task reward base value of the third stage, and the learning task reward base value of the fourth stage respectively;
[0083] The reward value of a table tennis training for the robot is:
[0084] W i =A*reward1+B*reward2+C*reward3+D*reward4.
[0085] Furthermore, the penalty function of the learning task at each stage is:
[0086]
[0087] Among them, j represents the number of serving training, Q is the average loss value of the deviation of one serving training, Y is the threshold, qq is the penalty value,
[0088]
[0089] Each penalty is processed according to the average loss value of the deviation from the previous serve training. If Q is greater than the threshold Y, penalty measures are taken.
[0090] Furthermore, the specific process of evaluating whether the robot has learned to serve a table tennis ball is as follows:
[0091] The classification feature matrix output according to step S43 is Evaluate whether the robot has learned to serve a ping-pong ball. The evaluation is divided into three levels: not learned, learned, and excellent.
[0092] The learning level, for the classification feature matrix is Serve N times in a row, and complete all 4 stages of learning tasks each time;
[0093] The excellent level, for the classification feature matrix is Serve N times in a row, complete all 4 stages of learning tasks each time, and the reward value of each training is greater than the threshold Q;
[0094] The unlearned level, for the classification feature matrix is Serve N times in a row, and at least one of the four stages of learning tasks is not completed each time.
[0095] The serving implementation system 20 of the intelligent table tennis serving robot based on AI comprises:
[0096] An acquisition module 201 is used to collect the player's serving action process through a camera and extract key features of the serving process using an image recognition algorithm;
[0097] A deep learning module 202 is used to train a table tennis task feature extractor through a deep learning method in a simulation environment, establish a table tennis serving model through transfer learning of the robot's serving posture combined with deep learning, and generate a classification matrix for the task;
[0098] The reinforcement learning module 203 is used to apply the learning tasks of the four stages to the reinforcement learning. By setting learning goals for the learning tasks and setting corresponding rewards and punishments, the output results are obtained by reinforcement learning of serving training on the target points. The output results include the joint parameters of each joint of the robot, and the joint parameters include joint positions and joint velocities. The output results are used to control the robot to serve.
[0099] The storage medium is characterized in that an executable program is stored therein, and the executable program is executed by a controller to implement the serving method of the AI-based intelligent table tennis serving robot described in any one of claims 1-8.
[0100] The beneficial effects of the AI-based intelligent table tennis serving robot of the present invention are as follows:
[0101] The present invention collects the serving action process of the athlete through a camera, and uses an image recognition algorithm to extract features in the serving process, including body posture, serving racket posture, serving racket speed, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table through the table tennis net, and the trajectory of the table tennis ball landing point on the other half of the table after passing the net. A table tennis serving model is established for the extracted serving process features through a long short-term memory artificial neural network LSTM and a SVM classifier, and a serving learning matrix for a classification task is generated. The table tennis serving model is input into a serving robot for reinforcement learning. Rewards and penalties are performed by setting training goals and learning tasks for each stage. The reward function is a balanced reward measure based on the local weights of the learning tasks at different stages of a complete serving task and the global stage weights. The penalty function is processed based on the deviation average loss value of a training. Punish those serves that result in high deviation losses. Through these reward and penalty measures, the serving racket can be contacted with the ball, the ball is directed toward the own half of the table and successfully landed, it can successfully bounce over the table tennis net after landing on the own half of the table, and the table tennis ball lands on the opponent's half of the table as soon as possible. The serving learning matrix is used to evaluate the effect of the robot's serving training, and further achieve the goal of completing the robot's serving training. By establishing a robot posture model, the athlete's serving posture data and target posture data are obtained and processed. The posture recognition algorithm GaitSet is used to extract the features of the robot's serving posture data and the athlete's serving posture data, respectively. The athlete's serving posture features are learned using deep reinforcement learning and transfer learning, and then the robot's serving posture is planned. The serving posture can coordinate the robot to learn to play table tennis faster and complete learning tasks at different stages. The present invention combines deep learning, reinforcement learning and transfer learning, which can significantly reduce the number of interactions between the robot and the real environment and improve the robot's serving flexibility. By setting local and global balanced reward functions and high deviation loss penalty measures, the robot can quickly learn the serving task and learn the complex serving skills of different athletes, thereby reducing the serving error rate. By establishing a robot posture model, the serving action can be better optimized and the robot can learn to serve faster. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] Figure 1 It is a flow chart of a method for realizing serving of an intelligent table tennis serving robot based on AI of the present invention;
[0103] Figure 2 A schematic diagram of a serving system of an AI-based intelligent table tennis serving robot according to the present invention;
[0104] Figure 3 A schematic diagram of a flow chart of preprocessing collected video data according to the present invention;
[0105] Figure 4It is a schematic diagram of the process of extracting features of the serving process by using a convolutional neural network (CNN) in the present invention;
[0106] Figure 5 It is a flow chart of the body posture for serving the ball according to the present invention.
[0107] Among them, 20-AI-based intelligent table tennis serving robot serving implementation system, 201-acquisition module, 202-deep learning module, 203-reinforcement learning module. DETAILED DESCRIPTION
[0108] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0109] Example 1
[0110] First, the technical terms involved in the embodiments of the present application are explained.
[0111] (1) LSTM model
[0112] LSTM (Long Short-Term Memory) is a special type of recurrent neural network (RNN). It is designed to solve the gradient vanishing and gradient exploding problems encountered by traditional RNN when processing long sequence data. LSTM controls the flow of information by introducing gated mechanisms, so that it can learn long-term dependencies. LSTM models are widely used in natural language processing (NLP), speech recognition, time series analysis and many other fields.
[0113] (2) Convolutional Neural Network
[0114] Convolutional Neural Network (CNN) is a deep learning model that performs well in image and video recognition, recommendation systems, natural language processing, and other fields. The design of CNN imitates the working principle of the human visual system. Through layer-by-layer abstraction, it can automatically learn useful feature representations from raw data. This ability makes CNN particularly effective in processing data with a strong spatial hierarchical structure.
[0115] (3) Reinforcement Learning
[0116] Reinforcement Learning (RL) is an important branch of machine learning. It mainly studies how an agent can discover the behavior strategy of obtaining the maximum cumulative reward in a specific environment through trial and error without explicit instructions. Reinforcement learning has applications in many fields, including games, robots, self-driving cars, resource management, and recommendation systems.
[0117] (4) Transfer Learning
[0118] Transfer learning is a technique in the field of machine learning that allows the knowledge gained by a model on one task to be applied to another different but related task. This method is particularly suitable for new tasks with less data because the model trained on a large data set can be used as a starting point, thereby reducing dependence on large amounts of labeled data.
[0119] Figure 1 The present invention is a flowchart of a method for implementing the serving of an AI-based intelligent table tennis serving robot.
[0120] The method comprises the following steps S101-S110:
[0121] S101: collecting the serving action of the table tennis player, collecting the serving action process of the player through a camera, and shooting a complete serving action video, wherein the complete serving action video includes the serving posture, serving tossing posture characteristics, hitting control after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table through the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net, and storing the shot video in a database;
[0122] S102: pre-processing the collected video data, converting the video into images and performing segmentation to eliminate the background;
[0123] S103: extracting features of the serving process through a convolutional neural network (CNN), including the serving posture, the serving racket posture, the serving toss posture features, the hitting control after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net;
[0124] S104: Modeling the extracted serving process features through a long short-term memory artificial neural network LSTM and a SVM classifier, and establishing a dual LSTM model for table tennis serving, wherein the dual LSTM model is divided into LSTM-A and LSTM-B, wherein LSTM-A is used for training before the table tennis ball contacts the table tennis racket, and LSTM-B is used for training after the table tennis ball leaves the table tennis racket, and the output result of the LSTM-A training is used as the input of the LSTM-B, and training is performed;
[0125] S105: inputting the table tennis serving model into the serving robot for serving training, wherein the serving training adopts reinforcement learning and transfer learning, and the transfer learning is mainly used for posture planning of serving;
[0126] S106: setting the training goal of the first stage and the reward and penalty of the learning task of the first stage to perform reinforcement learning of the serve training, and obtaining a first serve reinforcement training model, wherein the first serve reinforcement training model is to make the serving racket contact the ball, and the penalty is determined according to the deviation loss between the training goal of the first stage and the learning task of the first stage;
[0127] S107: setting the training goal of the second stage and the reward and penalty of the learning task of the second stage to perform reinforcement learning of the serve training, and obtaining a second serve reinforcement training model, wherein the second serve reinforcement training model is to make the serve leave the racket and form a landing point trajectory on the own half of the table, and the penalty is determined according to the deviation loss between the training goal of the second stage and the learning task of the second stage;
[0128] S108: setting the training goal of the third stage and the reward and penalty of the learning task of the third stage to perform reinforcement learning of the serve training, and obtaining a third serve reinforcement training model, wherein the third serve reinforcement training model is a movement trajectory of a table tennis ball that bounces from a landing point on the own half of the table over the table tennis net, and the penalty is determined according to the deviation loss between the training goal of the third stage and the learning task of the third stage;
[0129] S109: setting the training goal of the fourth stage and the reward and penalty of the learning task of the fourth stage to perform reinforcement learning of the serve training, and obtaining a fourth serve reinforcement training model, wherein the fourth serve reinforcement training model is to make the trajectory of the table tennis ball landing on the opponent's half of the table after passing the net, and the penalty is determined according to the deviation loss between the training goal of the fourth stage and the learning task of the fourth stage;
[0130] S110: After four stages of intensive training, an output result is obtained, and the robot's serve training is evaluated to evaluate whether the robot has learned to serve a table tennis ball and the learning effect. If the robot has not learned to serve, the robot continues to perform the four-stage learning task until it learns to serve.
[0131] Example 2, this example is based on the above example, please refer to Figure 3The preprocessing of the collected video data, converting the video into an image and performing segmentation, and eliminating the background specifically include the following steps:
[0132] S21: Read a complete serving action video data from the database;
[0133] S22: converting the video data into an image sequence, and performing analysis and processing on each frame of the image;
[0134] S23: using a background subtraction algorithm to eliminate the background part of the image, further highlighting the characteristics of the athlete's serve and the characteristics of the table tennis ball's motion trajectory;
[0135] S24: further processing the image after removing the background, extracting the player's serve feature information and the table tennis ball running trajectory feature information and storing them in a new data set Km.
[0136] Example 3, this example is based on the above example, please refer to Figure 4 The process of extracting features of the serving process by using a convolutional neural network (CNN), including the posture of serving, the characteristics of the tossing posture of serving, the control of hitting the ball after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the other half of the table after passing the net, specifically includes the following steps:
[0137] S31: extracting image data from the data set Km for preprocessing, using image smoothing, noise removal, and binarization operation procedures to process the image data in Km, enhancing image quality, and using a convolutional neural network CNN to extract features;
[0138] S32: obtaining serving speed information by calculating the displacement between adjacent frames according to the movement trajectory of the player serving in the image;
[0139] S33: Analyze the continuous changes of the image frames during the athlete's serving process, and extract the posture features of the serving, the posture features of the serving tossing, and the hitting control after tossing by using the YOLOv8 algorithm;
[0140] S34: analyzing the motion trajectory of the table tennis ball, using contour tracking image processing technology to identify and track the motion trajectory of the table tennis ball, thereby extracting motion trajectory features, wherein the motion trajectory features include the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net;
[0141] S35: Integrate and encode the extracted posture features of serving, posture features of tossing the ball, ball hitting control after tossing the ball, motion trajectory of the table tennis ball landing point on the own half of the table after serving, motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and trajectory features of the table tennis ball landing point on the opponent's half of the table after passing the net, and store the encoded data in a new data set Kn, wherein a part of the new data set is used for training set data, and the other part is used for test set data;
[0142] The ball hitting control after throwing the ball specifically includes ball hitting timing control, ball rotation control and ball speed control.
[0143] 5. Example 4, based on the above example, the LSTM-A is used for training before the table tennis ball contacts the table tennis racket, and the LSTM-B is used for training after the table tennis ball leaves the table tennis racket. The output result of the LSTM-A training is used as the input of the LSTM-B. The specific implementation is as follows:
[0144] M1: The LSTM-A is a two-layer model, the first layer is used for training the posture features of serving, and the second layer is used for training the posture features of serving and the hitting control after serving;
[0145] M2: The LSTM-B is a single-layer model, which is used for training the first stage learning task, the second stage learning task, the third stage learning task and the fourth stage learning task;
[0146] M3: The output result of the LSTM unit of the first layer of the LSTM-A is the body posture of the serve, which is used as the input of the second layer of the LSTM-A, and the serve action is performed in combination with the tossing posture feature of the serve;
[0147] The extracted serving process features are modeled by using a long short-term memory artificial neural network LSTM model and a SVM classifier, and the table tennis serving model is established, specifically comprising the following steps:
[0148] S41: extracting feature vector data from the data set Kn;
[0149] S42: After completing the preprocessing of the data, the preprocessed data is processed using the LSTM model to obtain a plurality of serialized feature vectors, a cross entropy loss function is used to calculate the plurality of serialized feature vectors obtained to obtain a loss value of the LSTM model, a stochastic gradient descent algorithm is used to train the dual LSTM model, and the training set data is used for training to obtain a trained dual LSTM model;
[0150] S43: Update the SVM classifier according to the trained dual LSTM model to obtain a new SVM classifier, and construct a trained table tennis serve model according to the obtained trained dual LSTM model and the new SVM classifier. The SVM represents a support vector machine, and the output classification feature matrix is Among them, M i Indicates the number of times the serve is trained, i = 1, 2...n, N j represents the jth learning task in a training, and the learning tasks include the learning tasks of the first stage, the learning tasks of the second stage, the learning tasks of the third stage and the learning tasks of the fourth stage.
[0151] Embodiment 5, based on the above embodiment, the training goal of the first stage is to make the serving racket contact the ball;
[0152] By completing the training objectives of the first stage and the rewards and penalties of the learning tasks of the first stage, reinforcement learning of serve training is performed to obtain the first serve reinforcement training model;
[0153] Based on the first serve reinforcement training model, the training goal of the second stage, and the learning task reward and punishment, reinforcement learning of serve training is performed to obtain a second serve reinforcement training model, wherein the training goal of the second stage is to make the serve leave the racket and form a landing trajectory on the own half of the table;
[0154] Based on the second serve reinforcement training model, the training goal of the third stage, and the learning task reward and punishment, reinforcement learning of serve training is performed to obtain a third serve reinforcement training model, wherein the training goal of the third stage is to make the table tennis ball bounce from the landing point of the own half of the table over the table tennis net.
[0155] Based on the third serve reinforcement training model, the training objectives of the fourth stage, and the learning task rewards and penalties, reinforcement learning of serve training is performed to obtain the fourth serve reinforcement training model. The training objective of the fourth stage is to make the trajectory of the table tennis ball landing on the opponent's half of the table after passing the net.
[0156] Embodiment 6, based on the above embodiment, the classification feature matrix outputted in step S43 is: Calculate the rewards and penalties for each stage of learning tasks and the deviation loss of each stage of learning tasks;
[0157] The deviation loss is calculated as:
[0158]
[0159] in, represents the goal of the learning task at stage j, Indicates the degree of completion of the learning task at stage j. The coefficients k0, k1, k2, k3 and the boundaries m1 and m2 of the value range satisfy the following constraints:
[0160]
[0161] The reward weight function of the learning task at each stage is:
[0162] reward j =α*reward all +(1-α)*reward i,j ,
[0163] Among them, reward all Represents the global stage weight, a complete table tennis serve process, reward i,,j Represents the local stage weight, which is the j-th stage learning task in the i-th serve process. The reward weight of the learning task in each stage is composed of the weighted sum of the local stage weight and the global stage weight. The coefficient α determines the importance of the global stage and the local stage in this calculation. The calculation function of the global stage weight is:
[0164]
[0165] The process i,j represents the j-th stage learning task value in the i-th serve process, represents the target value of the j-th stage learning task in the i-th serve process, k is the scaling factor, the coefficient γ determines the range of the function, and i represents the number of serve trainings, starting from 1;
[0166] The calculation function of the local stage weight is:
[0167]
[0168] The rewards for the first stage of learning tasks are:
[0169] A*reward1,
[0170] The rewards for the second stage of learning tasks are:
[0171] B*reward2,
[0172] The learning task rewards for the third stage are:
[0173] C*reward3,
[0174] The learning task rewards for the fourth stage are:
[0175] D*reward4,
[0176] Where A, B, C, and D represent the learning task reward base value of the first stage, the learning task reward base value of the second stage, the learning task reward base value of the third stage, and the learning task reward base value of the fourth stage respectively;
[0177] The reward value of a table tennis training for the robot is:
[0178] W i =A*reward1+B*reward2+C*reward3+D*reward4.
[0179] Furthermore, the penalty function of the learning task at each stage is:
[0180]
[0181] Among them, i represents the number of serving training, Q is the average deviation loss value of one serving training, Y is the threshold, qq is the penalty value,
[0182]
[0183] Each penalty is processed according to the average loss value of the deviation from the previous serve training. If Q is greater than the threshold, penalty measures are taken.
[0184] Furthermore, the specific process of evaluating whether the robot has learned to serve a table tennis ball is as follows:
[0185] The classification feature matrix output according to step S43 is Evaluate whether the robot has learned to serve a ping-pong ball. The evaluation is divided into three levels: not learned, learned, and excellent.
[0186] The learning level, for the classification feature matrix is After serving 100 times in a row, the robot completes all four stages of learning tasks each time, indicating that the robot has learned to serve.
[0187] The excellent level, for the classification feature matrix is Serve 100 times in a row, complete all 4 stages of learning tasks each time, and the reward value of each training is greater than the threshold of 100;
[0188] The unlearned level, for the classification feature matrix is Serve 100 times in a row, and at least one of the 4 stages of learning tasks is not completed each time.
[0189] Embodiment 7, this embodiment is based on the above embodiment, such as Figure 5 ,
[0190] Transfer learning is mainly used for posture planning of serving. The specific steps are:
[0191] A1: Build the first layer model of LSTM-A to describe the posture process of the robot serving a table tennis ball;
[0192] A2: Acquire and process the player's serving posture data and the target's posture data;
[0193] A3: Use the posture recognition algorithm GaitSet to extract features from the robot's serving posture data and the athlete's serving posture data respectively;
[0194] A4: Use deep reinforcement learning and transfer learning to learn the characteristics of the athlete's serving posture, and then plan the robot's serving posture;
[0195] The step A1 specifically includes the following steps:
[0196] A11: Establish a 4-link robot model with knee arc-shaped feet; the robot model includes 2 thighs, 2 shanks and 2 arc-shaped feet. The legs are connected together by steel rods through hinges. The arc-shaped feet are fixedly connected to the shanks. Two motors are set at the knee joints to apply control torque to the supporting shanks and swinging thighs respectively.
[0197] A12: Analyze the process from when the robot picks up the racket to when it throws the ball up and then the ball collides with the racket;
[0198] The A3 step specifically includes the following steps:
[0199] A31: The process from when the athlete and the robot pick up the racket to when the ball is thrown until it collides with the racket is defined as a posture cycle;
[0200] A32: Taking the robot model as a reference, take the 2D plane horizontal to the athlete's posture, from left to right, define the athlete's posture state as A1, use A1 to represent all the data in the athlete's posture process description, and use A1 as a row vector to combine and obtain the athlete's posture data A1;
[0201] A33: Select a posture cycle from the athlete's posture data A1 as the learning object of the robot, extract the odd frames in the learning object data to form a new data set, and define it as the target posture data A2, wherein any row vector in the target posture data A2 is the extracted A1;
[0202] A34: sampling the robot's posture state A2 in the posture cycle according to the sampling frequency in A1 to form the robot's posture data A3;
[0203] In the step A4, a deep deterministic policy gradient algorithm PPO is selected as the learning algorithm of the robot. During the continuous serving process, the robot collects data of different postures and provides the data to the deep deterministic policy gradient algorithm for training. At the same time, through transfer learning, the deep deterministic policy gradient algorithm is finally able to control the robot to reach and complete the serve.
[0204] Embodiment 8, based on the above embodiment, is an AI-based intelligent table tennis serving robot serving implementation system 20, which includes:
[0205] An acquisition module 201 is used to collect the player's serving action process through a camera and extract key features of the serving process using an image recognition algorithm;
[0206] A deep learning module 202 is used to train a table tennis task feature extractor through a deep learning method in a simulation environment, establish a table tennis serving model through transfer learning of the robot's serving posture combined with deep learning, and generate a classification matrix for the task;
[0207] The reinforcement learning module 203 is used to apply the learning tasks of the four stages to the reinforcement learning. By formulating learning goals for the learning tasks and setting corresponding rewards and punishments, the output results are obtained by reinforcement learning of serving training at the target points. The output results include the joint parameters of each joint of the robot, and the joint parameters include joint positions and joint velocities.
[0208] The beneficial effects of the AI-based intelligent table tennis serving robot of the present invention are as follows:
[0209] The present invention collects the serving action process of an athlete through a camera, and uses an image recognition algorithm to extract features in the serving process, including body posture, serving racket posture, serving racket speed, the motion trajectory of a table tennis ball landing point on one's own half of the table after serving, the motion trajectory of a table tennis ball bouncing from the landing point on one's own half of the table through a table tennis net, and the trajectory of a table tennis ball landing point on the other's half of the table after passing the net. A table tennis serving model is established for the extracted serving process features through a long short-term memory artificial neural network LSTM and a SVM classifier, and a serving learning matrix of a classification task is generated. The table tennis serving model is input into a serving robot for reinforcement learning. Rewards and penalties are performed by setting training goals and learning tasks at each stage. The reward function is a balanced reward measure based on the local weights of learning tasks at different stages of a complete serving task and the global stage weights. The penalty function is processed based on the deviation average loss value of a training. Punish those serves that result in high deviation losses. Through these reward and penalty measures, the serving racket can be contacted with the ball, the ball is directed toward the own half of the table and successfully landed, it can successfully bounce over the table tennis net after landing on the own half of the table, and the table tennis ball lands on the opponent's half of the table as soon as possible. The serving learning matrix is used to evaluate the effect of the robot's serving training, and further achieve the goal of completing the robot's serving training. By establishing a robot posture model, the athlete's serving posture data and target posture data are obtained and processed. The posture recognition algorithm GaitSet is used to extract the features of the robot's serving posture data and the athlete's serving posture data, respectively. The athlete's serving posture features are learned using deep reinforcement learning and transfer learning, and then the robot's serving posture is planned. The serving posture can coordinate the robot to learn to play table tennis faster and complete learning tasks at different stages. The present invention combines deep learning, reinforcement learning and transfer learning, which can greatly reduce the number of interactions between the robot and the real environment and improve the robot's serving flexibility. By setting local and global balanced reward functions and penalty measures for high deviation losses, it is ensured that the robot quickly learns the serving task and learns the complex serving skills of different athletes, reducing the serving error rate. By establishing a robot posture model, the posture of the serving robot is better combined with the serving task, the serving action is better optimized, and the robot learns to serve faster.
[0210] The present invention and its embodiments are described above, which is not restrictive. What is shown in the accompanying drawings is only one of the embodiments of the present invention, and the actual content is not limited to this. In short, if ordinary technicians in this field are inspired by it and do not deviate from the purpose of the invention, they can creatively design structural methods and embodiments similar to the technical scheme, which should all fall within the scope of protection of the present invention.
Claims
1. The serving method of the AI-based intelligent table tennis serving robot. It is characterized in that The method comprises: S101: collecting the serving action of the table tennis player, collecting the serving action process of the player through a camera, and shooting a complete serving action video, wherein the complete serving action video includes the serving posture, serving tossing posture characteristics, hitting control after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table through the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net, and storing the shot video in a database; S102: pre-processing the collected video data, converting the video into images and performing segmentation to eliminate the background; S103: extracting features of the serving process through a convolutional neural network (CNN), including the serving posture, the serving racket posture, the tossing posture features of the serving, the hitting control after the tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after the serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net; S104: Modeling the extracted serving process features through a long short-term memory artificial neural network LSTM and a SVM classifier, and establishing a dual LSTM model for table tennis serving, wherein the dual LSTM model is divided into LSTM-A and LSTM-B, wherein LSTM-A is used for training before the table tennis ball contacts the table tennis racket, and LSTM-B is used for training after the table tennis ball leaves the table tennis racket, and the output result of the LSTM-A training is used as the input of the LSTM-B, and training is performed; S105: inputting the table tennis serving model into the serving robot for serving training, wherein the serving training adopts reinforcement learning and transfer learning, and the transfer learning is mainly used for posture planning of serving; S106: setting the training goal of the first stage and the reward and penalty of the learning task of the first stage to perform reinforcement learning of the serve training, and obtaining a first serve reinforcement training model, wherein the first serve reinforcement training model is to make the serving racket contact the ball, and the penalty is determined according to the deviation loss between the training goal of the first stage and the learning task of the first stage; S107: setting the training goal of the second stage and the reward and penalty of the learning task of the second stage to perform reinforcement learning of the serve training, and obtaining a second serve reinforcement training model, wherein the second serve reinforcement training model is to make the serve leave the racket and form a landing point trajectory on the own half of the table, and the penalty is determined according to the deviation loss between the training goal of the second stage and the learning task of the second stage; S108: setting the training goal of the third stage and the reward and penalty of the learning task of the third stage to perform reinforcement learning of the serve training, and obtaining a third serve reinforcement training model, wherein the third serve reinforcement training model is a movement trajectory of a table tennis ball that bounces from a landing point on the own half of the table over the table tennis net, and the penalty is determined according to the deviation loss between the training goal of the third stage and the learning task of the third stage; S109: setting the training goal of the fourth stage and the reward and penalty of the learning task of the fourth stage to perform reinforcement learning of the serve training, and obtaining a fourth serve reinforcement training model, wherein the fourth serve reinforcement training model is to make the trajectory of the table tennis ball landing on the opponent's half of the table after passing the net, and the penalty is determined according to the deviation loss between the training goal of the fourth stage and the learning task of the fourth stage; S110: After four stages of intensive training, the output results are obtained, and the robot's serve training is evaluated to evaluate whether the robot has learned to serve the table tennis ball and the learning effect. If the robot has not learned to serve, the four stages of learning tasks are continued until the robot learns to serve.
2. The serving method of the AI-based intelligent table tennis serving robot according to claim 1, It is characterized in that The preprocessing of the collected video data, converting the video into an image and performing segmentation, and eliminating the background specifically includes the following steps: S21: Read a complete serving action video data from the database; S22: converting the video data into an image sequence, and performing analysis and processing on each frame of the image; S23: using a background subtraction algorithm to eliminate the background part of the image, further highlighting the characteristics of the athlete's serve and the characteristics of the table tennis ball's motion trajectory; S24: further processing the image after removing the background, extracting the player's serve feature information and the table tennis ball running trajectory feature information and storing them in a new data set Km.
3. The serving method of the AI-based intelligent table tennis serving robot according to claim 2, It is characterized in that The features of the serving process are extracted by the convolutional neural network (CNN), including the serving posture, the tossing posture features, the hitting control after tossing, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net. Specifically, the steps include: S31: extracting image data from the data set Km for preprocessing, using image smoothing, noise removal, and binarization operation procedures to process the image data in Km, enhancing image quality, and using a convolutional neural network CNN to extract features; S32: obtaining serving speed information by calculating the displacement between adjacent frames according to the movement trajectory of the player serving in the image; S33: Analyze the continuous changes of the image frames during the athlete's serving process, and extract the posture features of the serving, the posture features of the serving tossing, and the hitting control after tossing by using the YOLOv8 algorithm; S34: analyzing the motion trajectory of the table tennis ball, using contour tracking image processing technology to identify and track the motion trajectory of the table tennis ball, thereby extracting motion trajectory features, wherein the motion trajectory features include the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory of the table tennis ball landing point on the opponent's half of the table after passing the net; S35: Integrate and encode the extracted posture features of serving, posture features of tossing the ball, ball hitting control after tossing the ball, the motion trajectory of the table tennis ball landing point on the own half of the table after serving, the motion trajectory of the table tennis ball bouncing from the landing point on the own half of the table over the table tennis net, and the trajectory features of the table tennis ball landing point on the opponent's half of the table after passing the net. The encoded data is stored in a new data set Kn, a part of which is used for training set data, and the other part is used for test set data The ball hitting control after throwing the ball specifically includes ball hitting timing control, ball rotation control and ball speed control.
4. The serving method of the AI-based intelligent table tennis serving robot according to claim 3, It is characterized in that The LSTM-A is used for training before the table tennis ball contacts the table tennis racket, and the LSTM-B is used for training after the table tennis ball leaves the table tennis racket. The output result of the LSTM-A training is used as the input of the LSTM-B. The specific implementation is as follows: M1: The LSTM-A is a two-layer model, the first layer is used for training the posture features of serving, and the second layer is used for training the posture features of serving and the hitting control after serving; M2: The LSTM-B is a single-layer model, which is used for training the first stage learning task, the second stage learning task, the third stage learning task and the fourth stage learning task; M3: The output result of the LSTM unit of the first layer of the LSTM-A is the body posture of the serve, which is used as the input of the second layer of the LSTM-A, and the serve action is performed in combination with the tossing posture feature of the serve; The transfer learning is mainly used for posture planning of serving. The specific steps are: A1: Establish the robot posture model of the first layer of LSTM-A to describe the posture process of the robot serving a table tennis ball; A2: Acquire and process the player's serving posture data and the target's posture data; A3: Use the posture recognition algorithm GaitSet to extract features from the robot's serving posture data and the athlete's serving posture data respectively; A4: Use deep reinforcement learning and transfer learning to learn the characteristics of the athlete's serving posture, and then plan the robot's serving posture; The step A1 specifically includes the following steps: A11: Establish a 4-link robot model with knee arc-shaped feet; the robot model includes 2 thighs, 2 shanks and 2 arc-shaped feet. The legs are connected together by steel rods through hinges. The arc-shaped feet are fixedly connected to the shanks. Two motors are set at the knee joints to apply control torque to the supporting shanks and swinging thighs respectively. A12: Analyze the process from when the robot picks up the racket to when it throws the ball up and then the ball collides with the racket; The A3 step specifically includes the following steps: A31: The process from when the athlete and the robot pick up the racket to when the ball is thrown until it collides with the racket is defined as a posture cycle; A32: Taking the robot model as a reference, take the horizontal 2D plane of the athlete's posture, from left to right, and define the athlete's posture state as A 1 , all the data in the description of the athlete's posture process are used in A 1 Represent it and A 1 As a row vector, we can combine the athlete's posture data A 1 ; A33: From the athlete's posture data A 1 A posture cycle is selected as the learning object of the robot, and the odd frames in the learning object data are extracted to form a new data set, which is defined as the target posture data A 2 , where target posture data A 2 Any row vector in A 1 Extracted; A34: Set the robot's posture state A in the posture cycle 2 According to A 1 The sampling frequency in is used to sample and form the robot posture data A 3 ; In the A4 step, the deep deterministic policy gradient algorithm PPO is selected as the learning algorithm of the robot. During the continuous serving process, the robot collects data of different body postures and provides them to the deep deterministic policy gradient algorithm for training. At the same time, serving training is performed through transfer learning, so that the deep deterministic policy gradient algorithm finally has the ability to control the robot to complete the serve.
5. The serving method of the AI-based intelligent table tennis serving robot according to claim 4, It is characterized in that The extracted serving process features are modeled by using a long short-term memory artificial neural network LSTM model and a SVM classifier, and the table tennis serving model is established, specifically comprising the following steps: S41: extracting feature vector data from the data set Kn; S42: After completing the preprocessing of the data, the preprocessed data is processed using a dual LSTM model to obtain a plurality of serialized feature vectors, a cross entropy loss function is used to calculate the plurality of serialized feature vectors obtained to obtain a loss value of the dual LSTM model, a stochastic gradient descent algorithm is used to train the dual LSTM model, and the training set data is used for training to obtain a trained dual LSTM model; S43: Update the SVM classifier according to the trained dual LSTM model to obtain a new SVM classifier, and construct a trained table tennis serve model according to the obtained trained dual LSTM model and the new SVM classifier. The SVM represents a support vector machine, and the output classification feature matrix is Among them, M i Indicates the number of times the serve is trained, i = 1, 2...n, N j represents the jth learning task in a training, and the learning tasks include the learning tasks of the first stage, the learning tasks of the second stage, the learning tasks of the third stage and the learning tasks of the fourth stage.
6. The serving method of the AI-based intelligent table tennis serving robot according to claim 5, It is characterized in that The training goal of the first stage is to make the serving racket contact the ball; By completing the training objectives of the first stage and the rewards and penalties of the learning tasks of the first stage, reinforcement learning of serve training is performed to obtain the first serve reinforcement training model; Based on the first serve reinforcement training model, the training goal of the second stage, and the learning task reward and punishment, reinforcement learning of serve training is performed to obtain a second serve reinforcement training model, wherein the training goal of the second stage is to make the serve leave the racket and form a landing trajectory on the own half of the table; Based on the second serve reinforcement training model, the training goal of the third stage, and the learning task reward and punishment, reinforcement learning of serve training is performed to obtain a third serve reinforcement training model, wherein the training goal of the third stage is to make the table tennis ball bounce from the landing point of the own half of the table over the table tennis net. Based on the third serve reinforcement training model, the training objectives of the fourth stage, and the learning task rewards and penalties, reinforcement learning of serve training is performed to obtain the fourth serve reinforcement training model. The training objective of the fourth stage is to make the trajectory of the table tennis ball landing on the opponent's half of the table after passing the net.
7. The serving method of the AI-based intelligent table tennis serving robot according to claim 6, It is characterized in that The classification feature matrix output according to step S43 is Calculate the rewards and penalties for each stage of learning tasks and the deviation loss of each stage of learning tasks; The deviation loss is calculated as: in, represents the goal of the learning task at stage j, Indicates the degree of completion of the learning task in the jth stage, coefficient k 0 , k 1 , k 2 , k 3 and the boundary m of the value range 1 , m 2 The following constraints are met: The reward weight function of the learning task at each stage is: reward j =α*reward all +(1-α)*reward i,j , Among them, reward all Represents the global stage weight, a complete table tennis serve process, reward i,,j Represents the local stage weight, which is the j-th stage learning task in the i-th serve process. The reward weight of the learning task in each stage is composed of the weighted sum of the local stage weight and the global stage weight. The coefficient α determines the importance of the global stage and the local stage in this calculation. The calculation function of the global stage weight is: The process i,j represents the j-th stage learning task value in the i-th serve process, represents the target value of the j-th stage learning task in the i-th serve process, k is the scaling factor, the coefficient γ determines the range of the function, and i represents the number of serve trainings, starting from 1; The calculation function of the local stage weight is: The rewards for the first stage of learning tasks are: A*reward 1 , The rewards for the second stage of learning tasks are: B*reward 2 , The learning task rewards for the third stage are: C*reward 3 , The learning task rewards for the fourth stage are: D*reward 4 , Where A, B, C, and D represent the learning task reward base value of the first stage, the learning task reward base value of the second stage, the learning task reward base value of the third stage, and the learning task reward base value of the fourth stage respectively; The reward value of a robot's table tennis training is: W i =A*reward 1 +B*reward 2 +C*reward 3 +D*reward 4 。 8. The serving method of the AI-based intelligent table tennis serving robot according to claim 7, It is characterized in that The penalty function of the learning task at each stage is: Among them, i represents the number of serving training, Q is the average deviation loss value of one serving training, Y is the threshold, qq is the penalty value, Each penalty is processed according to the average loss value of the deviation from the previous serve training. If Q is greater than the threshold Y, a penalty is imposed.
9. The serving method of the AI-based intelligent table tennis serving robot according to claim 8, It is characterized in that The specific process of evaluating whether the robot has learned to serve a ping-pong ball is as follows: The classification feature matrix output according to step S43 is Evaluate whether the robot has learned to serve a ping-pong ball. The evaluation is divided into three levels: not learned, learned, and excellent. The learning level, for the classification feature matrix is Serve N times in a row, and complete all 4 stages of learning tasks each time; The excellent level, for the classification feature matrix is Serve N times in a row, complete all 4 stages of learning tasks each time, and the reward value of each training is greater than the threshold Q; The unlearned level, for the classification feature matrix is Serve N times in a row, and at least one of the four stages of learning tasks is not completed each time.
10. AI-based intelligent table tennis serving robot serving system, It is characterized in that It includes: An acquisition module (201) is used to collect the player's serving action process through a camera and extract key features of the serving process using an image recognition algorithm; A deep learning module (202) is used to train a table tennis task feature extractor by a deep learning method in a simulation environment, establish a table tennis serving model by combining transfer learning of the robot's serving posture with deep learning, and generate a classification matrix for the task; The reinforcement learning module (203) is used to apply the learning tasks of the four stages to the reinforcement learning, formulate the learning goals for the learning tasks, and set corresponding rewards and punishments, and obtain the output results by reinforcement learning of serving training at the target point. The output results include the joint parameters of each joint of the robot, and the joint parameters include the joint position and the joint speed. The output results are used to control the robot to serve.
Citation Information
Patent Citations
Batting method and device for table tennis robot
CN110711368A
Badminton player track extraction method based on deep learning
CN111754549A
Ping-pong ball track capture analysis method and system
CN112085761A
Table tennis ball detection method based on improved YOLO V4 algorithm
CN113963299A
End-to-end robot reinforcement learning ball hitting strategy implementation method based on stage rewards
CN115946137A
Cited By
Badminton serving control method and system based on artificial intelligence
CN119185903A
Robot operation reward generation system and method based on video generation
CN119919524A
Behavior-cloned robot continuous trajectory generation method
CN120471093A
