Tool feature point position error compensation method and device, equipment and medium

CN122936798APending Publication Date: 2026-10-20GUANGZHOU AIMUYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611073277.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

但这类传统补偿方法存在明显短板,面对场景中突发的干扰数据时适配能力差,不仅无法快速修正定位偏差,难以适配手术导航实时、精准的补偿需求

Benefits of technology

[0021]在本申请实施例中,获取目标工具上各标记物的第一平移坐标与法向量、所述目标工具上工具特征点位的第二平移坐标以及数据置信度;根据所述第一平移坐标、所述法向量、所述第二平移坐标以及所述数据置信度,构建几何特征向量;将所述几何特征向量输入至预先训练的定位误差预测模型,得到所述定位误差预测模型输出的预测定位误差向量;根据所述工具特征点位的第二平移坐标与所述预测定位误差向量,确定所述工具特征点位的补偿平移坐标。上述工具特征点位的定位误差补偿方法,融合标记物坐标、法向量及数据置信度等多维度信息构建几何特征,依托训练完成的误差预测模型精准解算定位误差,显著提升手术导航场景下工具定位的精准度与实时性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and medium for compensating for positioning errors of tool feature points, belonging to the field of surgical navigation and positioning technology. The method includes: constructing a geometric feature vector based on the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and data confidence; inputting the geometric feature vector into a pre-trained positioning error prediction model to obtain a predicted positioning error vector output by the positioning error prediction model; and determining the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector. This technical solution integrates multi-dimensional information such as marker coordinates, normal vectors, and data confidence to construct geometric features, and relies on a trained error prediction model to accurately calculate positioning errors, significantly improving the accuracy and real-time performance of tool positioning in surgical navigation scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of surgical navigation and positioning technology, specifically relating to methods, devices, equipment, and media for compensating for positioning errors of tool feature points. Background Technology

[0002] In high-precision near-infrared optical positioning scenarios, especially in surgical navigation, the primary method relies on binocular or multi-view cameras to capture reflective markers on the surface of the target tool. Triangulation algorithms are then used to calculate the three-dimensional spatial coordinates of these markers, and these coordinates are combined with algorithms to fit the spatial positions of tool feature points, achieving precise tool orientation and location. However, this method is susceptible to issues such as marker occlusion, field-of-view shift, differences in surface reflectivity, and marker geometric noise sensitivity. This results in positioning errors between the calculated tool feature points and the actual tool feature points, making it difficult to meet the demands of high-precision operations.

[0003] Currently, the mainstream error compensation method in the industry involves repeatedly collecting spatial coordinate data of markers, calculating the average value as a reference, and then constructing a weight matrix by combining the data variance and covariance. Translation and rotation parameters are then calculated iteratively to reduce positioning errors. However, this traditional compensation method has significant shortcomings. It has poor adaptability to sudden interference data in the scene, failing to quickly correct positioning deviations and struggling to meet the real-time and precise compensation requirements of surgical navigation. Furthermore, this method relies solely on marker coordinate data for optimization, failing to comprehensively uncover the root causes of errors. When marker surfaces are contaminated or located at the edge of the field of view, leading to deteriorated optical acquisition, positioning errors cannot be effectively compensated, and positioning accuracy remains limited. Summary of the Invention

[0004] This application provides a method, device, equipment, and medium for compensating for positioning errors of tool feature points. The purpose is to integrate multi-dimensional information such as marker coordinates, normal vectors, and data confidence to construct geometric features, and to accurately calculate positioning errors based on a trained error prediction model, thereby significantly improving the accuracy and real-time performance of tool positioning in surgical navigation scenarios.

[0005] In a first aspect, embodiments of this application provide a method for compensating for positioning errors of tool feature points, the method comprising: Obtain the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level; A geometric feature vector is constructed based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence level. The geometric feature vector is input into a pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The compensated translation coordinates of the tool feature points are determined based on the second translation coordinates of the tool feature points and the predicted positioning error vector.

[0006] Furthermore, the step of constructing a geometric feature vector based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence score includes: Calculate the plane cosine angle of each of the markers based on the normal vector; Calculate the distance between the feature points corresponding to each marker based on the first translation coordinate and the second translation coordinate; Calculate the origin Euclidean distance corresponding to the tool feature point based on the second translation coordinates; A geometric feature vector is constructed based on the plane cosine angle, the distance between feature points, the Euclidean distance from the origin, and the data confidence level.

[0007] Furthermore, the process of pre-training the positioning error prediction model includes: Obtain a preset number of geometric feature vectors and the corresponding true positioning error vectors of the geometric feature vectors; The predetermined number of geometric feature vectors are divided into training geometric feature vectors and verification geometric feature vectors; The pre-constructed positioning error prediction model is trained based on the training geometric feature vector and the corresponding true positioning error vector. The verification loss of the positioning error prediction model is determined based on the verification geometric feature vector and the corresponding true positioning error vector. The training strategy is adjusted based on the verification loss, and the above training and verification steps are repeated until the training stopping condition is met.

[0008] Furthermore, the step of training the pre-constructed positioning error prediction model based on the training geometric feature vector and the corresponding true positioning error vector includes: A first standardization parameter is determined based on the training geometric feature vector, and the training geometric feature vector is standardized based on the first standardization parameter to obtain a standard training geometric feature vector. The second standardization parameter is determined based on the true positioning error vector corresponding to the training geometric feature vector, and the true positioning error vector corresponding to the training geometric feature vector is standardized based on the second standardization parameter to obtain the standard true positioning error vector. The standard training geometric feature vector is input into the pre-built positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The comprehensive training loss is determined based on the predicted positioning error vector and the standard true positioning error vector, and the positioning error prediction model is backpropagated based on the comprehensive training loss.

[0009] Furthermore, determining the comprehensive training loss based on the predicted positioning error vector and the standard true positioning error vector includes: Based on the predicted positioning error vector and the standard true positioning error vector, calculate the robust regression loss, the orientation consistency loss, and the squared regularization loss. The robust regression loss, the directional consistency loss, and the squared regularization loss are weighted and summed to obtain the comprehensive training loss.

[0010] Further, determining the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector includes: The predicted positioning error vector is inversely standardized according to the second standardization parameter to obtain the target positioning error vector. The compensated translation coordinates of the tool feature points are obtained by subtracting the target positioning error vector from the second translation coordinates of the tool feature points.

[0011] Furthermore, adjusting the training strategy based on the verification loss includes: Obtain the historical minimum validation loss, the first cumulative number of stalled epochs, and the second cumulative number of stalled epochs; wherein, the first cumulative number of stalled epochs is the number of consecutive training epochs in which the historical minimum validation loss remains unchanged, and the second cumulative number of stalled epochs is the cumulative sum of the number of training epochs in which the historical minimum validation loss remains unchanged throughout the entire training process; If the validation loss is lower than the historical lowest validation loss, the training strategy is determined to be to maintain the current learning rate and the first cumulative stagnation rounds are cleared. If the verification loss is not less than the historical lowest verification loss, update the first cumulative number of stalled rounds and the second cumulative number of stalled rounds. If the first cumulative number of stalled rounds has not reached the first stalled rounds threshold, the training strategy is determined to maintain the current learning rate unchanged. If the first cumulative stagnant rounds reach the first stagnant rounds threshold and the second cumulative stagnant rounds do not reach the second stagnant rounds threshold, the training strategy is determined to be to reduce the current learning rate and clear the first cumulative stagnant rounds; wherein the first stagnant rounds threshold is less than the second stagnant rounds threshold; If the second cumulative number of stalled rounds reaches the second stalled rounds threshold, the training strategy is determined to be to stop training.

[0012] Secondly, embodiments of this application provide a positioning error compensation device for tool feature points, the device comprising: The data acquisition module is used to acquire the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level; The vector construction module is used to construct a geometric feature vector based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence. The error prediction module is used to input the geometric feature vector into a pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The positioning compensation module is used to determine the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector.

[0013] Furthermore, the vector construction module is specifically used for: Calculate the plane cosine angle of each of the markers based on the normal vector; Calculate the distance between the feature points corresponding to each marker based on the first translation coordinate and the second translation coordinate; Calculate the origin Euclidean distance corresponding to the tool feature point based on the second translation coordinates; A geometric feature vector is constructed based on the plane cosine angle, the distance between feature points, the Euclidean distance from the origin, and the data confidence level.

[0014] Furthermore, the device is also used for: Obtain a preset number of geometric feature vectors and the corresponding true positioning error vectors of the geometric feature vectors; The predetermined number of geometric feature vectors are divided into training geometric feature vectors and verification geometric feature vectors; The pre-constructed positioning error prediction model is trained based on the training geometric feature vector and the corresponding true positioning error vector. The verification loss of the positioning error prediction model is determined based on the verification geometric feature vector and the corresponding true positioning error vector. The training strategy is adjusted based on the verification loss, and the above training and verification steps are repeated until the training stopping condition is met.

[0015] Furthermore, the device is also used for: A first standardization parameter is determined based on the training geometric feature vector, and the training geometric feature vector is standardized based on the first standardization parameter to obtain a standard training geometric feature vector. The second standardization parameter is determined based on the true positioning error vector corresponding to the training geometric feature vector, and the true positioning error vector corresponding to the training geometric feature vector is standardized based on the second standardization parameter to obtain the standard true positioning error vector. The standard training geometric feature vector is input into the pre-built positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The comprehensive training loss is determined based on the predicted positioning error vector and the standard true positioning error vector, and the positioning error prediction model is backpropagated based on the comprehensive training loss.

[0016] Furthermore, the device is also used for: Based on the predicted positioning error vector and the standard true positioning error vector, calculate the robust regression loss, the orientation consistency loss, and the squared regularization loss. The robust regression loss, the directional consistency loss, and the squared regularization loss are weighted and summed to obtain the comprehensive training loss.

[0017] Furthermore, the positioning compensation module is specifically used for: The predicted positioning error vector is inversely standardized according to the second standardization parameter to obtain the target positioning error vector. The compensated translation coordinates of the tool feature points are obtained by subtracting the target positioning error vector from the second translation coordinates of the tool feature points.

[0018] Furthermore, the device is also used for: Obtain the historical minimum validation loss, the first cumulative number of stalled epochs, and the second cumulative number of stalled epochs; wherein, the first cumulative number of stalled epochs is the number of consecutive training epochs in which the historical minimum validation loss remains unchanged, and the second cumulative number of stalled epochs is the cumulative sum of the number of training epochs in which the historical minimum validation loss remains unchanged throughout the entire training process; If the validation loss is lower than the historical lowest validation loss, the training strategy is determined to be to maintain the current learning rate and the first cumulative stagnation rounds are cleared. If the verification loss is not less than the historical lowest verification loss, update the first cumulative number of stalled rounds and the second cumulative number of stalled rounds. If the first cumulative number of stalled rounds has not reached the first stalled rounds threshold, the training strategy is determined to maintain the current learning rate unchanged. If the first cumulative stagnant rounds reach the first stagnant rounds threshold and the second cumulative stagnant rounds do not reach the second stagnant rounds threshold, the training strategy is determined to be to reduce the current learning rate and clear the first cumulative stagnant rounds; wherein the first stagnant rounds threshold is less than the second stagnant rounds threshold; If the second cumulative number of stalled rounds reaches the second stalled rounds threshold, the training strategy is determined to be to stop training.

[0019] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the method described in the first aspect.

[0020] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the method described in the first aspect.

[0021] In this embodiment, the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level are obtained. A geometric feature vector is constructed based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence level. The geometric feature vector is input into a pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The compensated translation coordinates of the tool feature points are determined based on the second translation coordinates of the tool feature points and the predicted positioning error vector. This method for compensating positioning errors of tool feature points integrates multi-dimensional information such as marker coordinates, normal vectors, and data confidence levels to construct geometric features, and relies on a trained error prediction model to accurately calculate positioning errors, significantly improving the accuracy and real-time performance of tool positioning in surgical navigation scenarios. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating the positioning error compensation method for tool feature points provided in Embodiment 1 of this application; Figure 2 This is a flowchart illustrating the pre-training process of the positioning error prediction model provided in Embodiment 2 of this application; Figure 3 This is a flowchart illustrating the pre-training process of the positioning error prediction model provided in Embodiment 3 of this application; Figure 4 This is a schematic diagram of the positioning error compensation device for tool feature points provided in Embodiment 4 of this application; Figure 5This is a schematic diagram of the structure of the electronic device provided in Embodiment 5 of this application. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0024] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] The following description, in conjunction with the accompanying drawings, details the positioning error compensation method, apparatus, equipment, and medium for tool feature points provided in this application through specific embodiments and application scenarios.

[0027] First, this application is applicable to scenarios requiring precise positioning and error compensation of target tools, such as the precise positioning and error compensation of puncture needles in surgical navigation scenarios. It is understood that the implementing entity of this application can be a terminal device with computing capabilities, such as a computer device integrated into a surgical navigation system.

[0028] The target tool can be a tool that requires real-time spatial pose tracking, such as surgical instruments in surgical navigation scenarios.

[0029] Example 1 Figure 1 This is a flowchart illustrating the positioning error compensation method for tool feature points provided in Embodiment 1 of this application. Figure 1 As shown, the specific steps include the following: S101, obtain the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level.

[0030] The markers can be reflective spheres or actively emitting markers fixed to the surface of the target tool and capable of being identified and tracked by an optical positioning system. In this scheme, the number of markers can be 20.

[0031] Among them, the first translation coordinate (3D) of the marker can be the three-dimensional spatial position coordinate of the marker center in the coordinate system of the optical positioning system.

[0032] Among them, the normal vector (3D) of the marker can be the unit vector of the normal direction of the plane where the center of the marker is located, reflecting the orientation information of the marker in the coordinate system of the optical positioning system.

[0033] Among them, tool feature points can be specific working points on the target tool that need to be precisely located, such as the tip of a puncture needle.

[0034] Among them, the second translation coordinate (3D) of the tool feature point can be the three-dimensional spatial position coordinate of the tool feature point in the coordinate system of the optical positioning system.

[0035] Among them, data confidence (1-dimensional) can be a quality index output by the optical positioning system when collecting data, used to measure the reliability of the collected data.

[0036] In one embodiment, the optical positioning system can be a near-infrared optical positioning system, which acquires data frame by frame. Specifically, the near-infrared optical positioning system can be an optical measurement device that performs real-time three-dimensional spatial positioning of a target tool with markers within its field of view based on the principle of near-infrared active illumination or passive reflection. The single-frame data acquired by the near-infrared optical positioning system can include the acquisition number, tool identifier, second translation coordinates of tool feature points, rotation matrix, rotation error marker / frame confidence, number of marker points, and data blocks for each marker point. The rotation error marker / frame confidence can be a frame-level comprehensive confidence level output by the near-infrared optical positioning system based on the residuals of each marker and the tracking quality algorithm, used to measure the reliability of the tool pose calculation result in the current frame. The rotation error marker / frame confidence is the data confidence level of this scheme. The data block for a marker point can include the marker point number, first translation coordinates, load vector, response vector, and normal vector. That is, the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence can all be directly output by the near-infrared optical positioning system.

[0037] S102, construct a geometric feature vector based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence level.

[0038] Among them, the geometric feature vector can be a multi-dimensional vector used to characterize the current spatial pose and observation quality of the target tool.

[0039] In one embodiment, a geometric feature vector can be obtained by sequentially concatenating the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence scores.

[0040] In one embodiment, constructing a geometric feature vector based on a first translation coordinate, a normal vector, a second translation coordinate, and a data confidence level includes: calculating the plane cosine angle of each marker based on the normal vector; calculating the feature point distance corresponding to each marker based on the first and second translation coordinates; calculating the origin Euclidean distance corresponding to the feature point based on the second translation coordinates; and constructing the geometric feature vector based on the plane cosine angle, the feature point distance, the origin Euclidean distance, and the data confidence level.

[0041] Among them, the plane cosine angle (3D) of a marker can be the cosine value of the angle formed by the normal vector of the marker and the normal vectors of the three coordinate axes of the optical positioning system coordinate system, respectively, and is used to characterize the degree of tilt of the marker's orientation in the optical positioning system coordinate system relative to the observation plane.

[0042] In one embodiment, the process of calculating the plane cosine angle of each marker based on the normal vector may include: for each marker, projecting the normal vector of the marker onto the XY plane, XZ plane and YZ plane of the optical positioning system coordinate system respectively, calculating the cosine value of the angle between the projection vector and the corresponding coordinate axis plane, and obtaining the 3D plane cosine angle corresponding to the marker.

[0043] Among them, the feature point distance (1D) corresponding to a marker can be the Euclidean distance between the first translation coordinate of the marker and the second translation coordinate of the tool feature point.

[0044] Among them, the origin Euclidean distance (1D) corresponding to the tool feature point can be the Euclidean distance between the second translation coordinate of the tool feature point and the origin of the optical positioning system coordinate system.

[0045] In one embodiment, the geometric feature vector is obtained by sequentially concatenating the plane cosine angle of each marker with the distance to the feature point, the Euclidean distance to the origin corresponding to the tool feature point, and the data confidence score. As an example, if there are 20 markers, the geometric feature vector has 82 dimensions. Specifically, each marker corresponds to a 3-dimensional plane cosine angle and a 1-dimensional distance to the feature point, totaling 80 dimensions for the 20 markers. Adding the 1-dimensional Euclidean distance to the origin corresponding to the tool feature point and the 1-dimensional data confidence score, the total dimension is 82.

[0046] The advantage of this scheme is that it transforms the original coordinates and normal vectors into feature expressions with more geometric and physical meaning. The plane cosine angle can effectively reflect the correlation between the orientation of the marker and the observation distortion. The feature point distance and the Euclidean distance of the origin directly describe the relative spatial structure between the marker, the tool feature point, and the origin of the coordinate system. This allows the geometric feature vectors to provide more robust input data for the positioning error prediction model in a lower-dimensional and information-dense form, thereby improving the accuracy and stability of error compensation.

[0047] S103, the geometric feature vector is input into the pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model.

[0048] The positioning error prediction model can be a deep neural network model used to predict the position offset of the tool's feature points based on the geometric features of the target tool.

[0049] The predicted positioning error vector can be a 3D vector used to represent the positioning error values ​​of the tool feature points predicted by the positioning error prediction model in the three coordinate axes of the optical positioning system coordinate system.

[0050] In one embodiment, the geometric feature vector is input into a pre-trained positioning error prediction model, which outputs a predicted positioning error vector through layer-by-layer feature transformation and regression calculation.

[0051] S104, determine the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector.

[0052] Among them, the compensated translation coordinates of the tool feature points can be the three-dimensional spatial position coordinates of the tool feature points in the optical positioning system coordinate system after error compensation correction, which are used to replace the original second translation coordinates to guide the operation.

[0053] In one embodiment, the compensated translation coordinates of the tool feature points can be obtained by subtracting the predicted positioning error vector from the second translation coordinates of the tool feature points.

[0054] In this embodiment, the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level are obtained. A geometric feature vector is constructed based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence level. The geometric feature vector is input into a pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The compensated translation coordinates of the tool feature points are determined based on the second translation coordinates of the tool feature points and the predicted positioning error vector. This method for compensating positioning errors of tool feature points integrates multi-dimensional information such as marker coordinates, normal vectors, and data confidence levels to construct geometric features, and relies on a trained error prediction model to accurately calculate positioning errors, significantly improving the accuracy and real-time performance of tool positioning in surgical navigation scenarios.

[0055] Example 2 Figure 2 This is a flowchart illustrating the pre-training process of the positioning error prediction model provided in Embodiment 2 of this application. Figure 2 As shown, the specific steps include the following: S201, obtain a preset number of geometric feature vectors and the actual positioning error vectors corresponding to the geometric feature vectors.

[0056] The preset number can be the total number of training data frames determined based on statistical significance and model generalization requirements.

[0057] In one embodiment, the process of obtaining a preset number of geometric feature vectors may include: obtaining the first translation coordinates and normal vectors of each marker corresponding to the target tool in a preset number of different frames, the second translation coordinates of the tool feature points, and the data confidence; for each frame, calculating the plane cosine angle of each marker based on the normal vector, calculating the feature point distance corresponding to each marker based on the first and second translation coordinates, calculating the origin Euclidean distance corresponding to the tool feature points based on the second translation coordinates, and constructing geometric feature vectors based on the plane cosine angle, feature point distance, origin Euclidean distance, and data confidence.

[0058] Among them, the true positioning error vector corresponding to the geometric feature vector can be a 3D vector used to represent the positioning error values ​​of the tool feature points based on the actual measurement and calibration of the reference calibration board in the three coordinate axis directions of the optical positioning system coordinate system in the same frame.

[0059] In one embodiment, the method for obtaining the true positioning error vector corresponding to the geometric feature vector can be to simultaneously calculate the true positioning error vector based on the reference calibration board and the acquired data during the data acquisition phase.

[0060] S202, the preset number of geometric feature vectors are divided into training geometric feature vectors and verification geometric feature vectors.

[0061] The training geometric feature vectors can be a subset of geometric feature vectors used for learning and optimizing the model's internal parameters after partitioning; the validation geometric feature vectors can be a subset of geometric feature vectors used to periodically evaluate the model's generalization ability and guide the adjustment of the training strategy during the training process.

[0062] In one embodiment, a preset number of geometric feature vectors are divided into training geometric feature vectors and verification geometric feature vectors according to a preset ratio.

[0063] In one embodiment, a predetermined number of geometric feature vectors are divided into training geometric feature vectors, validation geometric feature vectors, and test geometric feature vectors, with predetermined proportions of 70%, 15%, and 15%, respectively. The test geometric feature vectors can be a subset of geometric feature vectors that are completely independent of the training and validation processes and are used only after the model has been finally trained to evaluate its final performance.

[0064] S203, the pre-constructed positioning error prediction model is trained based on the training geometric feature vector and the corresponding true positioning error vector. The verification loss of the positioning error prediction model is determined based on the verification geometric feature vector and the corresponding true positioning error vector. The training strategy is adjusted based on the verification loss. The above training and verification steps are repeated until the training stopping condition is met.

[0065] The positioning error prediction model can be a regression model built on a lightweight multilayer perceptron, used to learn the nonlinear mapping relationship between the 82-dimensional geometric feature vector and the 3-dimensional positioning error vector.

[0066] Specifically, the network structure of the positioning error prediction model is as follows: Layer 0 is a one-dimensional batch normalization layer (BatchNorm1d), with an input dimension of 82 (82-dimensional geometric feature vectors) and an output dimension of 82, performing batch normalization on the input features to eliminate the difference in magnitude between feature dimensions; Layer 1 is a fully connected layer (Linear), with an input dimension of 82 and an output dimension of 32; Layer 2 is a one-dimensional batch normalization layer, with an input dimension of 32 and an output dimension of 32; Layer 3 is a modified linear unit activation function (ReLU), which... The system performs a nonlinear transformation; the 4th layer is a random deactivation layer (Dropout, deactivation probability p=0.1) used for regularization to prevent overfitting; the 5th layer is a fully connected layer with an input dimension of 32 and an output dimension of 16; the 6th layer is a one-dimensional batch normalization layer with an input dimension of 16 and an output dimension of 16; the 7th layer is a modified linear unit activation function (ReLU); the 8th layer is a random deactivation layer (Dropout, deactivation probability p=0.1); and the 9th layer is a fully connected layer with an input dimension of 16 and an output dimension of 3 (3D localization error vector).

[0067] In one embodiment, the process of training a pre-built positioning error prediction model based on training geometric feature vectors and the corresponding true positioning error vectors may include: inputting training geometric feature vectors into the pre-built positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model; determining a comprehensive training loss based on the predicted positioning error vector and the corresponding true positioning error vectors of the training geometric feature vectors; and backpropagating the positioning error prediction model based on the comprehensive training loss.

[0068] The validation loss of the positioning error prediction model can be the average of the combined training losses between the predicted positioning error vector corresponding to the validation geometric feature vector and the actual positioning error vector.

[0069] In one embodiment, the process of determining the validation loss of the positioning error prediction model based on the validation geometric feature vector and the corresponding true positioning error vector may include: inputting the validation geometric feature vector into the positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model; determining the comprehensive training loss based on the predicted positioning error vector and the corresponding true positioning error vector; and averaging the comprehensive training losses corresponding to each validation geometric feature vector to obtain the validation loss of the positioning error prediction model.

[0070] The training strategy can be a set of preset rules used to control the model's learning process, and may include learning rate adjustment strategies and early stopping strategies.

[0071] In one embodiment, adjusting the training strategy based on the validation loss includes: obtaining the historical minimum validation loss, a first cumulative stagnation epoch, and a second cumulative stagnation epoch; wherein the first cumulative stagnation epoch is the number of consecutive training epochs in which the historical minimum validation loss remains unchanged, and the second cumulative stagnation epoch is the cumulative sum of the number of training epochs in which the historical minimum validation loss remains unchanged throughout the entire training process; if the validation loss is lower than the historical minimum validation loss, determining the training strategy to maintain the current learning rate and clearing the first cumulative stagnation epoch; if the validation loss is not lower than the historical minimum validation loss, updating the first cumulative stagnation epoch and the second cumulative stagnation epoch; if the first cumulative stagnation epoch does not reach the first stagnation epoch threshold, determining the training strategy to maintain the current learning rate; if the first cumulative stagnation epoch reaches the first stagnation epoch threshold and the second cumulative stagnation epoch does not reach the second stagnation epoch threshold, determining the training strategy to reduce the current learning rate and clearing the first cumulative stagnation epoch; wherein the first stagnation epoch threshold is less than the second stagnation epoch threshold; if the second cumulative stagnation epoch reaches the second stagnation epoch threshold, determining the training strategy to stop training.

[0072] Among them, the historical minimum validation loss can be the minimum value of the validation loss calculated on the validation geometric feature vector since the start of training, representing the best generalization performance state of the model in the current training process.

[0073] The first cumulative stagnation rounds is the number of training rounds in which the historical minimum validation loss remains unchanged. That is, the cumulative number of training cycles in which the validation loss has not fallen below the historical minimum validation loss since the most recent historical minimum validation loss was refreshed. The second cumulative stagnation rounds is the cumulative sum of the number of training rounds in which the historical minimum validation loss remains unchanged throughout the entire training process. That is, the cumulative number of training cycles in which the historical minimum validation loss has not been refreshed since the start of training. It is not affected by the clearing of the first cumulative stagnation rounds and continues to accumulate.

[0074] The fact that the validation loss is lower than the historical lowest validation loss indicates that the model's generalization performance on the validation geometric feature vector has been improved and the model parameters are in a better state. Therefore, the training strategy can be determined as maintaining the current learning rate so that the model continues to converge toward the optimal solution at the current learning rate, and clearing the first cumulative stagnation rounds so that the first cumulative stagnation rounds are accumulated again from zero.

[0075] The learning rate is a hyperparameter that controls the step size of the model parameters in each iteration, directly affecting the model's convergence speed and final accuracy.

[0076] Specifically, if the validation loss is not lower than the historical lowest validation loss, it indicates that the model has failed to achieve better performance on the validation geometric feature vectors in the current training cycle. The model may be in a performance bottleneck or local oscillation state, and therefore the first and second cumulative stagnation rounds need to be updated. Specifically, the first and second cumulative stagnation rounds are each incremented by one.

[0077] The first stagnation round threshold can be the upper limit of the number of consecutive stagnation rounds required to trigger learning rate decay, for example, 20; the second stagnation round threshold can be the upper limit of the total cumulative stagnation rounds required to trigger the early stop mechanism, for example, 100.

[0078] If the first cumulative stagnation round count does not reach the first stagnation round count threshold, it means that the model's continuous stagnation time is still short. Therefore, it can be determined that the training strategy is to maintain the current learning rate unchanged.

[0079] If the first cumulative stagnation rounds reach the first stagnation rounds threshold and the second cumulative stagnation rounds do not reach the second stagnation rounds threshold, it means that the model has been stagnant for a long enough time but has not yet fallen into an overall unimprovable state. The current learning rate may be too large, causing the model to oscillate around the optimal solution and fail to approach it further. Therefore, the training strategy can be determined as reducing the current learning rate so that the model can perform a more refined search in the parameter space with smaller steps, and clearing the first cumulative stagnation rounds so that the model can restart training with a new learning rate.

[0080] Specifically, reducing the current learning rate can be achieved by reducing the current learning rate to half of its original value.

[0081] Among them, when the second cumulative stagnation rounds reach the second stagnation rounds threshold, it means that the model has experienced a sufficiently long period of stagnation since training. Even after multiple learning rate decays, it still cannot be improved further. Continuing to train is highly unlikely to bring performance improvement. Therefore, the training strategy can be determined to be to stop training in order to avoid model overfitting and save computing resources and training time.

[0082] The advantage of this approach is that by decoupling the learning rate decay strategy from the early stopping strategy through a two-layer stagnation counting, the model can obtain timely learning rate decay response opportunities during continuous stagnation, and continuously monitor the long-term improvement potential of the model through cumulative stagnation. This ensures that the model converges fully while effectively preventing overfitting, ultimately resulting in a positioning error prediction model with better generalization performance.

[0083] The training stopping condition can be met when the number of training cycles reaches a preset maximum number of training cycles (e.g., 500). A training cycle is defined as the process of inputting all training geometric feature vectors into the localization error prediction model for forward and backward propagation updates, and then using all valid geometric feature vectors to perform a generalization performance evaluation.

[0084] The advantage of this approach is that by dividing the dataset into training and validation sets proportionally, the model's generalization ability can be monitored in real time during training, and the training strategy can be adjusted promptly to prevent overfitting.

[0085] Example 3 Figure 3 This is a flowchart illustrating the pre-training process of the positioning error prediction model provided in Embodiment 3 of this application. Figure 3 As shown, the specific steps include the following: S301, obtain a preset number of geometric feature vectors and the actual positioning error vectors corresponding to the geometric feature vectors.

[0086] S302, the preset number of geometric feature vectors are divided into training geometric feature vectors and verification geometric feature vectors.

[0087] S303, determine the first standardization parameter based on the training geometric feature vector, and perform standardization processing on the training geometric feature vector based on the first standardization parameter to obtain the standard training geometric feature vector.

[0088] The first standardization parameter can be the mean vector and standard deviation vector calculated from the features of each dimension of the training geometric feature vector, which are used to perform standard deviation standardization (StandardScaler) transformation on the geometric feature vector.

[0089] In one embodiment, the mean and standard deviation of the training geometric feature vector are calculated dimension by dimension, and the mean of each dimension is used to form a mean vector and the standard deviation of each dimension is used to form a standard deviation vector, which are used as the first standardization parameters.

[0090] The standard training geometric feature vector can be a vector whose mean is 0 and whose standard deviation is 1 after standardization of the training geometric feature vector based on the first standardization parameter.

[0091] In one embodiment, the standard training geometric feature vector is obtained by subtracting the mean of each dimension from the training geometric feature vector and then dividing by the standard deviation of that dimension.

[0092] S304, determine the second standardization parameter based on the true positioning error vector corresponding to the training geometric feature vector, and standardize the true positioning error vector corresponding to the training geometric feature vector based on the second standardization parameter to obtain the standard true positioning error vector.

[0093] The second standardization parameter can be the mean vector and standard deviation vector calculated from the features of each dimension of the true positioning error vector corresponding to the training geometric feature vector, and is used to perform standard deviation standardization transformation on the true positioning error vector.

[0094] In one embodiment, the mean and standard deviation of the true localization error vector corresponding to the training geometric feature vector are calculated dimension by dimension, and the mean of each dimension is used to form a mean vector and the standard deviation of each dimension is used to form a standard deviation vector, which are used as the second standardization parameters.

[0095] The standard true positioning error vector can be a vector whose mean is 0 and whose standard deviation is 1 after standardization of the true positioning error vector corresponding to the training geometric feature vector based on the second standardization parameter.

[0096] In one embodiment, the standard true positioning error vector is obtained by subtracting the mean of each dimension from the true positioning error vector corresponding to the training geometric feature vector and then dividing by the standard deviation of that dimension.

[0097] In one embodiment, determining the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector includes: performing inverse standardization on the predicted positioning error vector according to the second standardization parameter to obtain the target positioning error vector; and subtracting the target positioning error vector from the second translation coordinates of the tool feature points to obtain the compensated translation coordinates of the tool feature points.

[0098] The target positioning error vector can be the three-dimensional positioning error value that is restored to the original optical positioning system coordinate system after the predicted positioning error vector is inversely standardized. Its numerical scale is consistent with the real positioning error vector, and it can be directly used to compensate and correct the second translation coordinate of the tool feature point.

[0099] In one embodiment, multiplying each dimension of the predicted positioning error vector by the standard deviation in the second standardization parameter and then adding the mean in the second standardization parameter can achieve inverse standardization of the predicted positioning error vector to obtain the target positioning error vector.

[0100] The process involves subtracting the target positioning error vector from the second translation coordinates of the tool feature points to obtain the compensated translation coordinates of the tool feature points, which are directly output by the optical positioning system. This process eliminates the system positioning deviation.

[0101] The advantage of this approach is that by calculating the second standardized parameter based solely on the training set during the training phase and then using this second standardized parameter to inversely standardize the predicted localization error vector during the inference phase, the objectivity of the model's generalization ability assessment and the fairness of the compensation results are ensured.

[0102] S305, the standard training geometric feature vector is input into the pre-constructed positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model.

[0103] Understandably, at this point, the predicted positioning error vector output by the positioning error prediction model has the same numerical scale as the standard true positioning error vector, both being within the standardized space.

[0104] S306, determine the comprehensive training loss based on the predicted positioning error vector and the standard true positioning error vector, and backpropagate the positioning error prediction model based on the comprehensive training loss.

[0105] Among them, the comprehensive training loss can be a loss value determined based on the predicted positioning error vector and the standard true positioning error vector, which is used to measure the prediction deviation of the model in the standardized space.

[0106] In one embodiment, determining the comprehensive training loss based on the predicted positioning error vector and the standard true positioning error vector includes: calculating the robust regression loss, orientation consistency loss, and squared regularization loss based on the predicted positioning error vector and the standard true positioning error vector; and performing a weighted summation of the robust regression loss, orientation consistency loss, and squared regularization loss to obtain the comprehensive training loss.

[0107] The robust regression loss can be the loss term for the element-wise error between the predicted localization error vector calculated using the Huber loss function and the standard true localization error vector. Specifically, the Huber loss behaves like mean squared error when the error is small, and degenerates into mean absolute error behavior when the error is large, thus providing robustness to occasional noisy frames and reducing the dominant influence of abnormal frames on model training.

[0108] Specifically, the formula for calculating robust regression loss is: .in, This represents the robust regression loss, where N represents the total number of predicted positioning error vectors / standard true positioning error vectors. This represents the i-th prediction and positioning error vector. This represents the i-th standard true positioning error vector. This represents the Huber loss function, which combines the advantages of squared loss and absolute loss. Its threshold parameter (i.e., the boundary value that distinguishes between squared loss and linear loss) can be 1 mm.

[0109] The direction consistency loss can be a penalty term used to constrain the predicted positioning error vector to maintain consistency with the standard true positioning error vector in the sign direction. When the predicted value has the opposite sign to the true value, it indicates that the error compensation direction predicted by the model is inconsistent with the actual error direction, and a penalty is applied at this time. When the signs are the same, no penalty is applied.

[0110] Specifically, the formula for calculating the directional consistency loss is as follows: .in, This indicates the loss of directional consistency. This represents the d-th component in the i-th prediction and positioning error vector. The d-th component in the i-th standard true positioning error vector This represents the linear rectification function.

[0111] Among them, the squared regularization loss can be an L2 regularization term used to suppress the magnitude of the predicted positioning error vector. By constraining the magnitude of the predicted value, it prevents the model from outputting excessively large compensation values ​​on frames with low data confidence, and avoids the tool feature points shifting in the opposite direction due to overcompensation.

[0112] Specifically, the formula for calculating squared regularization loss is: .in, This represents the squared regularization loss.

[0113] The formula for calculating the overall training loss is as follows: .in, Indicates overall training loss. and These are the weighting coefficients for the directional consistency loss and the squared regularization loss, respectively (e.g., 0.05 and 0.01, respectively).

[0114] The advantage of this approach is that by combining robust regression loss, directional consistency loss, and squared regularization loss to construct a comprehensive training loss, the model can take into account multiple optimization objectives during training, thereby improving the safety and stability of overall error compensation.

[0115] In one embodiment, the gradient of the comprehensive training loss is calculated through automatic differentiation, and the AdamW optimizer is used to update the weight parameters of each layer of the localization error prediction model layer by layer. The Adam optimization algorithm is a stochastic gradient descent optimization algorithm that combines momentum and adaptive learning rate mechanisms. It independently adjusts the learning rate for different parameters by calculating the first and second moment estimates of the gradient. The AdamW optimizer can be an improved optimizer that decouples weight decay from the Adam optimization algorithm. By separating the weight decay term from gradient updates, it effectively improves the model's generalization ability and prevents overfitting. Its initial learning rate can be 1e-3, and the weight decay is 1e-4.

[0116] S307, Based on the verification geometric feature vector and the true positioning error vector corresponding to the verification geometric feature vector, determine the verification loss of the positioning error prediction model, and adjust the training strategy according to the verification loss.

[0117] Accordingly, the process of determining the validation loss of the positioning error prediction model based on the validation geometric feature vector and the corresponding true positioning error vector can include: standardizing the validation geometric feature vector according to a first standardization parameter to obtain a standard validation geometric feature vector; standardizing the corresponding true positioning error vector according to a second standardization parameter to obtain a standard true positioning error vector; inputting the standard validation geometric feature vector into the positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model; determining the comprehensive training loss based on the predicted positioning error vector and the corresponding standard true positioning error vector of the standard validation geometric feature vector; and averaging the comprehensive training losses corresponding to each validation geometric feature vector to obtain the validation loss of the positioning error prediction model.

[0118] S308: Identify whether the training stop condition is met; if yes, end the process; otherwise, execute S305.

[0119] The advantage of this approach is that by using standard deviation standardization to transform the input features and output labels to a standard normal distribution space with a mean of 0 and a standard deviation of 1, it can effectively eliminate model training bias caused by differences in the units and numerical ranges of features of different dimensions, making the contribution of each feature to the loss function more balanced, thereby accelerating model convergence and improving training stability.

[0120] Example 4 Figure 4 This is a schematic diagram of the positioning error compensation device for tool feature points provided in Embodiment 4 of this application. Figure 4 As shown, the device includes: The data acquisition module 410 is used to acquire the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level; The vector construction module 420 is used to construct a geometric feature vector based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence. Error prediction module 430 is used to input the geometric feature vector into a pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The positioning compensation module 440 is used to determine the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector.

[0121] Furthermore, the vector construction module 420 is specifically used for: Calculate the plane cosine angle of each of the markers based on the normal vector; Calculate the distance between the feature points corresponding to each marker based on the first translation coordinate and the second translation coordinate; Calculate the origin Euclidean distance corresponding to the tool feature point based on the second translation coordinates; A geometric feature vector is constructed based on the plane cosine angle, the distance between feature points, the Euclidean distance from the origin, and the data confidence level.

[0122] Furthermore, the device is also used for: Obtain a preset number of geometric feature vectors and the corresponding true positioning error vectors of the geometric feature vectors; The predetermined number of geometric feature vectors are divided into training geometric feature vectors and verification geometric feature vectors; The pre-constructed positioning error prediction model is trained based on the training geometric feature vector and the corresponding true positioning error vector. The verification loss of the positioning error prediction model is determined based on the verification geometric feature vector and the corresponding true positioning error vector. The training strategy is adjusted based on the verification loss, and the above training and verification steps are repeated until the training stopping condition is met.

[0123] Furthermore, the device is also used for: A first standardization parameter is determined based on the training geometric feature vector, and the training geometric feature vector is standardized based on the first standardization parameter to obtain a standard training geometric feature vector. The second standardization parameter is determined based on the true positioning error vector corresponding to the training geometric feature vector, and the true positioning error vector corresponding to the training geometric feature vector is standardized based on the second standardization parameter to obtain the standard true positioning error vector. The standard training geometric feature vector is input into the pre-built positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The comprehensive training loss is determined based on the predicted positioning error vector and the standard true positioning error vector, and the positioning error prediction model is backpropagated based on the comprehensive training loss.

[0124] Furthermore, the device is also used for: Based on the predicted positioning error vector and the standard true positioning error vector, calculate the robust regression loss, the orientation consistency loss, and the squared regularization loss. The robust regression loss, the directional consistency loss, and the squared regularization loss are weighted and summed to obtain the comprehensive training loss.

[0125] Furthermore, the positioning compensation module 440 is specifically used for: The predicted positioning error vector is inversely standardized according to the second standardization parameter to obtain the target positioning error vector. The compensated translation coordinates of the tool feature points are obtained by subtracting the target positioning error vector from the second translation coordinates of the tool feature points.

[0126] Furthermore, the device is also used for: Obtain the historical minimum validation loss, the first cumulative number of stalled epochs, and the second cumulative number of stalled epochs; wherein, the first cumulative number of stalled epochs is the number of consecutive training epochs in which the historical minimum validation loss remains unchanged, and the second cumulative number of stalled epochs is the cumulative sum of the number of training epochs in which the historical minimum validation loss remains unchanged throughout the entire training process; If the validation loss is lower than the historical lowest validation loss, the training strategy is determined to be to maintain the current learning rate and the first cumulative stagnation rounds are cleared. If the verification loss is not less than the historical lowest verification loss, update the first cumulative number of stalled rounds and the second cumulative number of stalled rounds. If the first cumulative number of stalled rounds has not reached the first stalled rounds threshold, the training strategy is determined to maintain the current learning rate unchanged. If the first cumulative stagnant rounds reach the first stagnant rounds threshold and the second cumulative stagnant rounds do not reach the second stagnant rounds threshold, the training strategy is determined to be to reduce the current learning rate and clear the first cumulative stagnant rounds; wherein the first stagnant rounds threshold is less than the second stagnant rounds threshold; If the second cumulative number of stalled rounds reaches the second stalled rounds threshold, the training strategy is determined to be to stop training.

[0127] In this embodiment, a data acquisition module is used to acquire the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and data confidence scores; a vector construction module is used to construct geometric feature vectors based on the first translation coordinates, the normal vectors, the second translation coordinates, and the data confidence scores; an error prediction module is used to input the geometric feature vectors into a pre-trained positioning error prediction model to obtain a predicted positioning error vector output by the positioning error prediction model; and a positioning compensation module is used to determine the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector. The above-mentioned positioning error compensation device for tool feature points integrates multi-dimensional information such as marker coordinates, normal vectors, and data confidence scores to construct geometric features, and relies on a trained error prediction model to accurately calculate positioning errors, significantly improving the accuracy and real-time performance of tool positioning in surgical navigation scenarios.

[0128] The positioning error compensation device for tool feature points in this application embodiment can be a device, or it can be a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0129] The positioning error compensation device for tool feature points in this embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment does not specifically limit it.

[0130] The positioning error compensation device for tool feature points provided in this application embodiment can realize the various processes implemented in the above embodiments. To avoid repetition, it will not be described again here.

[0131] Example 5 Figure 5 This is a schematic diagram of the structure of the electronic device provided in Embodiment 5 of this application. Figure 5 As shown, this application embodiment also provides an electronic device 500, including a processor 501, a memory 502, and a program or instructions stored in the memory 502 and executable on the processor 501. When the program or instructions are executed by the processor 501, they implement the various processes of the above-described tool feature point positioning error compensation method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0132] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0133] Example 6 This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described tool feature point positioning error compensation method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0134] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0135] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0136] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0137] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0138] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A method for compensating for positioning errors of tool feature points, characterized in that, The method includes: Obtain the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level; A geometric feature vector is constructed based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence level. The geometric feature vector is input into a pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The compensated translation coordinates of the tool feature points are determined based on the second translation coordinates of the tool feature points and the predicted positioning error vector.

2. The method for compensating for positioning errors of tool feature points according to claim 1, characterized in that, The step of constructing a geometric feature vector based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence score includes: Calculate the plane cosine angle of each of the markers based on the normal vector; Calculate the distance between the feature points corresponding to each marker based on the first translation coordinate and the second translation coordinate; Calculate the origin Euclidean distance corresponding to the tool feature point based on the second translation coordinates; A geometric feature vector is constructed based on the plane cosine angle, the distance between feature points, the Euclidean distance from the origin, and the data confidence level.

3. The method for compensating for positioning errors of tool feature points according to claim 1, characterized in that, The process of pre-training a positioning error prediction model includes: Obtain a preset number of geometric feature vectors and the corresponding true positioning error vectors of the geometric feature vectors; The predetermined number of geometric feature vectors are divided into training geometric feature vectors and verification geometric feature vectors; The pre-constructed positioning error prediction model is trained based on the training geometric feature vector and the corresponding true positioning error vector. The verification loss of the positioning error prediction model is determined based on the verification geometric feature vector and the corresponding true positioning error vector. The training strategy is adjusted based on the verification loss, and the above training and verification steps are repeated until the training stopping condition is met.

4. The method for compensating for positioning errors of tool feature points according to claim 3, characterized in that, The step of training a pre-constructed positioning error prediction model based on the training geometric feature vector and the corresponding true positioning error vector includes: A first standardization parameter is determined based on the training geometric feature vector, and the training geometric feature vector is standardized based on the first standardization parameter to obtain a standard training geometric feature vector. The second standardization parameter is determined based on the true positioning error vector corresponding to the training geometric feature vector, and the true positioning error vector corresponding to the training geometric feature vector is standardized based on the second standardization parameter to obtain the standard true positioning error vector. The standard training geometric feature vector is input into the pre-built positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The comprehensive training loss is determined based on the predicted positioning error vector and the standard true positioning error vector, and the positioning error prediction model is backpropagated based on the comprehensive training loss.

5. The method for compensating for positioning errors of tool feature points according to claim 4, characterized in that, The step of determining the comprehensive training loss based on the predicted positioning error vector and the standard true positioning error vector includes: Based on the predicted positioning error vector and the standard true positioning error vector, calculate the robust regression loss, the orientation consistency loss, and the squared regularization loss. The robust regression loss, the directional consistency loss, and the squared regularization loss are weighted and summed to obtain the comprehensive training loss.

6. The method for compensating for positioning errors of tool feature points according to claim 4, characterized in that, The step of determining the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector includes: The predicted positioning error vector is inversely standardized according to the second standardization parameter to obtain the target positioning error vector. The compensated translation coordinates of the tool feature points are obtained by subtracting the target positioning error vector from the second translation coordinates of the tool feature points.

7. The method for compensating for positioning errors of tool feature points according to claim 3, characterized in that, The step of adjusting the training strategy based on the verification loss includes: Obtain the historical minimum validation loss, the first cumulative number of stalled epochs, and the second cumulative number of stalled epochs; wherein, the first cumulative number of stalled epochs is the number of consecutive training epochs in which the historical minimum validation loss remains unchanged, and the second cumulative number of stalled epochs is the cumulative sum of the number of training epochs in which the historical minimum validation loss remains unchanged throughout the entire training process; If the validation loss is lower than the historical lowest validation loss, the training strategy is determined to be to maintain the current learning rate and the first cumulative stagnation rounds are cleared. If the verification loss is not less than the historical lowest verification loss, update the first cumulative number of stalled rounds and the second cumulative number of stalled rounds. If the first cumulative number of stalled rounds has not reached the first stalled rounds threshold, the training strategy is determined to maintain the current learning rate unchanged. If the first cumulative stagnant rounds reach the first stagnant rounds threshold and the second cumulative stagnant rounds do not reach the second stagnant rounds threshold, the training strategy is determined to be to reduce the current learning rate and clear the first cumulative stagnant rounds; wherein the first stagnant rounds threshold is less than the second stagnant rounds threshold; If the second cumulative number of stalled rounds reaches the second stalled rounds threshold, the training strategy is determined to be to stop training.

8. A positioning error compensation device for tool feature points, characterized in that, The device includes: The data acquisition module is used to acquire the first translation coordinates and normal vectors of each marker on the target tool, the second translation coordinates of the tool feature points on the target tool, and the data confidence level; The vector construction module is used to construct a geometric feature vector based on the first translation coordinates, the normal vector, the second translation coordinates, and the data confidence. The error prediction module is used to input the geometric feature vector into a pre-trained positioning error prediction model to obtain the predicted positioning error vector output by the positioning error prediction model. The positioning compensation module is used to determine the compensated translation coordinates of the tool feature points based on the second translation coordinates of the tool feature points and the predicted positioning error vector.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein when the program or instructions are executed by the processor, they implement the positioning error compensation method for tool feature points as described in any one of claims 1-7.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the positioning error compensation method for tool feature points as described in any one of claims 1-7.