Geometric Parameter Identification of Medical Robot Based on Improved Beetle Antennae Search Algorithm

To improve the accuracy of common intelligent algorithms when identifying the parameters of geometric error in medical robots, this paper proposes an improved beetle antennae search algorithm (RWSAVSBAS). We first establish a model for the kinematic error in medical robots, and then add the random wandering behavior of the wolf colony algorithm to the search process of the beetle antennae search algorithm to strengthen its capability for local search. Following this, we improve the global convergence ability of the beetle antennae search algorithm by using the simulated annealing algorithm. We compare the accuracy of end positioning of the proposed algorithm with the frog-jumping algorithm and the beetle antennae search algorithm with variable step length through simulations. The results show that the proposed algorithm has a higher accuracy of convergence, and can significantly improve the accuracy of end positioning of the medical robot.


Introduction
Advances in Artificial Intelligence have penetrated into all aspects of healthcare in recent years, such as the combination of deep learning with smartphones for the remote monitoring of human activities to provide medical assistance in telemedicine, as reported by Wen et al., and the use of long-short term memory-Recurrent Neural Networks models in surgical robots to enhance their remote manipulation capabilities. Such approaches can improve the quality of treatment offered to patients [1,2].
Medical robots are a landmark product of Artificial Intelligence in medicine, and have the advantages of stability and flexibility. The use of medical robots can substantially improve accuracy and controllability during surgical operations [3]. It also eases the burden on medical personnel; in specific cases, medical robots can help ensure the safety of medical personnel, because they are resistant to radiation. They can also reduce the operating costs of hospitals and, thus, indirectly improve patient care. However, the medical robot itself has many emergency stop conditions, and its accuracy of motion is easily affected by changes in the environment due to the limitations of sensors [4,5]. With the increasing complexity of clinical surgical operations, the positioning accuracy of medical robots needs to be higher as it directly affects patient care and medical outcomes. Little research has been performed to address this issue. This study investigates the positioning accuracy of medical robots.
Positioning error in the operation of the robot mainly originates from errors in the assembly and manufacture of its parts. Software-based methods are the major means of reducing the positioning error of the robot [6,7]. Compensating for this error consists of four steps: modeling the kinematic error, measuring the error in data, identifying the geometric linkage parameter, and error compensation. Once the error model of the robot has been established, commonly used methods of parameter identification include the least-squares method. Wang et al. used the least-squares method to identify the accuracy of end positioning of medical robots by means of simulations [8,9]. In recent years, many researchers have identified geometric errors in robots by using intelligent algorithms, such as Chen et al., who used the particle swarm algorithm. Experimental results proved the effectiveness of their method [10]. Zhao et al. improved the accuracy of absolute positioning of the tandem robot by improving the genetic algorithm used for it [11]. However, the leastsquares method is susceptible to noise, while the particle swarm algorithm tends to fall into the global optimum in later stages, and the coding of the genetic algorithm is complicated. The beetle antennae search (BAS) algorithm has been proposed in recent years, and has the advantages of fast iterations and high accuracy of convergence. For optimizing complex functions, however, the accuracy of convergence of BAS is low [12][13][14]. In this paper, we combine the wandering behavior of the wolf pack algorithm (WPA) with the simulated annealing algorithm and BAS to propose a randomized wandering simulated annealingbased variable-step-length beetle antennae search algorithm (RWSAVSBAS). We use it to identify geometric errors in medical robots to improve their accuracy of localization.
In subsequent sections, we first establish the operational science model of the BH-7 robot, then analyze the principle of RWSAVSBAS and its steps in geometric error calibration of medical robots, and finally, through simulation experiments, the RWSAVSBAS and the Variable-Step Beetle Antennae Search Algorithm (VSBAS) proposed in this paper and Shuffled Frog Leading Algorithm (SFLA), and the experimental results show that the proposed algorithm has higher accuracy in recognition results and can significantly improve the end positioning accuracy of medical robots [15][16][17][18][19].

DH Model Building
We used the BH-7 medical robot for brain surgery as the experimental object [20][21][22]. Its core equipment consists of a positioning system that has been widely used in clinical practice, and offers visual recognition for remote surgical operations. The needle-piercing puncture at the end of the BH-7 robot can reach a specific location under the guidance of the vision system, and the robot works with the end-effector (needle-threading stab) that moves to the corresponding position under the action of a torque motor, as shown in Figure 1 below. The kinematics of this robot are modeled by the classical DH model. The robot has been used in a robotic system for positioning for brain surgery [23], and its accuracy was tested during the operation through the following steps: (1) CT-scan the marker points and target points on the skull model. the manually measured puncture needle is the error in the accuracy of end positioning of the BH-7 robot.
Its kinematic model is shown in Figure 2, below. As shown in Figure 2, the robot has five degrees of freedom. Except for the first joint which is a moving joint, the remaining joints are rotating joints. The relevant DH param eters are shown in Table 1, below.
Its kinematic model is shown in Figure 2, below.
the manually measured puncture needle is the error in the accur positioning of the BH-7 robot.
Its kinematic model is shown in Figure 2, below.  As shown in Figure 2, the robot has five degrees of freedom. Except for t which is a moving joint, the remaining joints are rotating joints. The relevant eters are shown in Table 1, below. As shown in Figure 2, the robot has five degrees of freedom. Except for the first joint, which is a moving joint, the remaining joints are rotating joints. The relevant DH parameters are shown in Table 1, below. Table 1. Theoretical parameters of robot.

Improved Beetle Antennae Search Algorithm
Because the medical robot needs to identify more parameters of geometric error and the results of common VSBAS identification are poor [24], the improvements below are proposed for the BAS.

Improving Search Mode of BAS
The search mode of the BAS mainly relies on the left and right antennae. In the face of a more complex problem, such as calibrating the geometric parameters of medical robots, the accuracy of the BAS is often not sufficiently high because the left and right antennae have limited search space, and there is only one beetle in each search. The random wandering behavior of the WCA can strengthen the local search ability of the wolf pack algorithm, thus improving its accuracy of convergence. We add "random antennae", inspired by the random wandering behavior of the WCA, to the left and right antennae of the BAS. In this improved BAS, each search process is equivalent to three antennae searching together. As the "wandering antennae" themselves are variable, the local search capability of the BAS is enhanced.

Introduction to VSBAS
(1) The relationship between the antennae of the beetle is as follows: In Equation (1), x represents the coordinates of the center of mass of the BAS, x l and x r represent its left and right antennae, and d 0 represents the distance between them.
(2) The left and right antennae of the BAS can be expressed as follows according to their center of mass: Left antenna: Right antenna: (3) For an n-dimensional spatial optimization problem, the direction of the antenna vector between the whiskers of the aspen is random, and can be expressed as: In Equation (4) k denotes the number of dimensions of the variable and "rands" generates random numbers within the interval [−1, 1].
Bioengineering 2022, 9, 58 5 of 11 (4) The BAS determines the direction of movement of the antennae by comparing their fitness evaluations. The following equation is used: Step denotes the intended step, sign(.) is the sign function, and f (x l ) and f (x r ) are the adaptation values corresponding to the left and right antennae, respectively, so that if f (x l ) > f (x r ) during the iteration. The BAS then moves in the direction of its right antenna.
(5) The iterations of the BAS use a variable step rate, i.e., where eta denotes the adaptive factor of step size.

WCA Random Wandering Behavior
The WCA is inspired by the behaviors of wolf packs: wandering, summoning, and siege. The head wolf has the best fitness value of the pack, where this is equivalent to the global optimal solution in the particle swarm. Wandering behavior refers to the behavior of a group of wolves with the best fitness value, other than the head wolf as scout wolves, searching randomly in the space.
In Equation (7), h denotes the total number of directions searched by a wolf, P denotes a direction (p = 1, 2, . . . , h), X id denotes the current position of the wolf in d-dimensional space, X p id denotes its position after searching in direction p in the d-dimensional space, and step d a s the wandering step.

Wandering Antennae Improvement
Inspired by Equation (7), the random wandering behavior of the WCA is added to the search pattern of the beetle antennae search algorithm, i.e., a "random antenna" is added to the original left and right antennae of the BAS. It is expressed as follows: Gbest in Equation (8) denotes the global optimal solution of the BAS. That is, the BAS searches at each updated iteration, in addition to the original left and right antennae, while its global optimal solution is explored locally using random wandering behavior. As the value of the sign function changes with the number of iterations, the distance of detection of the random antenna is also constantly changing. In this way, in both the inner and the outer loops in the RWSAVSBAS search process, the search sizes of the left and right antennae of the BAS are reduced sequentially with the increase in the number of iterations according to Equation (6). However, from Equation (7), we see that the "random antenna" in the outer loop shows a periodic change in size according to the sign function, while the "random antenna" in the inner loop shows k periodic changes in size with changes in Q. These two ways of changing the step size enable the random antenna, and the left and right antennae to search together. This improves the local search ability of the BAS.

Improving Mechanism of Selection of Global Optimal Solution of BAS
However, as the BAS is a single particle search algorithm, it delivers poor results once it falls into the local optimum in the iteration process. The metropolis criterion of the SA can improve the ability of the BAS to emerge from the local optimal solution, and thus can improve its global search ability.

Metropolis Guidelines
The simulated annealing algorithm determines whether to jump out of the local difference solution by virtue of the metropolis.
(1) Treat the randomly generated x as the optimal solution.
(2) Obtain a new solution near the initial solution where T k is the current temperature and exp is an exponential function with a natural number e as its base.

Global Optimal Solution Selection Mode Improvement
The original BAS selects a new solution (Gbest1) each time by comparing it with the global optimal solution (Gbest) of the previous generation, and proceeds to the next iteration on the basis of merit. This causes the algorithm to prematurely develop. For RWSAVSBAS to obtain the maximum value, for example, when the global optimal solution f (Gbest) of the previous generation is smaller than the current solution f (Gbest1), the new solution is accepted.
If the previously generated global optimal solution, f (Gbest), is larger than the current solution, f (Gbest1), then the new solution is selectively accepted according to the metropolis criterion. This can help the BAS overcome the local optimum and improve its global search capability.

Calibration Process of Geometric Parameters
The proposed algorithm is called the simulated annealing-based optimized variablestep-length beetle antennae search algorithm with randomized wandering (RWSAVSBAS), and its flow is as shown in Figure 3.
From Figure 3, it is clear that the steps to calibrate the geometric error when using the RWSAVSBAS for medical robots are as follows.

Calibration Process of Geometric Parameters
The proposed algorithm is called the simulated annealing-based optimized vari step-length beetle antennae search algorithm with randomized wand (RWSAVSBAS), and its flow is as shown in Figure 3.

Posture Generation
The validity of the proposed algorithm is verified by the BH-7 robot, whose DH model parameters are shown in Table 1 [20]. The geometric parameter errors are shown in Table 2. Twenty sets of theoretical joint angles are randomly and uniformly generated in the intervals of [−0.5,0.5] (unit: mm) and [−0.01,0.01] (unit: rad), and the previously set geometric errors are added to the nominal geometric parameters of the robot [25], and then the corresponding adaptation value formula is obtained by substituting the 20 sets of joint errors into the following Equation (8).
N in Equation (9) denotes the number of medical robot error calibration points, f is the set of geometric parameter errors (∆a i , ∆d i , ∆α i , ∆θ i , ) function, at different calibration points, to obtain the error between the nominal and actual positions of the medical robot, and then use RWSAVSBAS to solve (∆a i , ∆d i , ∆α i , ∆θ i , ) the real value of the geometric error compensation is finally realized.

Results and Discussion
The experiments were conducted using MATLAB 9.1, setting the number of iterations k for each algorithm to 300, the step size Step for RWSAVSBAS to 0.05, the step size adaptive factor eta to 0.95, the initial annealing temperature T = 10,000 [26], the annealing factor α to 0.93, and the number of simulated annealing algorithm iterations Q to 100 for each iteration of BAS. Figure 4, below, shows the iteration profiles of each algorithm: Bioengineering 2022, 9, x FOR PEER REVIEW factor α to 0.93, and the number of simulated annealing algorithm iteratio each iteration of BAS. Figure 4, below, shows the iteration profiles of each algorithm: From Figure 4, it can be seen that RWSAVSBAS converges faster th VSBAS in the pre-iterative stage and the final fitness function is smaller. From Figure 4, it can be seen that RWSAVSBAS converges faster than SFLA and VSBAS in the pre-iterative stage and the final fitness function is smaller. Figure 5, below, shows the components of the end position error along the X, Y, Z axes before calibration of the medical robot. Figure 5 shows the X, Y, Z axis error components of the medical robot after calibration with VSBAS, SFLA and RWSAVSBAS. The maximum absolute values of errors along the X, Y and Z axes before calibration are 4.61 mm, 2.96 mm and 7.93 mm respectively. The maximum absolute values of errors along the X, Y and Z axes are reduced to 2.97 mm, 1.77 mm and 3.13 mm after parameter compensation identified by VSBAS. c. The maximum absolute values of errors along the X, Y and Z axes are reduced to 2.36 mm, 1.64 mm and 1.32 mm after parameter compensation identified by SFLA. As can be seen from the graph in Figure 5, the absolute values of the maximum errors in the X, Y and Z axes are reduced to 0.71 mm, 0.82 mm and 0.26 mm after compensating for the parameters identified by SFLA. It can be seen that the The maximum absolute values of errors along the X, Y and Z axes before calibration are 4.61 mm, 2.96 mm and 7.93 mm respectively. The maximum absolute values of errors along the X, Y and Z axes are reduced to 2.97 mm, 1.77 mm and 3.13 mm after parameter compensation identified by VSBAS. c. The maximum absolute values of errors along the X, Y and Z axes are reduced to 2.36 mm, 1.64 mm and 1.32 mm after parameter compensation identified by SFLA. As can be seen from the graph in Figure 5, the absolute values of the maximum errors in the X, Y and Z axes are reduced to 0.71 mm, 0.82 mm and 0.26 mm after compensating for the parameters identified by SFLA. It can be seen that the RWSAVSBAS proposed in this paper has higher accuracy of calibration results compared with VSBAS and SFLA, which can significantly improve the end positioning accuracy of medical robots

Conclusions
(1) In this paper, a new improved Beetle Antennae Search Algorithm-RWSAVSBASis proposed, which combines the iterative law of Beetle Antennae Search Algorithm and introduces the random wandering behavior of the Wolf Colony Algorithm with the simulated annealing algorithm. The simulation results show that the proposed algorithm can effectively improve the localization accuracy of the medical robot, and has the advantage of high accuracy compared with other common algorithms.
(2) The geometric linkage parameter error of the medical robot is the main source of its positioning accuracy error, and by obtaining the actual linkage parameters of the medical robot, the end positioning accuracy can be effectively improved.
(3) The research in this paper is firstly verified by simulation experiments only, and actual experiments are needed to verify the effectiveness of the algorithm in this paper. In addition, the geometric linkage error of the medical robot is only considered in this paper. In the actual application, the end positioning accuracy of the medical robot is also affected by non-geometric error factors such as temperature, electromagnetic interference, and self-weight, which need to be further investigated.
(4) The simulation experiments proposed in this paper are mainly applied to the offline geometric error compensation experiments of medical robots. In the further research process, the online geometric error compensation of industrial robots can be used to conduct online compensation experiments for the end positioning errors of medical robots to further improve the real-time error compensation of medical robots.

Data Availability Statement:
The data used in this astudy were self-tested and self-collected during the test. As the control method in this paper is still being further optimized, the data cannot be shared at present. Therefore, data sharing is not applicable to this article.

Conflicts of Interest:
The authors declare no conflict of interest.