Flexible needle path planning method fitted by biarc fitting algorithm under hybrid PSO-WOA algorithm
Through the hybrid PSO-WOA algorithm and double arc fitting algorithm, the problems of large computing resource consumption and low efficiency of a single algorithm in three-dimensional flexible needle path planning are solved, and efficient and accurate flexible needle path planning is achieved to ensure path continuity and Ability to avoid obstacles.
Patent Information
- Application Number
- CN202411264199.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-20
AI Technical Summary
The prior art consumes a lot of computing resources in flexible needle path planning in three-dimensional space, and it is difficult for a single algorithm to find the optimal path, and it is difficult to avoid important organs and obstacles. The local minimum value problem is serious and the efficiency is inefficient.
Using hybrid PSO-WOA algorithm combined with double arc fitting algorithm, by optimizing discrete points and direction vectors, the problems of large calculation volume and slow search speed of traditional algorithms are overcome, and the G1 continuity of the path and the minimum radius circle are expanded to three-dimensional environments. Arc requirements to realize optimal path planning for flexible needles.
It improves the convergence speed and the ability to jump out of local minimum values, ensures that the optimal path is found in a three-dimensional environment, reduces tissue damage, reasonably avoids obstacles, and achieves target hits, improving the efficiency and accuracy of path planning.
Smart Images

Figure CN119167771A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical technology, and in particular to a flexible needle path planning method using a double arc fitting algorithm under a hybrid PSO-WOA algorithm. Background Art
[0002] With the rapid development of biomedicine and related instruments, local treatment and less invasive treatment methods are becoming more and more popular among patients. Percutaneous puncture, as a minimally invasive procedure, has broad application prospects in medical fields such as biopsy, drainage, and brachytherapy. However, the rigid needles currently used based on doctors' experience to perform percutaneous puncture have limitations. They can only move along a straight path and cannot bypass important organs or correct puncture deviations. Because the beveled flexible needle is subjected to asymmetric forces from the tissue and the needle body is easily deformed and bent, it can avoid obstacles during the puncture process and reach positions that rigid needles cannot reach. Therefore, it has attracted the attention of many scholars and is expected to be developed in the future. In order to ensure that the needle tip reaches the target while the needle body avoids important tissues, reliable path planning research for flexible needles is the basis of its motion control and is also the main prerequisite for achieving minimally invasive surgery.
[0003] Chinese Patent Application No. 201210422524.0, entitled "Flexible Needle Path Planning Method," discloses a method for representing the puncture path of a flexible needle using a concatenated trajectory of arcs and line segments. This method is essentially a Dubins curve, commonly used in autonomous driving. Leveraging the properties of this curve, the SLOA algorithm is proposed to find the shortest path among all Dubins curves. The Dubins curves used in this algorithm are only applicable to path planning problems on a plane and are not suitable for path planning in three-dimensional space. Furthermore, the Dubins curve generation algorithm may involve complex mathematical calculations and require high computing resources. Chinese Patent Application No. 201710020900.6, entitled "Flexible Needle Path Planning Based on Environmental Characteristics and Stochastic Methods," discloses a flexible needle path planning method based on the RRT algorithm. However, due to the inherent randomness of the RRT algorithm, it often fails to achieve the optimal path and suffers from slow convergence and low efficiency in complex environments. Chinese patent application number 202310975892.6, entitled “PSO flexible needle percutaneous puncture path planning method based on mixed parameters”, discloses a method for optimizing the objective function of flexible needle puncture with mixed parameters using the PSO algorithm. However, the adopted PSO algorithm is very easy to fall into local minima, and cannot guarantee the global optimum, and the safe distance from obstacles (i.e., actual important organs) is not taken into account in the simulation. It can be seen that in the prior art, the traditional single algorithm has the limitations of large computational complexity and low search speed, and it is difficult for a single algorithm to find the optimal path required for the actual complex puncture environment. Although path planning algorithms in other fields have gradually matured, traditional path planning algorithms may not be able to generate the optimal path for puncture surgery in complex environments, and they still need to be continuously optimized to meet the planning requirements of this specific application. Summary of the Invention
[0004] To address the aforementioned shortcomings of the existing technology, the present invention proposes a hybrid PSO-WOA algorithm designed to improve convergence speed and the ability to escape local minima. This algorithm obtains discrete points in a three-dimensional environment, uses these points as a skeleton, and uses double arc fitting to limit the minimum curvature radius to obtain a trajectory suitable for flexible needle puncture. This overcomes the drawbacks of traditional path planning, where the curves obtained do not meet the G1 continuity and minimum radius arc requirements. The double arc fitting algorithm is also extended to three-dimensional environments, ensuring versatility in both two- and three-dimensional environments. Finally, by optimizing the ratio of the double arcs and the direction vectors of the selected discrete points, the optimal flexible needle puncture path in this environment is obtained, minimizing tissue damage and reasonably avoiding obstacles to hit the target. This can be verified in actual environments through puncture experiments using a duty cycle method.
[0005] The technical effects to be achieved by this application are achieved through the following solutions:
[0006] The invention provides a flexible needle path planning method based on a double arc fitting algorithm under a hybrid PSO-WOA algorithm, comprising the following steps:
[0007] S1. Determine the objective function and use the hybrid PSO-WOA algorithm to obtain the pre-planned discrete points by optimizing the objective function.
[0008] S2. Using a double arc fitting algorithm to fit, setting the number of selected pre-planned discrete points, optimizing the ratio ρ of each double arc and the direction vector t of each selected pre-planned discrete point, to obtain the final optimal path;
[0009] The PSO-WOA algorithm in step S1 adopts the global optimal position of the WOA algorithm, i.e., the optimal solution, to replace the historical optimal position of the particle in the PSO algorithm, and sets the inertia weight in the PSO algorithm to the dynamic inertia weight;
[0010] The double arc fitting algorithm in step S2 is expressed by formula (11):
[0011]
[0012] Among them, C2=ρ(t1·t2-1), C1=-v·(t1-ρt2), C0=(v·v) / 2, v=p2-p1, t1 and t2 are the tangent vectors of p1 and p2 relative to the arc, p1 and p m The tangents of the arc, p2, intersect at points q1 and q2 respectively, d1 = q1p m , d2=q2p m ,, p1 and p2 are the two endpoints of the double arc, p m The connection point of the double arc.
[0013] According to one embodiment of the present invention, step S1 of the path planning method further includes the following steps:
[0014] (1) Parameter initialization: including initializing the number of individuals in the population of the PSO and WOA algorithms and the adaptive weight parameters of the PSO algorithm;
[0015] (2) Define the objective function f according to the actual situation, calculate the objective function value, and determine the optimal solution of the current WOA algorithm based on the objective function value. * (t);
[0016] (3) Determine whether the number of iterations has been reached. If not, proceed to step (4). If the number of iterations has been met, output the optimal solution Whale *(t), and the discrete points corresponding to the optimal solution that satisfy the adaptive weights are used as reference discrete points for fitting the double arc fitting algorithm in step S2;
[0017] (4) Updates to WOA
[0018] When the number of iterations is not reached, the position of each solution of the whale group is updated using formula (2) and formula (3), and the optimal solution Whale in the current WOA algorithm is * (t) is used as the individual historical optimal solution in the PSO algorithm to obtain formula (4);
[0019]
[0020] in, is the global optimal position of all whales at time t, is the position of a whale at time t, p is a random number between [0,1] representing the probability, l is a random number between [-1,1], and b is the logarithmic spiral constant used to describe the spiral motion. Coefficient vector Coefficient vector Decreases linearly from 2 to 0, is a random vector between [0,1];
[0021] along with and When |A|>1, the whale is in the stage of searching for prey, and the position update method is shown in formula (3).
[0022]
[0023] in, is a randomly selected whale position;
[0024] (5) Update of PSO algorithm
[0025] Update the position and velocity of each particle swarm individual according to formula (4) to obtain the new position of the updated particle swarm, the individual optimal solution and the global optimal solution;
[0026] v i (t+1)=w·v i (t)+c1·r1·(Whale * (t)-x i (t))+c2·r2·(gBest-x i (t))
[0027] x i (t+1)=xi (t)+v i (t+1) Formula (4)
[0028] Where vi(t) is the velocity of particle i at time t, xi(t) is the position of particle i at time t, Whale*(t) represents the optimal solution of the current WOA, gBest is the global optimal position of all particles, ω is the dynamic inertia weight, c1 and c2 are the individual and social learning factors, which are set to constants, and r1 and r2 are random numbers between 0 and 1;
[0029] The dynamic inertia weight ω is used to balance the exploration and development capabilities of the particle and is set as shown in formula (5),
[0030]
[0031] Among them, Matiter is the total number of iterations, k is a constant;
[0032] (6) The number of iterations is increased by 1, and the updated solution of the PSO algorithm is returned to step (2). The objective function value is calculated and compared to obtain the optimal solution Whale*(t), and then the process of steps (3) to (5) is repeated.
[0033] 10. The path planning method according to claim 2, wherein the objective function f is as shown in formula (1),
[0034] f=ω1·L+ω2·V+ω3·D Formula (6)
[0035] Among them, L represents the total length of the path, V represents the obstacle hazard value; D represents the puncture angle limit, ω1~ω3 are the weights of each variable, ω1+ω2+ω3=1.
[0036] According to one embodiment of the present invention, the objective function and constraint conditions in step S3 of the path planning method are as shown in formula (18),
[0037]
[0038] Among them, Arc represents the arc trajectory, ||P i -Arc|| represents the discrete point P i Euclidean distance from the circular trajectory, R i represents the arc radius, n is the number of pre-planned discrete points, m is the number of selected pre-planned discrete points, 2≤m≤n, i, j, k are the numbers of pre-planned discrete points, T x is the direction vector of the xth point in the selected pre-planned discrete points, ρ is the ratio of the two arcs of the double arc segment, R min is the minimum allowable curvature radius of the flexible needle, Rmax It is the maximum allowable curvature radius of the flexible needle.
[0039] According to one embodiment of the present invention, in the path planning method, the predetermined number of pre-planned discrete points in step S2 is at least 3, and includes an initial point serving as a flexible needle puncture entrance and a target point for flexible needle puncture.
[0040] The flexible needle path planning method using a double arc fitting algorithm under a hybrid PSO-WOA algorithm of the present invention can be applied in two-dimensional or three-dimensional space.
[0041] According to one embodiment of the present invention, p1 and p2 are endpoints, p m The centers O1, O2, and radii r1, r2 of the double arc segments connecting the points are obtained from formulas (12) to (15).
[0042]
[0043]
[0044] Where n1 and n2 represent the normal vectors at points p1 and p2.
[0045] According to one embodiment of the present invention, p1 and p2 are endpoints, p m The angles theta1 and theta2 of the two arc segments of the double arc segment connecting the points are obtained by formulas (16) and (17).
[0046] BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention, the drawings used in describing the embodiments are briefly introduced below.
[0048] Figure 1 The overall block diagram of the algorithm structure of the hybrid PSO-WOA algorithm is shown.
[0049] Figure 2 shows the performance comparison of the hybrid PSO-WOA algorithm with the GA algorithm, PSO algorithm, and WOA algorithm in a two-dimensional environment.
[0050] Figure 3 The diagram shows the calculation principle of the double arc fitting algorithm.
[0051] Figure 4 The figure shows the pre-planned discrete points obtained by the hybrid PSO-WOA algorithm in a three-dimensional environment according to one embodiment of the present invention.
[0052] FIG5(a) shows an embodiment of the present invention. Figure 4The pre-planned discrete points are the double arc trajectories obtained by framework optimization.
[0053] Figure 5(b) shows Figure 4 The degree of fit between the discrete point trajectory of and the optimized path of Figure 5(a). DETAILED DESCRIPTION
[0054] To make the purpose, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be described clearly and completely below in conjunction with specific embodiments and corresponding drawings. The scope of protection of the present invention is not limited to the following embodiments.
[0055] This path planning method includes the following steps:
[0056] S1. Determine the objective function and use the hybrid PSO-WOA algorithm to obtain the pre-planned discrete points by optimizing the objective function.
[0057] S2. Using a double arc fitting algorithm, setting the number of the selected pre-planned discrete points, optimizing the direction vectors of the selected pre-planned discrete points of the double arc ratio, and obtaining the final optimal path.
[0058] The hybrid PSO-WOA algorithm in step S1 of the present invention replaces the historical optimal position of particles in the PSO algorithm with the global optimal position of the WOA algorithm and sets the inertia weight in the PSO algorithm to a dynamic inertia weight. This prevents the PSO algorithm from falling into a local optimum while maintaining its characteristic of rapid convergence. This algorithm biologically simulates the effect of whales and flocks of birds hunting together, effectively exploring the solution space and converging to an optimal or near-optimal solution.
[0059] The main idea of the particle swarm optimization (PSO) algorithm is to optimize fitness, i.e., the objective function, through the mutual cooperation and competition of a group of particles in the search space. At the initial moment, each particle has a random position and velocity, and adjusts its position and velocity based on its own experience and the experience of the group, gradually approaching the optimal solution. A standard particle swarm evolution formula is shown in formula (1):
[0060] To make the purpose, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be described clearly and completely below in conjunction with specific embodiments and corresponding drawings. The scope of protection of the present invention is not limited to the following embodiments.
[0061] This path planning method includes the following steps:
[0062] S1. Determine the objective function and use the hybrid PSO-WOA algorithm to obtain the pre-planned discrete points by optimizing the objective function.
[0063] S2. Using a double arc fitting algorithm, setting the number of the selected pre-planned discrete points, optimizing the direction vectors of the selected pre-planned discrete points of the double arc ratio, and obtaining the final optimal path.
[0064] The hybrid PSO-WOA algorithm in step S1 of the present invention replaces the historical optimal position of particles in the PSO algorithm with the global optimal position of the WOA algorithm and sets the inertia weight in the PSO algorithm to a dynamic inertia weight. This prevents the PSO algorithm from falling into a local optimum while maintaining its characteristic of rapid convergence. This algorithm biologically simulates the effect of whales and flocks of birds hunting together, effectively exploring the solution space and converging to an optimal or near-optimal solution.
[0065] The main idea of the particle swarm optimization (PSO) algorithm is to optimize fitness, i.e., the objective function, through the mutual cooperation and competition of a group of particles in the search space. At the initial moment, each particle has a random position and velocity, and adjusts its position and velocity based on its own experience and the experience of the group, gradually approaching the optimal solution. A standard particle swarm evolution formula is shown in formula (1):
[0066] v i (t+1)=ω·v i (t)+C1r1·(pBest i -x i (t))+c2·r2·(gBest-x i (t))
[0067] x i (t+1)=x i (t)+v i (t+1) Formula (1)
[0068] Among them, v i (t) is the velocity of particle i at time t, x i (t) is the position of particle i at time t, pBest i is the historical best position of particle i, gBest is the global best position of all particles, ω is the inertia weight, which is used to balance the exploration and development capabilities of particles and is usually set to a constant. c1 and c2 are the learning factors of individuals and society, respectively, and are usually set to constants. r1 and r2 are random numbers, usually between 0 and 1.
[0069] The Whale Optimization Algorithm (WOA) is a natural heuristic optimization algorithm based on the hunting behavior of whale groups. It searches and optimizes by simulating the bubble net hunting strategy of humpback whales. The core idea of the Whale Optimization Algorithm is to imitate the three main behaviors of humpback whales hunting in the ocean: (1) Encircling prey: whales will hunt around prey, (2) Bubble net attack: humpback whales attack prey through bubble nets, and (3) Searching for prey: whales will search for prey in an unknown environment. Among them, after locking the prey, the humpback whale will directly encircle the prey or continuously adjust its position in a spiral manner to attack with a bubble net. According to one embodiment of the present invention, it is assumed that the probability of the above two behaviors is 50%, and the formula (2) of the WOA algorithm is obtained:
[0070]
[0071] in, is the global optimal position of all whales at time t, is the position of a whale at time t, p is a random number between [0,1] representing the probability, l is a random number between [-1,1], and b is the logarithmic spiral constant used to describe the spiral motion. Coefficient vector Coefficient vector Decreases linearly from 2 to 0, is a random vector between [0,1].
[0072] along with and When |A|>1, the whale is in the stage of searching for prey, and the position update method is shown in formula (3):
[0073]
[0074] in, is a randomly selected whale position.
[0075] In order to solve the problem that the particle swarm algorithm is prone to falling into the local optimum, the hybrid PSO-WOA algorithm of the present invention takes the global optimal position found by the current WOA algorithm as the optimal solution and marks it as Whale*(t). Whale*(t) is used to replace pBest in formula (1). i , we get the formula (4) of the hybrid PSO-WOA algorithm:
[0076] v i (t+1)=w·v i (t)+c1·r1·(Whale* (t)-x i (t))+c2·r2·(gBest-x i (t))
[0077] x i (t+1)=x i (t)+v i (t+1) Formula (4)
[0078] Among them, v i (t) is the velocity of particle i at time t, x i (t) is the position of particle i at time t, Whale*(t) represents the optimal solution found by the current WOA, gBest is the global best position of all particles, ω is the inertia weight, which is used to balance the exploration and development capabilities of particles and is usually set to a constant. c1 and c2 are the learning factors of individuals and society, respectively, and are usually set to constants. r1 and r2 are random numbers, usually between 0 and 1.
[0079] In order to make the hybrid PSO-WOA algorithm have stronger global search capability and convergence speed in the early stage of iteration and improve the local search capability of the algorithm in the later stage of iteration, the present invention further sets the inertia weight ω in the PSO algorithm formula (1) to the dynamic inertia weight, as shown in formula (5):
[0080]
[0081] Among them, Maxiter is the total number of iterations, and k is a constant.
[0082] Figure 1 The algorithm structure diagram of the hybrid PSO-WOA algorithm in step S1 is shown below. Figure 1 The algorithm structure block diagram is shown in the figure, and the specific execution steps of the hybrid PSO-WOA algorithm are described in detail.
[0083] (1) Parameter initialization: including initializing the number of individuals in the population of the PSO and WOA algorithms, the adaptive weight parameters of the PSO algorithm, and other related parameters of the PSO and WOA algorithms.
[0084] (2) Define the objective function f according to the actual situation, calculate the objective function value, and determine the optimal solution Whale*(t) of the current WOA algorithm based on the objective function value. Usually, the solution corresponding to the minimum objective function value is defined as the optimal solution. During the first calculation, the fitness value (i.e., the value of the objective function f) of each whale group in the population is calculated based on its initial position. The solution with the lowest fitness value is set as the initial global optimal position and is used as the initial (i.e., the current WOA algorithm) optimal solution Whale*(t).
[0085] (3) Determine whether the number of iterations has been reached. If not, proceed to step (4). If the number of iterations has been reached, output the optimal solution Whale*(t) of the current WOA algorithm, and the discrete points corresponding to the optimal solution that meet the adaptive weights (i.e., the discrete points obtained by the PSO solution) as pre-planned discrete points, and the trajectory of the pre-planned discrete points as the pre-planned trajectory.
[0086] (4) Update of WOA algorithm
[0087] Use formula (2) and formula (3) to update the position of each solution of the whale group, and update the table optimal solution Whale*(t) in the current WOA algorithm to the individual historical optimal solution in the PSO algorithm and bring it into formula (4).
[0088] Specifically, when it is determined that the number of iterations does not meet the requirements, a random number p in formula (2) is generated. If p is less than 0.5, the position of the whale is evolved according to the formula in the upper part of formula (2) when p is less than 0.5. If p is greater than or equal to 0.5, the position of the whale is evolved according to the formula in the lower part of formula (2) when p is greater than or equal to 0.5. When |A|>1, the position of the whale is evolved according to formula (3).
[0089] (5) Update of PSO algorithm
[0090] The number of iterations is increased by 1, and the PSO algorithm is updated using formula (4). The updated solution of the PSO algorithm is returned to step (2), and the objective function value is calculated and compared to obtain the optimal solution Whale*(t) corresponding to the current WOA algorithm. Then, the process of steps (3) to (5) is repeated.
[0091] The objective function f in step S1 may be any objective function set according to actual clinical experience and the characteristics of flexible needle puncture surgery.
[0092] During the puncture process, multiple tissues and organs exist in the area covered by the initial point and target point (such as diseased tissue) of the flexible needle insertion. Such tissues and organs are defined as obstacles. According to one embodiment of the present invention, based on the requirements of avoiding important tissues and organs during the puncture process, minimizing patient damage, and the flexible needle puncture angle, three variables are defined: path length, risk level, and puncture angle limit, and the following objective function is established:
[0093] f=ω1·L+ω2·V+ω3·D Formula (6)
[0094] Among them, L represents the total length of the path. In a two-dimensional environment, in the discrete domain Among them, dx and dy represent the deviation between a point in the discrete point set and its adjacent points on the x-axis and y-axis respectively. In a three-dimensional environment, in the discrete domain dx, dy and dz represent the deviations between a certain point in the discrete point set and the adjacent points on the x-axis, y-axis and z-axis respectively; V represents the obstacle risk value, D represents the puncture angle limit, ω1, ω2 and ω3 are the weights of each variable, and ω1+ω2+ω3=1. The value of each weight can be set according to the actual clinical application. According to one embodiment of the present invention, the initial value of the parameter V is defined as 0. Whenever the Euclidean distance between a discrete point and any obstacle is less than the critical value, the puncture path is considered to be too close to the obstacle, and a larger value is accumulated on V as a "penalty" for the path not meeting the requirements. The larger value can be a fixed value, such as 100. According to one embodiment of the present invention, the parameter D can be assigned a larger penalty value (relative to the length of the puncture path) for the needle insertion angle that does not meet the requirements according to the actual situation. The penalty value can be a fixed value, such as 500.
[0095] Figure 2 shows a performance comparison of the GA algorithm, PSO algorithm, WOA algorithm, and the hybrid PSO-WOA algorithm of the present invention in a two-dimensional environment. In a two-dimensional multi-rectangular obstacle environment, the initial point coordinates are set to (-4, 0) and the target point coordinates are set to (5, 0). Path planning is performed under the premise of obstacle avoidance, and the number of iterations is 500. The iteration comparison diagram shown in Figure 2(a) and the path planning trajectory shown in Figure 2(b) are obtained. As single heuristic algorithms, the GA algorithm and the PSO algorithm are prone to falling into local optimality. As shown in Figure 2(a), both algorithms are stuck in local values at the beginning of the algorithm iteration. After the predetermined number of iterations, they are still in the local minimum of fitness 80. The WOA algorithm has the ability to escape local minimums, but the convergence speed is slow. The hybrid PSO-WOA algorithm of the present invention makes the weights of the PSO algorithm dynamic, while also having a fast convergence speed and the ability to easily escape local minimums. Figure 2(b) shows the path planning trajectories of different algorithms. It can be seen that the path planned by the algorithm of the present invention is more optimal.
[0096] In step S2, a double arc fitting algorithm is used to connect a predetermined number of the pre-planned discrete points, which can meet the requirements of the flexible needle that its path is tangentially continuous at all directed points (GG1 tangentially continuous) and consists of curves with bounded curvature. In the double arc fitting algorithm, an appropriate number of pre-planned discrete points P are selected according to the specific puncture environment. i , set the selected pre-planned discrete point P i The tangent vector t i And the ratio of the two arcs of each double arc segment ρ i By defining the above three sets of variable sets, the present invention can ultimately obtain a smooth curve with variable curvature and multiple arcs in a two-dimensional or three-dimensional environment.
[0097] Figure 3The calculation principle diagram of the double arc fitting algorithm of the present invention is shown in FIG. m The double arc segment with connection points is as follows Figure 3 As shown in the figure, the double arc fitting algorithm ensures that all arcs share the same tangent direction at the connection point during the fitting process, ensuring the smoothness of the fitting path. In addition, this method extends the double arc fitting algorithm to a three-dimensional environment, while ensuring its versatility in two-dimensional and three-dimensional environments.
[0098] Define the tangent vectors (unit vectors) of p1 and p2 about the arc as t1 and t2 respectively; p1, p m , the tangents of p2 about the arc intersect at points q1 and q2 respectively. d1=q1p m , d2=q2p m , and define the proportional relationship as d2=ρd1. From the geometric relationship, we know that:
[0099] q1=p1+d1t1 Formula (7)
[0100] q2=p2-d2t2 Formula (8)
[0101] |q2-q1|=d1+d2 Formula (9)
[0102] By squaring formula (9) and simplifying it by replacing d2 with d1, the present invention obtains:
[0103]
[0104] Among them, C2 = ρ(t1·t2-1), C1 = -v·(t1-ρt2), C0 = (v·v) / 2, v = p2-p1.
[0105] Similarly, the present invention obtains the center O1, O2, and radius r1, r2 of each arc segment in the double arc segment:
[0106]
[0107]
[0108] Where n1 and n2 represent the normal vectors at points p1 and p2.
[0109] The angles theta1 and theta2 of the two arc segments are:
[0110]
[0111] Taking a set of parameters of the present invention as an example, three discrete points P1, P 50 、P 100 , that is, the initial point, the middle point and the target point, the tangent vector t of each pointi Select P 10 -P1, P 65 -P 35 、P 100 -P 90 , define the ratio of the two arcs of each double arc segment ρ as 1, then we can get Figure 3 The double arc curve shown is composed of two groups of smoothly connected double arc segments.
[0112] In step S2, m of the pre-planned discrete points are selected, and the double arc fitting algorithm as described above is used to define the objective function and constraints as shown in formula (18), optimize the selection of the pre-planned discrete points (especially the selection of the intermediate discrete points other than the starting point and the target point), the ratio ρ of each double arc, and the direction vector t of each selected pre-planned discrete point, and obtain the final optimal path. Among them, the value of m can be appropriately selected according to the specific puncture environment, and the selected m pre-planned discrete points include at least the initial point and the target point of the puncture. For the scheme with n discrete points in the pre-planned trajectory, the number of selected discrete points m determines the number of arcs, and also indirectly affects the puncturable trajectory. The optimal path obtained by the objective function and constraints ensures that the ratio of the double arc segments is appropriate, the tangent vector fits the pre-planned discrete point set, and the arc radius meets the physical puncture performance of the flexible needle, and finally achieves the purpose of being suitable for the actual puncture of the flexible needle.
[0113]
[0114] Among them, Arc represents the arc trajectory, ||P i -Arc|| represents the discrete point P i Euclidean distance from the circular trajectory, R i represents the arc radius, n is the number of pre-planned discrete points, m is the number of selected pre-planned discrete points, 2≤m≤n, i, j, k are the numbers of pre-planned discrete points, T x is the direction vector of the xth point in the selected pre-planned discrete points, ρ is the ratio of the two arcs of the double arc segment, R min is the minimum allowable curvature radius of the flexible needle, R max R is the maximum allowable curvature radius of the flexible needle. min and R max It can be set according to the physical properties of different flexible needles for puncture needles.
[0115] The following is a puncture experiment verification using a duty cycle method according to a specific embodiment of the present invention.
[0116] The puncture point coordinates are set to (0,0,0), the target point coordinates are set to (5,5,3), and there are four spherical obstacles in the search area with coordinates of (3,7,3), (4,3.5,2), (5,6.5,5) and (6,5,2). The radii of the obstacle spheres are 1cm, 1.2cm, 1.4cm and 1cm respectively.
[0117] Execute step S1. Initialize the parameters, define the WOA and PSO populations as 150, the total number of iterations as 500, the adaptive weight parameter as 2.2, and the logarithmic spiral constant b in formula (2) as 1.
[0118] The hybrid PSO-WOA algorithm is iterated to find the minimum value of the objective function f. The optimal solution corresponds to 100 discrete points (that is, the preset discrete points are 100), where P1 is the initial point of puncture, P 100 The total length L of the optimal path (also called pre-planned trajectory) corresponding to the target point is obtained by accumulating the distances between adjacent points, and the optimal result is 8.2531 cm. Figure 4 The pre-planned trajectory consisting of a preset set of scattered points is shown, which can avoid obstacles and reach the target point in a smooth path.
[0119] Execute step S2, select m=3, except for the initial point P1 and the target point P 100 Outside, in P2-P 99 An intermediate point is selected, and the optimization iteration step is 0.1. The path parameters are optimized according to formula (18), and the arc trajectory shown in Figure 5(a) is obtained for the selected intermediate point, the ratio ρ of the two arcs of the double arc segment, and the direction vector T of each selected discrete point. The radius of each arc segment in the optimal path is 15.03cm, 7.61cm, 14.19cm, and 3.02cm, respectively, which meets the requirements of the flexible needle radius and obstacle avoidance. The total length L of the optimal path obtained is 8.339cm, which differs from the total length of the pre-planned trajectory by 0.0859cm. Figure 5(b) shows the degree of fit between the pre-planned trajectory and the arc trajectory of the planned path.
[0120] It should be noted that the terms used herein are intended only to describe specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0121] In the above detailed description, reference is made to the accompanying drawings, which form a part hereof. In the drawings, similar symbols typically identify similar components, unless the context dictates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.
[0122] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A flexible needle path planning method based on a double arc fitting algorithm under a hybrid PSO-WOA algorithm comprises the following steps: S1. Determine the objective function and use the hybrid PSO-WOA algorithm to obtain the pre-planned discrete points by optimizing the objective function; S2, using a double arc fitting algorithm to fit, setting the number of selected pre-planned discrete points, optimizing the ratio ρ of each double arc and the direction vector t of each selected pre-planned discrete point, and obtaining the final optimal path; in, The PSO-WOA algorithm in step S1 adopts the global optimal position of the WOA algorithm, i.e., the optimal solution, to replace the historical optimal position of the particle in the PSO algorithm, and sets the inertia weight in the PSO algorithm to the dynamic inertia weight; The double arc fitting algorithm in step S2 is expressed by formula (11): Among them, C2 = ρ(t1·t2-1), C1 = -v·(t1-ρt2), C0 = (v·v) / 2, v = p2-p1, t1 and t2 are the tangent vectors of p1 and p2 relative to the arc, and p1 and p m The tangent lines of p2 and p3 intersect at points q1 and q2 respectively, and d1 = q1p m , d2=q2p m , p1 and p2 are the two endpoints of the double arc, p m The connection point of the double arc.
2. The path planning method according to claim 1, wherein: Step S1 further comprises the following steps: (1) Parameter initialization: including initializing the number of individuals in the population of the PSO and WOA algorithms and the adaptive weight parameters of the PSO algorithm; (2) Define the objective function f according to the actual situation, calculate the objective function value, and determine the optimal solution of the current WOA algorithm based on the objective function value. * (t); (3) Determine whether the number of iterations has been reached. If not, proceed to step (4). If the number of iterations has been met, output the optimal solution Whale * (t), and the discrete points satisfying the adaptive weights corresponding to the optimal solution are used as reference discrete points for fitting by the double arc fitting algorithm in step S2; (4) Updates to WOA When the number of iterations is not reached, the position of each solution of the whale group is updated using formula (2) and formula (3), and the optimal solution Whale*(t) in the current WOA algorithm is used as the individual historical optimal solution in the PSO algorithm to obtain formula (4); in, is the global optimal position of all whales at time t, is the position of a whale at time t, p is a random number between [0,1] representing the probability, l is a random number between [-1,1], b is the logarithmic spiral constant used to describe the spiral motion, Coefficient vector Coefficient vector It decreases linearly from 2 to 0. is a random vector between [0,1]; along with and When |A|>1, the whale is in the stage of searching for prey, and the position update method is shown in formula (3). in, is a randomly selected whale position; (5) PSO Update According to formula (4), the position and velocity of each individual particle swarm are updated to obtain the new position of the updated particle swarm, the individual optimal solution and the global optimal solution; v i (t+1)=w·v i (t)+c1·r1·(Whale * (t)-x i (t))+c2·r2·(gBest-x i (t)) x i (t+1)=x i (t)+v i (t+1) Formula (4) Among them, v i (t) is the velocity of particle i at time t, x i (t) is the position of particle i at time t, Whale*(t) represents the optimal solution of the current WOA, gBest is the global best position of all particles, ω is the dynamic inertia weight, c1 and c2 are the individual and social learning factors, which are set to constants, and r1 and r2 are random numbers between 0 and 1; The dynamic inertia weight ω is used to balance the exploration and development capabilities of the particle and is set as shown in formula (5): Among them, Maxiter is the total number of iterations, and k is a constant value; (6) The number of iterations is increased by 1, and the updated solution of the PSO algorithm is returned to step (2). The objective function value is calculated and compared to obtain the optimal solution Whale*(t), and then the process of steps (3) to (5) is repeated.
3. The path planning method according to claim 2, wherein: The objective function f is shown in formula (6): f=ω1·L+ω2·V+ω3·D Formula (6) Among them, L represents the total length of the path, V represents the obstacle hazard value; D represents the puncture angle limit, ω1, ω2, ω3 are the weights of each variable, and ω1+ω2+ω3=1.
4. The path planning method according to claim 3, wherein: In a two-dimensional environment, In a three-dimensional environment, Among them, dx, dy and dz represent the deviation between a certain point in the discrete point set and its adjacent points on the x-axis, y-axis and z-axis respectively.
5. The path planning method according to any one of claims 1 to 4, wherein: The objective function and constraints in step S2 are shown in formula (18), Among them, Arc represents the arc trajectory, ||P i -Arc|| represents discrete point P i Euclidean distance from the circular trajectory, R i represents the arc radius, n is the number of pre-planned discrete points, m is the number of selected pre-planned discrete points, 2≤m≤n, i, j, k are the numbers of pre-planned discrete points, T x is the direction vector of the xth point in the selected pre-planned discrete points, ρ is the ratio of the two arcs of the double arc segment, R min is the minimum allowable curvature radius of the flexible needle, R max It is the maximum allowable curvature radius of the flexible needle.
6. The path planning method according to any one of claims 1 to 5, wherein: The path planning method is applied in two-dimensional or three-dimensional space.
7. The path planning method according to any one of claims 1 to 6, wherein: With p1 and p2 as endpoints, p m The centers O1, O2, and radii r1, r2 of the double arc segments connecting the points are obtained from formulas (12) to (15). Among them, n1 and n2 represent the normal vectors at points p1 and p2.
8. The path planning method according to any one of claims 1 to 7, wherein: With p1 and p2 as endpoints, p m The angles theta1 and theta2 of the two arc segments of the double arc segment connecting the points are obtained by formulas (16) and (17).
9. The path planning method according to any one of claims 1 to 8, wherein: The predetermined number of pre-planned discrete points in step S2 is at least 2, and includes an initial point as a flexible needle puncture entrance and a target point for flexible needle puncture.
Citation Information
Patent Citations
Path planning method for flexible puncture needle
CN102920510A
Flexible needle route planning method based on environmental characteristics and stochastic method
CN106650298A
PSO flexible needle percutaneous puncture path planning method based on mixed parameters
CN116999161A
Cited By
Aircraft cluster specified time cooperative hunting method for high maneuvering target
CN120143668A
