An endoscopic treatment path planning method based on deep Q network
By integrating multimodal data and a deep Q-network model, combined with distributed storage of endoscopic operation records, a safe, efficient, and highly generalizable automatic planning of endoscopic treatment pathways was achieved. This solves the problems of real-time response and data generalization in pathway planning in existing technologies, and improves the safety and efficiency of endoscopic treatment.
Patent Information
- Application Number
- CN202611648533.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-23
- Publication Date
- 2026-11-27
AI Technical Summary
Existing endoscopic treatment pathway planning methods are unable to respond in real time to lumen deformation, tissue displacement, and the interaction between instruments and the vessel wall. Furthermore, reinforcement learning models have insufficient generalization ability when the data scale of multiple medical institutions is limited, resulting in a lack of safety constraints and adaptability in planning strategies for complex anatomical structures.
By integrating real-time pose of the endoscope tip, three-dimensional reconstruction point cloud of the lumen, force feedback of the instrument tip, and lesion location information, a multimodal state feature vector is constructed. A deep Q-network model is used for path planning, and the model is trained using historical endoscopic operation records stored in a distributed manner, thus achieving safe, efficient, and highly generalizable automatic path planning.
It improves the safety and efficiency of endoscopic treatment, reduces the uncertainty of repeated manual trials and operations, enhances the model's adaptability to different anatomical structures and operators, and reduces the risk of intraoperative perforation and mucosal damage.
Smart Images

Figure CN123166767A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical intelligent technology, specifically to an endoscopic treatment path planning method based on deep Q-networks. Background Technology
[0002] Endoscopic minimally invasive treatment requires the instrument tip to precisely and safely reach the lesion area within tortuous lumens. Traditional path planning methods rely on static path design using preoperative medical images, or on the physician manually controlling the advancement direction based on experience using two-dimensional endoscopic images. These methods struggle to respond in real-time to luminal deformation, tissue displacement, and the interaction between the instrument and the vessel wall during the procedure. Some existing approaches attempt to introduce rule-based path planning, extracting the lumen centerline through image segmentation and then driving the endoscope along the centerline. However, rule-based methods are highly sensitive to image quality, easily leading to planning interruptions in areas with blurred vision, uneven lighting, or lumen bifurcation. Furthermore, they neglect information on the contact forces between the instrument tip and tissue during endoscopic advancement, as well as the spatial relationship with the lesion location, resulting in a lack of safety constraints on the planned path in complex anatomical structures.
[0003] In reinforcement learning techniques applied to surgical path planning, single-modal data is often used as state input, such as relying solely on endoscopic images or electromagnetic sensor poses, resulting in a one-sided environmental perception. When the lumen is narrowed, wrinkled, or affected by respiratory movements, it is impossible to effectively determine safe clearances, increasing the risk of collisions and perforations. Furthermore, reinforcement learning models require a large number of high-quality surgical samples for training, but the scale of endoscopic surgical data from a single center is limited, restricting the model's generalization ability under different patient anatomical variations and different operator habits, making the planning strategy prone to failure in unseen scenarios.
[0004] The technical challenges to be addressed focus on two aspects: firstly, effectively integrating multi-source information such as real-time pose, three-dimensional lumen structure, instrument end-effector force feedback, and lesion location in the state representation of endoscopic advancement, in order to overcome the problem of incomplete perception of the dynamic environment of the lumen by single-modal information; secondly, how to efficiently utilize historical endoscopic operation records generated by multiple medical institutions to expand the training sample size while protecting data privacy, thereby improving the adaptability of the deep Q-network model to diverse anatomical and operational scenarios. Summary of the Invention
[0005] The purpose of this invention is to provide an endoscopic treatment path planning method based on a deep Q-network. By integrating the real-time pose of the endoscope tip, the three-dimensional reconstruction point cloud of the lumen, the force feedback of the instrument tip, and the lesion location information to construct a multimodal state, and using historical endoscopic operation records in distributed storage to train the deep Q-network, a safe, efficient, and highly generalizable automatic path planning method for endoscopy is achieved.
[0006] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides an endoscopic treatment path planning method based on deep Q-networks. This method models the endoscope advancement process as a Markov decision process and uses a deep Q-network model to autonomously plan the advancement path of the endoscope tip in the lumen based on multimodal perception information, so as to assist the endoscope operation in accurately reaching the lesion location.
[0007] The method of this invention acquires real-time pose data of the endoscope tip, three-dimensional reconstructed point cloud data of the lumen, and force feedback data of the instrument tip during endoscopic treatment, and constructs current state data by combining lesion location information from electronic medical records. As one technical solution of this invention, real-time pose data of the endoscope tip is acquired through an electromagnetic positioning sensor; three-dimensional reconstructed point cloud data of the lumen is generated using a multi-view stereo vision algorithm based on lumen images captured by an optical camera at the endoscope tip; force feedback data of the instrument tip is acquired through a six-dimensional force sensor installed at the endoscope tip; the above data are synchronized in time and stitched together into a multimodal state feature vector, which serves as the current state data. This multimodal state data can comprehensively reflect the spatial position of the endoscope tip within the lumen, the lumen morphology, the contact force between the instrument and tissue, and the location of the target lesion, providing an information basis for subsequent path decision-making.
[0008] This invention models the endoscopic advancement process as a Markov decision process, where the state is the current state data, and the action is the advancement direction and distance of the endoscope tip in three-dimensional space. Preferably, the advancement direction is uniformly sampled on a three-dimensional sphere as a preset number of candidate direction vectors, and the advancement distance is divided into a preset number of distance levels. Each candidate action is represented by a combination of a direction index and a distance level index. The output dimension of the deep Q-network model is equal to the product of the number of candidate direction vectors and the number of distance levels. The reward is designed as a composite reward value, including a collision penalty term, a path smoothness reward term, and a target proximity reward term. The collision penalty term is determined based on the closest distance between the endoscope tip and the lumen wall. When the closest distance is less than a preset safety threshold, it is set to a negative value to prevent the endoscope from touching the lumen wall. The path smoothness reward term is determined based on the angle between the current advancement direction and the previous advancement direction. The smaller the angle, the larger the reward value to encourage smooth path extension. The target proximity reward term is determined based on the change in distance between the endoscope tip and the target point. When the distance shortens, it is set to a positive value to guide the endoscope closer to the lesion. The composite reward mechanism constrains the path optimization direction from multiple aspects, including security, smoothness, and goal orientation.
[0009] This invention constructs a deep Q-network model comprising a current Q-network and a target Q-network. As a preferred embodiment, the current Q-network adopts a dual-competition structure, including a shared feature extraction layer, a dominant sub-network, and a value sub-network. The shared feature extraction layer performs convolution processing on the current state data and outputs state features. The dominant sub-network outputs the advantage value for each candidate action based on the state features, and the value sub-network outputs the state value based on the state features. The Q-value output by the current Q-network is obtained by adding the state value and the advantage value and then subtracting the average of the advantage values of all candidate actions. The target Q-network has the same structure as the current Q-network. During training, the parameters of the current Q-network are copied to the target Q-network every preset number of steps to stabilize the training process.
[0010] A deep Q-network model is trained using historical endoscopic operation records stored in distributed storage. Specifically, historical endoscopic operation records are uploaded to distributed storage from endoscopic operation recording terminals of multiple medical institutions. The distributed storage backs up the historical endoscopic operation records into fragments and distributes them to different storage nodes based on organ type and operation time. During training, the corresponding organ type is determined based on the lesion location information in the current state data, and the target storage node corresponding to that organ type is identified. The corresponding fragment data from the historical endoscopic operation records is loaded in parallel from the target storage node. The loaded historical endoscopic operation records are stored in an experience replay pool. Each record includes historical state data, historical action, historical reward value, and historical next state data. A priority experience replay mechanism is used to sample small batches of training samples from the experience replay pool. The historical state data and historical action are input into the current Q-network to obtain the current Q-value, and the historical next state data is input into the target Q-network to obtain the target Q-value. A loss function is constructed based on the difference between the current Q-value and the target Q-value, and the parameters of the current Q-network are updated through backpropagation. Distributed storage and parallel reading mechanisms improve the richness of training data and training efficiency, while priority experience replay accelerates the learning speed of important samples.
[0011] During the inference phase, the current state data is input into the trained deep Q-network model, which outputs the Q-values of each candidate action. The optimal propulsion action is selected based on the Q-values. As a preferred implementation, a preset exploration rate is used to select actions. A candidate action is randomly selected using the preset exploration rate, and the candidate action with the largest Q-value is selected using a non-exploration probability. The selected candidate action is converted into a propulsion direction vector and propulsion distance at the endoscope tip. The shortest distance between this propulsion direction vector and the lumen wall is calculated based on the 3D reconstructed point cloud data of the lumen. If the shortest distance is less than a preset safety distance, the propulsion direction vector is deflected towards the lumen centerline to obtain a corrected propulsion direction vector, further ensuring operational safety.
[0012] The path point corresponding to the current optimal advancement action is added to the path planning result. Specifically, a path queue is established, with the head of the queue representing the initial position of the endoscope tip before treatment. The current coordinates of the endoscope tip are obtained, and the target coordinates are calculated based on the advancement direction and distance in the current optimal advancement action. The target coordinates are inserted as a new path point into the tail of the path queue, and the total path length is accumulated. The target distance between the target coordinates and the target lesion point is calculated. If the target distance is less than a preset error threshold, path planning stops, and the path queue is output as the final endoscopic treatment path. Otherwise, the real-time pose data in the current state data is updated at the target coordinates, and the updated state data is used as the new input to the model to continue generating subsequent path points. This process is repeated iteratively to gradually guide the endoscope tip to the lesion location, forming a complete and safe endoscopic treatment path.
[0013] The method of this invention combines multidimensional sensing data with deep reinforcement learning. By optimizing the sequence decision-making of the endoscopic advancement process, it achieves environmentally adaptive path planning in endoscopic operation, which can reduce repeated manual trials and operational uncertainties, and improve the efficiency and safety of endoscopic treatment.
[0014] The technical effects and advantages provided by the present invention in the above technical solution are as follows: This method acquires real-time pose data of the endoscope tip, 3D reconstructed lumen point cloud data, and instrument tip force feedback data. Combined with lesion location information from the electronic medical record, the data from each modality are synchronized temporally and stitched together to form a multimodal state feature vector as the current state data. An electromagnetic positioning sensor acquires real-time pose data. Based on lumen images captured by the endoscope's front-end optical camera, a 3D reconstructed lumen point cloud is generated using a multi-view stereo vision algorithm. A six-dimensional force sensor installed at the endoscope tip acquires instrument tip force feedback. This state construction method simultaneously incorporates four types of information: spatial pose, 3D geometry, mechanical interaction, and lesion spatial coordinates. This enables the agent to perceive the real-time relative position between the endoscope and the lumen wall, the 3D contour of the lumen, and the magnitude of the contact force during decision-making, and to make a comprehensive judgment based on the target lesion location. Compared to solutions that rely solely on images or single poses, multimodal fusion enables the collision penalty term in the composite reward to be triggered negatively when the nearest distance is less than a preset safety threshold, guiding the strategy away from the lumen wall. At the same time, the target proximity reward term provides positive feedback based on the change in distance between the endoscope tip and the lesion location. This allows the planned path to maintain its approach towards the lesion while possessing the ability to avoid collisions with the lumen wall, thereby reducing the risk of intraoperative perforation and mucosal damage without sacrificing advancement efficiency.
[0015] When training a deep Q-network model using historical endoscopic operation records in distributed storage, these records are uploaded separately from endoscopic operation recording terminals at multiple medical institutions. The distributed storage then backs up the records to different storage nodes based on organ type and operation time. During training, the corresponding organ type is determined based on the lesion location information in the current state data, and the target storage node for that organ type is identified. The corresponding data slices are then loaded in parallel from the target storage node. The loaded historical records are stored in an experience replay pool, and a priority experience replay mechanism is used to sample small batches of training samples. The loss function is constructed using the current Q-network and the target Q-network to update the parameters. This distributed parallel storage and loading method overcomes the limitations of data scale from a single institution, allowing the training data to cover various anatomical variations and different operators' advancement preferences. Priority experience replay strengthens the learning weights for high-value collision samples and successfully arrived samples. The deep Q-network trained in this way can output more robust decisions on the direction and distance of propulsion when faced with no visible lumen morphology. The final path output by the path queue is more adaptable to different intestinal curvatures, degrees of luminal narrowing and lesion locations. At the same time, it reduces the planning failure caused by data distribution offset in actual deployment. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0017] Figure 1 This is a flowchart of an endoscopic treatment pathway planning method based on deep Q-networks; Figure 2 This is a statistical chart showing the priority distribution of experience quadruples in the experience replay pool; Figure 3 This is a schematic diagram of endoscopic treatment pathway planning based on deep Q-networks. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] See Figure 1This invention provides an endoscopic treatment path planning method based on a deep Q-network, comprising: acquiring real-time pose data of the endoscope tip, three-dimensional reconstructed point cloud data of the lumen, and force feedback data of the instrument tip during endoscopic treatment; constructing current state data by combining lesion location information in an electronic medical record; modeling the endoscopic advancement process as a Markov decision process, wherein the state of the Markov decision process is the current state data, the action is the advancement direction and distance of the endoscope tip in three-dimensional space, and the reward is a composite reward value; constructing a deep Q-network model including a current Q-network and a target Q-network, and training the deep Q-network model using historical endoscopic operation records in distributed storage; inputting the current state data into the trained deep Q-network model, outputting the Q-value of each candidate action, selecting the current optimal advancement action based on the Q-value, and adding the path point corresponding to the current optimal advancement action to the path planning result.
[0020] In practice, real-time pose data of the endoscope tip is acquired using an electromagnetic positioning sensor. The electromagnetic positioning sensor comprises an external magnetic field generator and a miniature sensor coil mounted on the endoscope tip probe. The external magnetic field generator produces a spatially varying magnetic field, inducing a voltage signal in the sensor coil. Based on the amplitude and phase of the induced voltage, the six-degree-of-freedom pose of the sensor coil relative to the magnetic field generator is calculated, including three spatial position coordinates and three attitude angles. The three attitude angles are converted into quaternions, which, together with the three spatial position coordinates, form the endoscope tip pose vector of the real-time pose data.
[0021] Based on images of the lumen acquired by the endoscope's front-end optical camera, a multi-view stereo vision algorithm is used to generate 3D reconstructed point cloud data of the lumen. The endoscope's front-end optical camera is a monocular or binocular endoscope camera, capturing a continuous sequence of images of the lumen's inner wall at a fixed frame rate during advancement. ORB feature points are extracted from every two adjacent frames in the continuous image sequence, and Hamming distance is used for feature matching to obtain a set of matching point pairs. Using the set of matching point pairs and the camera's intrinsic parameter matrix, inter-frame motion is estimated by solving the eigenvalue matrix and singular value decomposition, incrementally constructing a sparse point cloud model and a keyframe set. On the keyframe set, pixel-by-pixel multi-view stereo matching is performed on the depth map of each keyframe, and all depth maps are fused to generate dense 3D point cloud data. Voxel mesh downsampling is performed on the dense 3D point cloud data, with the voxel edge length set to 0.5 mm. All points located within the same voxel in the dense 3D point cloud data are merged into a voxel center point to obtain the downsampled 3D reconstructed point cloud data of the lumen. The number of points in the downsampled three-dimensional reconstruction point cloud data of the lumen is fixed to a preset constant N. If the number of points after downsampling is less than N, the zero vector points are used to make up to N points; if the number of points is greater than N, the redundant points are randomly removed. Finally, the three-dimensional reconstruction point cloud data of the lumen is represented as a one-dimensional vector of length 3N, with the x, y, and z coordinate values of N points arranged in sequence.
[0022] Force feedback data at the endoscope tip is acquired using a six-dimensional force sensor. This strain gauge force sensor, installed at the connection point between the endoscope tip and the treatment instrument, senses in real time the force components in three orthogonal directions and the torque components along three orthogonal axes generated by the contact between the instrument tip and tissue. The voltage signal output from the six-dimensional force sensor is amplified and filtered by a signal conditioning module, then converted into a digital signal by an analog-to-digital converter. A three-dimensional force vector and a three-dimensional torque vector are then calculated based on a pre-calibrated decoupling matrix. These three-dimensional force and torque vectors are concatenated into a six-dimensional force feedback vector, which serves as the force feedback data for the endoscope tip.
[0023] Real-time pose data, lumen 3D reconstruction point cloud data, and instrument end-effector force feedback data are synchronized temporally. The sampling timestamp of the real-time pose data is used as a reference, with a sampling frequency of 250Hz. For each frame of the lumen 3D reconstruction point cloud data, its generation time timestamp is extracted; this timestamp corresponds to the intermediate frame time of the acquired lumen image. For each sampling point of the instrument end-effector force feedback data, a timestamp is recorded, with a sampling frequency of 1000Hz. A linear interpolation method is used to interpolate the lumen 3D reconstruction point cloud data vector and the instrument end-effector force feedback data vector at each sampling time of the real-time pose data, resulting in interpolated vectors of the lumen 3D reconstruction point cloud data and the instrument end-effector force feedback data aligned with the sampling time of the real-time pose data.
[0024] Lesion location information and patient physiological parameters were extracted from the electronic medical record. The lesion location information consisted of the three-dimensional coordinates of the lesion center in the medical imaging coordinate system, with the medical images being preoperative computed tomography (CT) scans. Patient physiological parameters included heart rate, systolic blood pressure, diastolic blood pressure, and oxygen saturation, extracted from the structured physiological parameter field of the electronic medical record. The lesion location coordinates in the medical imaging coordinate system were converted to the lesion coordinates in the endoscopic operating coordinate system using a pre-defined coordinate transformation relationship. The coordinate transformation relationship was obtained through preoperative point cloud registration: preoperatively, a set of point clouds was acquired at the lumen inlet using an endoscope, and simultaneously, surface point clouds of the lumen inlet region were extracted from the medical images. The rotation matrix from the medical imaging coordinate system to the endoscopic operating coordinate system was calculated using an iterative nearest-point algorithm. With translation vector The coordinate vector in the lesion location information Apply transformation: in, It is the three-dimensional coordinate vector of the lesion center in the medical imaging coordinate system. It is the rotation matrix from the medical imaging coordinate system to the endoscopic operation coordinate system. It is a 3×3 orthogonal matrix, whose first column vector represents the direction of the x-axis of the medical imaging coordinate system in the endoscopic operation coordinate system, the second column vector represents the direction of the y-axis, and the third column vector represents the direction of the z-axis; It is the translation vector of the origin of the medical imaging coordinate system in the endoscopic operation coordinate system. Each component is in millimeters; These are the lesion coordinates in the transformed endoscopic operation coordinate system. Rotation matrix. Translation vector The transformation relationship is accepted when the mean registration error is less than 1 mm, determined through the above preoperative iterative nearest-point registration steps; otherwise, registration is performed again. The patient's four physiological parameters constitute a four-dimensional vector.
[0025] The four-dimensional vectors—endoscope tip pose vector (aligned from real-time pose data), lumen 3D reconstruction point cloud data interpolation vector, instrument tip force feedback data interpolation vector, lesion coordinates, and patient physiological parameters—are concatenated into a single one-dimensional vector at the same time, serving as the multimodal state feature vector. The concatenation order is fixed as follows: 7 elements of the endoscope tip pose vector, 3N elements of the lumen 3D reconstruction point cloud data interpolation vector, 6 elements of the instrument tip force feedback data interpolation vector, 3 elements of the lesion coordinates, and 4 elements of the patient physiological parameter vector. The total dimension of the multimodal state feature vector is 7 + 3N + 6 + 3 + 4. This multimodal state feature vector is then used as the current state data and input into subsequent processing stages.
[0026] In practice, the composite reward value is obtained by adding the collision penalty, the path smoothness reward, and the target proximity reward.
[0027] The collision penalty term determines the closest distance between the endoscope tip and the lumen wall based on the 3D reconstructed point cloud data of the lumen. The current coordinates of the endoscope tip in 3D space are denoted as follows: The point set contained in the three-dimensional reconstruction point cloud data of the lumen is denoted as ,in is the 3D coordinate vector of the m-th point in the 3D reconstructed point cloud data of the lumen, and N is the total number of points in the 3D reconstructed point cloud data of the lumen. The m-th point in the 3D reconstructed point cloud data of the endoscope tip and the lumen. The Euclidean distance is calculated using the following formula: ,in , , Representing points respectively The x, y, and z coordinates are calculated. All points in the 3D reconstructed point cloud data of the lumen are traversed, and the Euclidean distance from the endoscope tip to each point is calculated. Take all The minimum value is used as the closest distance between the endoscope tip and the lumen wall. Closest distance The calculation formula is: The preset safety threshold is set to 2 mm, a value determined based on the sum of the endoscope tip probe radius and the safety margin. (The last sentence appears to be incomplete and possibly refers to a different setting.) When the distance is less than 2 mm from the preset safety threshold, the collision penalty item is applied. Set to a negative value of -10; when the nearest distance When the collision penalty is greater than or equal to a preset safety threshold of 2 mm, Set to zero. In some embodiments, the collision penalty term is... The value is determined as follows: when At millimeters, ;when At millimeters, .
[0028] The path smoothness reward is determined based on the angle between the current propagation direction and the previous propagation direction. The current propagation direction is the three-dimensional direction vector corresponding to the action selected by the endoscope tip at the decision moment, denoted as... , It is a unit vector. The previous propulsion direction is the three-dimensional direction vector corresponding to the actual action executed at the previous decision moment, denoted as... , It is also a unit vector. The angle between the current propulsion direction and the previous propulsion direction. Calculated using the inverse cosine function: ,in This represents the dot product of two vectors. In practical implementation, the path smoothness reward term... Through the included angle The linear function is obtained as follows: ,in The unit is radians, and the range of values is... , This is the smoothness reward scaling factor. The range of values is ,set up This value is selected based on the principle of matching the magnitude of the path smoothness reward with that of the collision penalty and the target proximity reward, ensuring that the value ranges of the three reward items are similar and avoiding one of them dominating the composite reward value. The smaller the value, the closer the current direction of propulsion is to the previous direction, the lower the path curvature, and the higher the path smoothness bonus. The closer the value is ; The larger the value, the greater the path curvature, and the higher the path smoothness bonus. The smaller the value; when That is, when the current direction of advancement is completely opposite to the previous direction of advancement, the path smoothness reward item... .
[0029] The target proximity reward is determined based on the change in distance between the endoscope tip and the target point corresponding to the lesion location information in the current state. The coordinates of the target point corresponding to the lesion location information are denoted in the endoscopic operation coordinate system as follows. , It is a three-dimensional coordinate vector. The coordinates of the position of the endoscope tip in the current state are: The coordinates of the endoscope tip in the previous state were: In the current state, the endoscope tip is close to the target point. The distance between them Calculation, where This represents the L2 norm of the vector. In the previous state, the distance between the endoscope tip and the target point... The distance between them Calculate the change in distance. Defined as When the distance changes When it is a positive number, it indicates that the endoscope tip is close to the target point. The distance between them is getting shorter, and the target is getting closer to the reward item. Take positive values. ,in It is the approximate reward scaling factor. (Approximate reward scaling factor) The range of values is ,set up This value ensures that for every 1 mm the endoscope tip moves closer to the target point, the target proximity bonus increases by 1, which is consistent with the absolute value of the collision penalty (10) and the maximum value of the path smoothness bonus (0.5) on the same order of magnitude. When the distance changes... A negative number or zero indicates that the endoscope tip is not close to the target point or the distance remains constant, and the target is close (reward item). Set it to zero.
[0030] Composite reward value The calculation formula is: in, It is a collision penalty term, and its value is determined by the closest distance between the endoscope tip and the lumen wall. When less than 2 mm ,otherwise ; It is a path smoothness reward item, calculated as follows: , This is the current direction of progress. Compared with the previous direction of advancement The included angle, in radians; The target is closer to the reward item, when the distance changes. hour ,otherwise , The endoscope tip and target point in the previous state The distance minus the distance between the endoscope tip and the target point in the current state The change in distance obtained from the distance.
[0031] In practice, a current Q-network with a dual-competition structure is constructed. The current Q-network receives the current state data as input and outputs the Q-value for each candidate action. The current state data is a multimodal state feature vector, with its dimension denoted as... , Where N is the preset number of points in the 3D reconstructed point cloud data of the lumen. The total number of candidate actions is denoted as... , The number of preset candidate direction vectors for propulsion direction Number of preset distance settings for propulsion distance Multiplying them together yields the result, i.e. .
[0032] The current Q-network comprises a shared feature extraction layer, an advantage sub-network, and a value sub-network. The shared feature extraction layer consists of three one-dimensional convolutional layers connected in series. The first one-dimensional convolutional layer has 1 input channel and reshapes the multimodal state feature vector into a 1×... The first 1D convolutional layer takes a 2D tensor as input, outputs 32 channels, has a kernel size of 3, a stride of 1, and is padded with zeros at both ends to maintain the output length. It is followed by a batch normalization layer and a linear rectified activation function. The second 1D convolutional layer has 32 input channels, 64 output channels, a kernel size of 3, a stride of 1, and is padded with zeros at both ends to maintain the output length. It is followed by a batch normalization layer and a linear rectified activation function. The third 1D convolutional layer has 64 input channels, 128 output channels, a kernel size of 3, a stride of 1, and is padded with zeros at both ends to maintain the output length. It is followed by a batch normalization layer and a linear rectified activation function. The feature map output from the third 1D convolutional layer is compressed using global average pooling to obtain a 128-dimensional state feature vector. The shared feature extraction layer takes the current state data vector as input and outputs a 128-dimensional state feature vector.
[0033] The dominant subnetwork is connected to the shared feature extraction layer, receiving the 128-dimensional state feature vector output by the shared feature extraction layer as input. The dominant subnetwork consists of two fully connected layers. The first fully connected layer has an input dimension of 128 and an output dimension of 64, followed by a wired rectified activation function. The second fully connected layer has an input dimension of 64 and an output dimension of... No activation function is set. The output of the dominant subnetwork is a vector of length [length missing]. The vector, the first in the vector The element represents the selection of the first element given the state. Advantage value of each candidate action ,in This represents the current state data. Indicates the index of the candidate action. .
[0034] The value subnetwork is connected to the shared feature extraction layer, receiving the 128-dimensional state feature vector output by the shared feature extraction layer as input. The value subnetwork consists of two fully connected layers. The first fully connected layer has an input dimension of 128 and an output dimension of 64, followed by a wired rectified activation function. The second fully connected layer has an input dimension of 64 and an output dimension of 1, with no activation function. The output of the value subnetwork is a scalar representing the state at a given time. The value of the state under the following conditions .
[0035] The Q-value of each candidate action output by the current Q-network is calculated using the following formula: in, This indicates the current state of the Q network. Next candidate action The output Q value; The value is the state value output by the value subnetwork, which is a scalar. It is the output of the dominant subnetwork. The advantage value of each candidate action, The value ranges from 1 to Integers between; It is the total number of candidate actions; Indicates all The average of the advantage values of the candidate actions, where It is a summation index that iterates through all candidate actions.
[0036] Construct a target Q-network with the same structure as the current Q-network. The target Q-network also includes a shared feature extraction layer, a dominance subnetwork, and a value subnetwork. The number of channels, kernel size, stride, padding, and input / output dimensions of the fully connected layers are identical to the current Q-network. At the initial stage of training the deep Q-network model, the parameters of the target Q-network are kept consistent with the initial parameters of the current Q-network, and are randomly generated using the He initialization method. During training, the deep Q-network model completes a predetermined number of steps... After gradient descent updates, all parameters of the current Q-network are completely copied to the target Q-network. (Predetermined number of steps) The value is set to 2000. This setting ensures that the parameter update interval of the target Q-network is sufficiently large to maintain the relative stability of the target Q-value, while preventing the target Q-network from significantly lagging behind the parameter changes of the current Q-network due to excessively large intervals. The copy operation is implemented using a layer-by-layer parameter assignment method: iterating through each layer of the target Q-network, the weight tensor and bias tensor of the corresponding layer in the current Q-network are directly assigned to the corresponding layer in the target Q-network. The target Q-network does not participate in gradient backpropagation during training; it is only used to calculate the target Q-value.
[0037] In practice, historical endoscopic operation records are uploaded to distributed storage by endoscopic operation recording terminals from multiple medical institutions. After each endoscopic treatment operation is completed, each endoscopic operation recording terminal packages all decision steps recorded in time sequence during the operation into a historical endoscopic operation record. Each historical endoscopic operation record contains a historical state data sequence, a historical action sequence, a historical reward value sequence, and a historical next state data sequence. Each historical state data corresponds to a multimodal state feature vector composed of the real-time pose of the endoscope tip, the 3D reconstructed point cloud of the lumen, the force feedback of the instrument tip, the lesion location information, and the patient's physiological parameters at a given time step. Each historical action corresponds to a candidate action code represented by a combination of direction index and distance level index. Each historical reward value corresponds to the composite reward value of the environmental feedback after performing the historical action at the current time step. Each historical next state data is the multimodal state feature vector of the next time step reached after performing the historical action. The distributed storage consists of storage nodes distributed across multiple geographical locations, interconnected by a high-speed network. When receiving historical endoscopic operation records, the distributed storage parses each record, extracting lesion coordinates from the historical state data. It then determines the organ type based on the anatomical region where the lesion coordinates are located and a predefined organ type mapping table. This organ type mapping table divides the spatial region in the endoscopic operation coordinate system, referenced to the origin, into multiple non-overlapping cubic regions, each corresponding to a specific organ type. Simultaneously, the distributed storage extracts the operation time from each historical endoscopic operation record; this time is the moment the endoscopic operation recording terminal begins recording. The distributed storage then fragments the historical endoscopic operation records based on organ type and operation time. Records with the same organ type and operation time within the same time interval are grouped into a single fragment. Each fragment is sent to different storage nodes for backup storage, with copies of each fragment stored on at least two storage nodes. This fragmentation process ensures that each storage node only stores fragmented data for a portion of the historical endoscopic operation records, covering a portion of the organ type and time interval.
[0038] When training a deep Q-network model, the corresponding organ type is determined based on the lesion location information in the current state data, and the target storage node corresponding to the organ type is identified. The corresponding slice data from historical endoscopic operation records is then loaded in parallel from the target storage node. Specifically, the following steps are taken: A set of current state data samples for training is obtained. The lesion coordinates of each sample are extracted from this set, and the organ type corresponding to that sample is determined according to the organ type mapping table. The organ type with the highest frequency among all samples is selected as the target organ type for this training. The metadata server of the distributed storage is queried to obtain the address list of all storage nodes storing slices of the target organ type. Several storage nodes with the lowest load are selected as target storage nodes, and a parallel data channel is established to read the slice data in parallel from the target storage nodes. Each target storage node returns its locally stored historical endoscopic operation records belonging to the target organ type and with operation times within a specified time range. The data returned by all target storage nodes are merged into a complete training dataset containing multiple historical endoscopic operation records. Each historical endoscopic operation record is expanded into multiple quadruplets, each containing a historical state data, a historical action, a historical reward value, and a historical next state data.
[0039] Historical endoscopic procedures are stored in an experience replay pool. The experience replay pool is a fixed-capacity circular buffer, with a maximum capacity of one million experience quadruples. When the experience replay pool is full, the oldest experience quadruple is overwritten by the newly written experience quadruple. Each quadruple of a historical endoscopic procedure loaded from distributed storage is sequentially stored in the experience replay pool, and each newly stored experience quadruple is assigned an initial priority value. Initial priority value Set to the maximum priority value of all current experience quadruples in the experience replay pool. If the experience replay pool is empty, then the initial priority value is... Set to 1.0.
[0040] A priority-based experience replay mechanism is used to sample mini-batch training samples from the experience replay pool. During each sampling operation, the sampling probability is calculated based on the priority of each experience quadruple in the experience replay pool. For the first... A set of empirical quadruples, whose priority is denoted as Sampling probability pass Confirmed, among which This represents the total number of experience quadruplets currently stored in the experience replay pool. It is a priority index, and its value range is... ,set up This setting strikes a balance between fully uniform sampling and fully greedy priority sampling, giving higher-priority empirical quadruples a higher probability of being selected, while preserving the opportunity to explore lower-priority empirical quadruples. The update method is as follows: after an empirical quadruple is used for training, its priority is recalculated based on the absolute value of its temporal difference error. ,in For timing difference error, It is a very small positive number, set To prevent zero priority due to zero timing difference error, thus avoiding never sampling, the number of samples is drawn without replacement from the empirical replay pool based on the sampling probability distribution. Empirical quadruplets constitute mini-batch training samples, with batch size... Set to 64.
[0041] For each empirical quadruple in the mini-batch training samples, record its corresponding historical state data. Historical actions Historical reward value and historical next state data ,in This is the index of empirical quadruples in a mini-batch of training samples. The value range is 1 to An integer. All historical state data from the mini-batch training samples. and corresponding historical actions Input the current Q-network. The current Q-network is for each historical state data. Output all historical state data. Extract the Q-value vector of candidate actions. The corresponding Q value is denoted as the current Q value. ,in This represents the set of learnable parameters for the current Q-network. It includes all historical next-state data from the mini-batch training samples. Input the target Q-network, and the target Q-network outputs the next state data for each history. All Given a Q-value vector of candidate actions, take the maximum value from each Q-value vector, denoted as [Q-value vector]. ,in This represents the set of parameters for the target Q-network. The index is used to iterate through all candidate actions. For each empirical quadruple, the target Q-value is calculated. If the historical next state data If the state is terminated, then the target Q value is... Otherwise, the target Q value ,in Set as a discount factor This setting makes the endoscope tip focus more on long-term cumulative rewards.
[0042] During training, importance sampling weights need to be calculated to correct for distribution bias introduced by prioritizing empirical replay. For the first [item name] in a mini-batch training sample... An experience quadruple, whose index in the experience replay pool is denoted as . The corresponding sampling probability is Importance sampling weight pass Calculation, where It is a compensation index, with a value range of [value range missing]. Set at the start of training And as the number of training steps increases linearly to 1.0, the bias in the later stages of training is completely corrected. It is all empirical quadruples within the mini-batch training samples. The maximum value is used to normalize the importance sampling weights, ensuring that the weights are within a reasonable range. A loss function is constructed based on the difference between the current Q-value and the target Q-value. The loss function is the weighted mean squared error on a mini-batch of training samples, calculated using the following formula: in, Indicates information about the current Q network parameters The loss function value; This is the batch size of the mini-batch training samples, set to 64; It is the index of empirical quadruples in mini-batch training samples; It is the first Importance sampling weights corresponding to the empirical quadruples; It is the current Q network's response to the input historical state data. and actions The calculated current Q value; It is the first The target Q-value of the empirical quadruple is calculated using the target Q-network and the reward value. After calculating the loss function value, the loss function with respect to the current Q-network parameters is obtained through automatic differentiation. The gradient is calculated, and the current Q-network parameters are updated using an adaptive moment estimation optimizer. The learning rate of the adaptive moment estimation optimizer is set to 0.0001, the first moment decay rate is set to 0.9, and the second moment decay rate is set to 0.999. After each parameter update, the target Q-network parameters remain unchanged until the cumulative parameter update steps reach the replication step threshold. At this point, the current Q-network parameters are completely replicated to the target Q-network. The replication step threshold can be adjusted according to the training stability requirements.
[0043] See Figure 2 The horizontal axis in the graph represents the priority of empirical quadruples. The range is from 0 to 15, with the vertical axis representing the number of empirical quadruples within the corresponding priority interval, in units of "number". The legend identifies the data as "Number of Empirical Quadruples". As can be seen from the bar distribution in the graph, the priority of empirical quadruples exhibits a clear right-skewed distribution: the vast majority of empirical quadruples have a priority concentrated in the lower interval, especially in the range of 0 to 2. The bar with the highest number corresponds to a priority of approximately 0.2 to 0.3, with more than 3500 empirical quadruples. Subsequently, the number of empirical quadruples decreases rapidly within the priority interval, and the number of empirical quadruples with a priority higher than 5 is extremely small, close to zero.
[0044] In practice, the trained deep Q-network model outputs the Q-values of all candidate actions based on the current state data. The input to the trained deep Q-network model is the multimodal state feature vector corresponding to the current state data, and the output is a vector with dimension [missing information]. The vector, Set the total number of candidate actions. Each element in the vector corresponds to the Q-value of the candidate action in the current state data.
[0045] When selecting the optimal advance action based on the Q value, a preset exploration rate is used for action selection. The preset exploration rate uses... Indicates, setting This setting preserves a certain degree of random exploration capability during the planning phase, preventing the process from becoming stuck in localized areas. (Based on a preset exploration rate) A candidate action is randomly selected uniformly from all candidate actions with a probability of non-exploratory. The probability of selecting the candidate action with the largest Q value is 0.95.
[0046] Deep Q-network model output dimension The setting method is determined based on the encoding method of the candidate actions. The propulsion direction is uniformly sampled on the three-dimensional sphere. candidate direction vectors Set to 128; propulsion distance is divided into One distance setting, The distance is set to 5, with five distance levels: 1 mm, 2 mm, 3 mm, 4 mm, and 5 mm. Each candidate action is represented by a combination of the direction index in the candidate direction vector and the distance level index in the distance level vector. During encoding, the integer index of the candidate action... Index by direction and distance gear index Combination ,in The value range is an integer from 0 to 127. The value of is an integer ranging from 0 to 4. During decoding, it is determined by the candidate action index. Get the direction index and distance gear index According to the direction index The corresponding unit direction vector is selected from the 128 pre-calculated candidate direction vectors as the propulsion direction vector, based on the distance gear index. Take out the corresponding propulsion distance Millimeters. 128 candidate direction vectors were obtained by uniformly sampling on a three-dimensional sphere using a recursive subdivision method of icosahedrons, ensuring that the direction distribution has no obvious clustering direction.
[0047] The selected candidate action is converted into the advancement direction vector of the endoscope tip. and propulsion distance Then, the propulsion direction vector is calculated based on the three-dimensional reconstruction point cloud data of the lumen. The shortest distance between the lumen wall and the point cloud data corresponding to the 3D reconstruction of the lumen. The current coordinates of the endoscope tip in 3D space are marked as point. For each point in the 3D reconstruction point cloud data of the lumen. , For the point index, calculate from point Time vector Calculate vectors In the direction vector of propulsion Projected length When the projection length When it is a positive number, the point Located ahead of the direction of propulsion, calculation point Perpendicular distance to the straight line of the direction of propulsion If the vertical distance If the projected length is less than the median radius of the tube cross-section, then the projected length will be... This is denoted as a valid candidate collision distance value. After traversing all points in the 3D reconstructed point cloud data of the cavity, the minimum value among all valid candidate collision distance values is taken as the propulsion direction vector. Shortest distance between the tube wall and the lumen wall If no valid candidate collision distance value exists, then... It is considered to be infinite.
[0048] The preset safety distance is set to 1.5 mm, which is obtained by adding a 0.5 mm radius to the endoscope tip probe and a 1 mm safety margin. If the shortest distance... If the distance is less than the preset safety distance of 1.5 mm, it indicates that continuing to advance according to the original propulsion direction vector poses a risk of collision with the cavity wall. Therefore, the propulsion direction vector is deflected towards the centerline of the cavity's 3D reconstructed point cloud data to obtain the corrected propulsion direction vector. The centerline direction was obtained by performing L1-axis-based skeleton extraction on the 3D reconstructed point cloud data of the lumen, resulting in a series of centerline points, and the tangent direction at each centerline point was calculated. (Based on points...) Based on the baseline, search distance point The nearest centerline point is used as the unit vector of the tangent direction at that centerline point as the direction of the lumen centerline. The deflection is calculated using the following formula: in, It is the original propulsion direction unit vector. It is the unit vector along the centerline of the lumen. It is the deflection coefficient, and its value range is... ,set up This setting causes the corrected propulsion direction vector to deflect towards the centerline by an angle equivalent to 60% of the original deviation, avoiding the pipe wall without excessively deviating from the original propulsion intention. The denominator represents the L2 norm of the vector within the parentheses, used to normalize the result to a unit vector. Corrected propulsion direction vector Compared to the original propulsion distance Together, they constitute the current optimal propulsion action. If the shortest distance... If the distance is greater than or equal to the preset safety distance of 1.5 mm, no deflection is required, and the original propulsion direction vector will be returned to normal. and propulsion distance It is directly taken as the optimal action to take at present.
[0049] The process of adding the path point corresponding to the current optimal advancement action to the path planning result is as follows: During path planning initialization, a path queue is established. The head of the queue is the initial position coordinate of the endoscope tip before treatment, which is acquired by an electromagnetic positioning sensor in a preoperative static state. Simultaneously, the cumulative total path length is initialized to zero. The current position coordinates of the endoscope tip in three-dimensional space at the current moment are then obtained. Based on the propulsion direction vector in the current optimal propulsion action. and propulsion distance Calculate the target coordinates ,in The final selected propulsion direction vector may be or The calculated target coordinates It is inserted as a new waypoint at the tail of the path queue, and the total cumulative path length is increased. .
[0050] Calculate target coordinates Target points corresponding to lesion location information target distance between Target point corresponding to the lesion location information. These are the coordinates of the lesion center in the endoscopic operation coordinate system. If the target distance... If the distance is less than the preset error threshold (set at 3 mm, determined by a combination of endoscopic instrument operation precision and lesion size), path planning stops, and all path points in the path queue from head to tail are output sequentially as the final endoscopic treatment path. If the target distance... If the error is greater than or equal to the preset error threshold of 3 mm, then at the target coordinates Update the real-time pose data in the current state data, replacing the endoscope end position coordinates in the current state data with... The orientation angle is kept constant or adjusted according to the lumen's direction to obtain updated current state data. This updated current state data is then used as new input to the deep Q-network model, which continues to output new Q-value vectors to generate subsequent path points. This path point generation and path queue expansion process is repeated until new target coordinates and target points are generated. If the target distance between them is less than the preset error threshold of 3 mm, the path planning will terminate.
[0051] See Figure 3 The figure illustrates the endoscopic treatment path planned based on the deep Q-network model described in this embodiment. The coordinate system is in millimeters, with the horizontal axis representing the X-coordinate and the vertical axis representing the Y-coordinate. The gray scatter dots represent the point cloud data projected onto a two-dimensional plane after the 3D reconstruction of the lumen wall, showcasing the spatial morphology of the lumen channel. The green solid circles mark the starting point of the endoscopic advancement path, with coordinates close to the origin (0,0), corresponding to the initial end-end position of the endoscope before endoscopic treatment. The red pentagram marks the target lesion point, with coordinates approximately (0,18), reflecting the lesion's 3D spatial projection in the endoscopic operation coordinate system.
[0052] The blue solid line represents the path planning result, indicating that the endoscope tip advances along the planned path from the starting point until it approaches the target lesion. The path exhibits a continuous and smooth curved shape, with path points densely distributed in the central region of the lumen, largely remaining within the distribution range of the lumen wall point cloud, indicating that the path planning effectively avoids boundary crossings or collisions. The path gradually extends upwards from the starting point, passing through the curved areas of the lumen, demonstrating the adaptability of the deep Q-network model to complex lumen structures. The overall path follows an "S"-shaped curve, consistent with the spatial distribution trend of the lumen wall point cloud, indicating that the path planning fully utilizes the lumen centerline information to achieve an advancement strategy that avoids the lumen wall.
[0053] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for endoscopic treatment path planning based on deep Q-networks, characterized in that, include: Acquire real-time pose data of the endoscope tip, three-dimensional reconstruction point cloud data of the lumen, and force feedback data of the instrument tip during endoscopic treatment, and construct current status data by combining lesion location information in electronic medical records; The endoscope advancement process is modeled as a Markov decision process, where the state of the Markov decision process is the current state data, the action is the advancement direction and distance of the endoscope tip in three-dimensional space, and the reward is a composite reward value. Construct a deep Q-network model that includes the current Q-network and the target Q-network, and train the deep Q-network model using historical endoscopy operation records in distributed storage; The current state data is input into the trained deep Q-network model, which outputs the Q-value of each candidate action. The current optimal action is selected based on the Q-value, and the path point corresponding to the current optimal action is added to the path planning result.
2. The endoscopic treatment path planning method based on deep Q-networks according to claim 1, characterized in that, The acquisition of real-time pose data of the endoscope tip, three-dimensional reconstruction point cloud data of the lumen, and force feedback data of the instrument tip during endoscopic treatment includes: The real-time pose data of the endoscope tip is obtained through an electromagnetic positioning sensor. Based on the lumen images acquired by the optical camera at the front end of the endoscope, a multi-view stereo vision algorithm is used to generate three-dimensional reconstructed point cloud data of the lumen. Force feedback data at the end of the instrument is obtained by a six-dimensional force sensor installed at the end of the endoscope. The real-time pose data, the three-dimensional reconstruction point cloud data of the lumen, and the force feedback data of the instrument end are synchronized in time and spliced into a multimodal state feature vector, which is then used as the current state data.
3. The endoscopic treatment path planning method based on deep Q-networks according to claim 1, characterized in that, The composite reward value includes a collision penalty, a path smoothness reward, and a target proximity reward. The collision penalty term is determined based on the three-dimensional reconstruction point cloud data of the lumen to determine the closest distance between the endoscope tip and the lumen wall. When the closest distance is less than a preset safety threshold, the collision penalty term is set to a negative value. The path smoothness bonus is determined based on the angle between the current direction of travel and the previous direction of travel. The smaller the angle, the larger the value of the path smoothness bonus. The target proximity reward is determined based on the change in distance between the endoscope tip and the target point corresponding to the lesion location information in the current state. When the change in distance indicates that the distance between the endoscope tip and the target point has shortened, the target proximity reward takes a positive value.
4. The endoscopic treatment path planning method based on deep Q-networks according to claim 1, characterized in that, The construction of a deep Q-network model that includes the current Q-network and the target Q-network includes: Construct a current Q-network with a dual-competition structure, wherein the current Q-network includes a shared feature extraction layer, a dominant subnetwork, and a value subnetwork; The shared feature extraction layer performs convolution processing on the current state data and outputs state features. The advantage sub-network outputs the advantage value of each candidate action based on the state features, and the value sub-network outputs the state value based on the state features. The Q value of the current Q network output is obtained by adding the state value to the advantage value and then subtracting the average advantage value of all candidate actions. Construct a target Q-network with the same structure as the current Q-network, and copy the parameters of the current Q-network to the target Q-network every preset number of steps during training.
5. The endoscopic treatment path planning method based on deep Q-networks according to claim 1, characterized in that, The process of training the deep Q-network model using historical endoscopic operation records in distributed storage includes: The historical endoscopy operation records are read in parallel from multiple storage nodes in the distributed storage. Each historical endoscopy operation record includes historical state data, historical action, historical reward value, and historical next state data. The historical next state data is the state data reached after the historical action is performed. The historical endoscopic operation records are stored in the experience playback pool, and a small batch of training samples are sampled from the experience playback pool using a priority experience playback mechanism. The historical state data and historical actions from the mini-batch training samples are input into the current Q network to obtain the current Q value; The historical next state data from the mini-batch training samples is input into the target Q network to obtain the target Q value; A loss function is constructed based on the difference between the current Q value and the target Q value, and the parameters of the current Q network are updated through backpropagation.
6. The endoscopic treatment path planning method based on deep Q-networks according to claim 5, characterized in that, The step of reading the historical endoscopy operation records in parallel from multiple storage nodes in the distributed storage includes: The historical endoscopic operation records are uploaded to the distributed storage by endoscopic operation recording terminals from multiple medical institutions. The distributed storage backs up the historical endoscopic operation records to different storage nodes in segments according to organ type and operation time. When training the deep Q-network model, the corresponding organ type is determined based on the lesion location information in the current state data, and the target storage node corresponding to the organ type is determined. The corresponding slice data in the historical endoscopic operation record is loaded in parallel from the target storage node.
7. The endoscopic treatment path planning method based on deep Q-networks according to claim 1, characterized in that, The step of selecting the current optimal propulsion action based on the Q value includes: The trained deep Q-network model is used to output the Q-values of all candidate actions under the current state data; The current optimal action is selected using a preset exploration rate, any candidate action is randomly selected using the preset exploration rate, and the candidate action with the largest Q value is selected using a non-exploration probability, where the non-exploration probability is one minus the preset exploration rate. The selected candidate action is converted into the advancement direction vector and advancement distance of the endoscope tip; Calculate the shortest distance between the propulsion direction vector and the cavity wall corresponding to the three-dimensional reconstruction point cloud data of the cavity based on the cavity three-dimensional reconstruction point cloud data. If the shortest distance is less than the preset safety distance, the propulsion direction vector is deflected toward the centerline of the three-dimensional reconstruction point cloud data of the cavity to obtain the corrected propulsion direction vector. The corrected propulsion direction vector and the propulsion distance are used as the current optimal propulsion action.
8. The endoscopic treatment path planning method based on deep Q-networks according to claim 7, characterized in that, Adding the path point corresponding to the current optimal propulsion action to the path planning result includes: Establish a path queue, wherein the head of the path queue is the initial position of the endoscope tip before treatment; Obtain the current position coordinates of the endoscope tip in three-dimensional space at the current moment; Calculate the target coordinates from the current position coordinates based on the propulsion direction and propulsion distance in the current optimal propulsion action; Insert the target coordinates as a new path point into the tail of the path queue, and accumulate the total path length of the path queue; Calculate the target distance between the target coordinates and the target point corresponding to the lesion location information; If the target distance is less than a preset error threshold, path planning is stopped, and the path queue is output as the final endoscopic treatment path. If the target distance is greater than or equal to the preset error threshold, the real-time pose data in the current state data is updated at the target coordinates, and the updated current state data is used as the new input of the deep Q-network model to continue generating subsequent path points.
9. The endoscopic treatment path planning method based on deep Q-networks according to claim 8, characterized in that, The action, namely the direction and distance of the endoscope tip's advancement in three-dimensional space, is generated in the following way: The propulsion direction is uniformly sampled into a preset number of candidate direction vectors on a three-dimensional sphere; The propulsion distance is divided into a preset number of distance levels; Each candidate action is represented by a combination of the direction index in the candidate direction vector and the distance index in the distance level; The output dimension of the deep Q-network model is equal to the product of the preset number of candidate direction vectors and the preset number of distance levels.
10. The endoscopic treatment path planning method based on deep Q-networks according to claim 2, characterized in that, The step of synchronizing the real-time pose data, the three-dimensional reconstructed point cloud data of the lumen, and the force feedback data of the instrument end effector in time and concatenating them into a multimodal state feature vector includes: Extract lesion location information and patient physiological parameters from the electronic medical record; The lesion location information is transformed from the medical imaging coordinate system to the endoscopic operation coordinate system to obtain the lesion coordinates in the endoscopic operation coordinate system. The real-time pose data, the three-dimensional reconstruction point cloud data of the lumen, the force feedback data of the instrument end effector, the lesion coordinates, and the patient's physiological parameters are synchronized in time and then stitched together to form the multimodal state feature vector; The multimodal state feature vector is used as the current state data.
