Capsule robot positioning method based on ultrasonic image
Through an automatic positioning method based on ultrasound images, using adaptive directed elliptical Gaussian regions and backbone network feature extraction, the problems of increased volume and insufficient image quality in traditional capsule robot positioning methods are solved, and real-time and accurate capsule robot positioning is achieved. Reduces clinical risks and costs.
Patent Information
- Application Number
- CN202410736160.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-01
AI Technical Summary
In traditional capsule robot positioning methods, magnetic positioning technology increases the size of the equipment and cannot be applied in narrow environments. Moreover, the grayscale distribution of ultrasonic imaging images is uneven and the resolution is low, which increases the difficulty of positioning.
An automatic positioning method based on ultrasound images is adopted, including data preprocessing, adaptive directed elliptical Gaussian region generation, backbone network feature extraction, feature pyramid processing, sliding vertex bounding box representation and joint loss function optimization to achieve capsule robot position and angle Pinpoint positioning.
It achieves capsule robot positioning without increasing the size of the equipment, provides real-time and accurate position and angle information, reduces risks in clinical applications, and has a low cost.
Smart Images

Figure CN118736004A_ABST
Abstract
Description
[0001] Technical field: The present invention relates to the fields of artificial intelligence, computer vision, and medical image analysis technology, especially the field of ultrasonic image recognition and analysis, and more particularly to a method for automatic positioning of a capsule robot based on ultrasonic images. Background technology:
[0002] Traditional gastroscopes play an important role in medical diagnosis and treatment, but they have to be inserted through the mouth or nose, which makes patients feel uncomfortable and has the risk of infection. In response to the shortcomings of traditional gastroscopes, capsule robots came into being. The capsule robot enters the digestive tract through oral administration, and then the doctor controls the capsule robot to move in the body to check the gastrointestinal tract lesions. In order to control the movement of the capsule robot, we should accurately and in real time obtain the position and angle of the capsule robot.
[0003] In recent years, the positioning of capsule robots is mostly achieved by built-in magnetic positioning chips. However, this method will increase the size of the capsule robot, making it impossible to use it in some narrow environments; on the other hand, due to the special pathological structure of the gastrointestinal tract, this method cannot provide the position and angle information of the capsule robot during the operation.
[0004] With the rapid development of deep learning models, capsule robot tracking technology based on medical imaging technology can solve the problems encountered in magnetic positioning technology. Existing medical imaging technologies include X-ray imaging, CT imaging, ultrasound imaging, etc. Compared with CT imaging and X-ray imaging, ultrasound imaging uses mechanical waves and does not involve any ionizing radiation, so it will not cause radioactive damage to patients. In addition, ultrasound imaging also has the advantages of real-time imaging and low cost. Therefore, we propose a method for automatic positioning of capsule robots based on ultrasound images. However, precisely because ultrasound imaging uses mechanical waves, the penetration depth will be limited, resulting in uneven grayscale distribution and low resolution of the generated image, which greatly increases the difficulty of capsule robot positioning. Summary of the invention:
[0005] In order to solve the problems in the prior art, the present invention proposes an automatic positioning method for a capsule robot based on ultrasonic images. This method does not generate radiation that endangers the safety of doctors and patients, and can provide the position and angle information of the capsule robot in real time and accurately, helping doctors to examine the condition of gastrointestinal lesions in patients.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] An automatic positioning method for a capsule robot based on ultrasound images comprises the following steps: data preprocessing, generating a capsule robot adaptive directed elliptical Gaussian region, feature extraction of ultrasound images based on a backbone network, feature graph processing based on a feature pyramid, capsule robot bounding box representation based on sliding vertices, and network parameter optimization based on a joint loss function.
[0008] Step 1: Data preprocessing;
[0009] Step 2, generating a directed elliptical Gaussian region of the capsule robot's adaptability;
[0010] Step 3: Ultrasonic image feature extraction based on backbone network;
[0011] Step 4: Feature map processing based on feature pyramid;
[0012] Step 5: Capsule robot bounding box representation based on sliding vertices;
[0013] Step 6: Network parameter optimization based on joint loss function.
[0014] Preferably, in step 1, firstly, data enhancement operations such as random lateral translation, random longitudinal translation, and random rotation are performed on the 2631 initial ultrasound images to generate 52620 ultrasound images and corresponding annotation files to improve the generalization ability and robustness of the model; then, the data set is divided into a training set, a validation set, and a test set in a ratio of 7:2:1. The training set is used to build the model, the validation set is used to evaluate the performance of the model during the training process, perform parameter adjustment and model selection, and the test set is used to evaluate the performance of the trained model.
[0015] Preferably, in step 2, generating a directed elliptical Gaussian region of the capsule robot's adaptability comprises the following steps:
[0016] Step 21, generate a standard Gaussian region: take the position information of the capsule robot in the ultrasound image annotated by the doctor together with the ultrasound image as input, and generate a circular standard Gaussian region as a candidate region for the positive sample.
[0017] Step 22, generate a directed elliptical Gaussian region: transform the circular standard Gaussian region into a directed elliptical Gaussian region by stretching and rotating.
[0018] Step 23: Weight allocation of the location points of the positive sample candidate area: according to the Gaussian probability density function Calculate the weights for all the points in the directed elliptical Gaussian region. Where X = [x, y] T ~N(μ,C), C represents the covariance matrix of two variables, and μ represents the mean vector.
[0019] Step 24, Generate capsule robot region: Traverse all position points in the directed elliptical region. If the weight of the position point is equal to 0, the position point is considered to be a negative sample, otherwise the position point is considered to be a positive sample. The region formed by all positive samples is the directed elliptical Gaussian region of the capsule robot.
[0020] Preferably, in step 22, generating a directed elliptical Gaussian region comprises the following steps:
[0021] Step 221, calculate the coordinates of the center point of the ellipse: calculate the coordinates of the center point of the ellipse area according to the position information of the capsule robot in the ultrasound image marked by the doctor, and the formula is as follows:
[0022]
[0023] symbol Indicates that the result is rounded up, x i ,y i ,i∈[1,2,3,4] represents the coordinates of the four vertices of the capsule robot bounding box marked by the doctor, and stride=[8,16,32] represents the corresponding downsampling ratio.
[0024] Step 222, calculate the lengths of the major and minor axes of the ellipse: calculate the lengths of the major and minor axes of the Gaussian region of the directed ellipse according to the formula, which is as follows:
[0025]
[0026] Step 223, constructing a rotation matrix and a stretching matrix: constructing a rotation matrix and a stretching matrix according to the obtained coordinates of the center point of the ellipse and the lengths of the major and minor semi-axes. R represents the rotation matrix, and E represents the stretching matrix.
[0027]
[0028] Where T IOU Represents the IOU threshold, here we set T IOU =0.3, angle represents the rotation angle of the capsule robot.
[0029] Step 224, generate a directed elliptical Gaussian region: generate a directed elliptical Gaussian region that fits the shape and direction of the capsule robot according to the stretching and rotation matrix. See the attached diagram for the conversion diagram. Figure 2 .
[0030] ax=[i-gridx,j-gridy] T
[0031]
[0032] symbol represents matrix multiplication, i and j represent the horizontal and vertical coordinates of any position point in the positive sample candidate area generated in step 22, respectively.
[0033] Preferably, in step 3, the ultrasound image feature extraction based on the backbone network includes the following steps:
[0034] Step 31, image preprocessing: The input ultrasound image needs to be adjusted to the format and size required by the backbone network Darknet we selected. Here, all images will be resized to (800,800,1) when input into the convolutional neural network. Here 1 represents the number of channels, which means that the input data is a gray image.
[0035] Step 32: Load pre-trained weights: Load the pre-trained DarkNET53 weights to accelerate the convergence of the model and improve the performance of the model.
[0036] Step 33, convolutional layer feature extraction: The preprocessed ultrasound image is subjected to feature extraction through five convolutional layers with a convolution kernel size of 3×3 in sequence.
[0037] Step 34, pooling operation: Use the maximum pooling operation to compress the features extracted by the convolutional layer and remove redundant information, thereby simplifying the network complexity and improving the robustness of feature extraction.
[0038] Preferably, in step 4, after obtaining the initially extracted feature map, the feature map processing based on the feature pyramid first reduces the number of channels of the C5 layer of the backbone network to obtain the P5 layer of the feature pyramid; then, upsampling operations are performed in sequence to obtain the P4 and P3 layers, thereby obtaining features with the same length and width as C4 and C3; finally, the feature map of each layer is fused with the upsampled feature map of the previous layer from bottom to top to generate the final feature map.
[0039] Preferably, in step 5, the capsule robot bounding box representation based on sliding vertices includes the following steps:
[0040] Step 51, calculate the length and width of the capsule robot's horizontal frame: We first calculate the length and width of the horizontal frame using the formula based on the information of the capsule robot's rotation frame marked by the doctor:
[0041] w=max(x1,x2,x3,x4)-min(x1,x2,x3,x4)
[0042] h=max(y1,y2,y3,y4)-min(y1,y2,y3,y4)
[0043] Step 52: Calculate the distance S between the corresponding vertices of the horizontal frame and the rotation frame i ,i∈[1,2,3,4].
[0044] S i =||V i -V i '||
[0045] Step 53: Calculate the ratio of the distance between vertices to the side length of the corresponding horizontal box δ i ,i∈[1,2,3,4]:
[0046]
[0047] Step 54: Calculate the area ratio ar between the horizontal frame and the rotation frame.
[0048] Step 55, represent the capsule robot bounding box: After completing the above steps, we can use the nine-tuple o to represent the bounding box that better fits the capsule robot, o = [x, y, w, h, δ1, δ2, δ3, δ4, ar]. See the attached diagram for a specific diagram. Figure 3 .
[0049] Preferably, in step 6, the network parameter optimization based on the joint loss function includes: first constructing a loss function for the distribution of positive and negative samples and a loss function for the regression capsule robot bounding box; then calculating the loss value between the model prediction result and the true value and the gradient of the loss function with respect to the current network parameters; updating the network parameters according to the loss value and the learning rate; repeating the above steps until the value of the loss function converges or reaches a preset threshold.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] 1. There is no need to add a magnetic positioning chip to increase the size of the capsule robot, interfere with the doctor's operation or introduce electromagnetic compatibility issues.
[0052] 2. The present invention can accurately and in real time obtain the position and angle of the capsule robot in the ultrasound image, and the accuracy and detection time can meet the requirements in clinical applications.
[0053] 3. The present invention has a low practical cost and can be quickly promoted for use, getting rid of the discomfort and risk of infection caused by the traditional gastroscopy, which requires the insertion of a tube from the oral cavity or nasal cavity to detect lesions in the gastrointestinal tract. Description of the drawings:
[0054] Figure 1 is a network framework diagram of Embodiment 1 of the present invention;
[0055] Figure 2 It is a schematic diagram of a method for generating a directed elliptical Gaussian region of the present invention;
[0056] Figure 3is a schematic diagram of a capsule robot bounding box representation method based on sliding vertices of the present invention;
[0057] Figure 4 It is a processing flow chart of embodiment 2 of the present invention. Specific implementation method:
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0059] Example 1
[0060] like Figure 1 As shown in the figure, a method for automatic positioning of a capsule robot based on ultrasound images is shown in the figure. Figure 1 As shown in the figure, it includes four modules: capsule robot directed elliptical Gaussian region generation module, backbone network & feature pyramid module, prediction head module and loss function module.
[0061] The capsule robot directed elliptical Gaussian region generation includes the following steps:
[0062] Generate directed elliptical Gaussian region: The standard Gaussian distribution is circular and cannot fit the shape of the capsule robot ellipse and any direction changes well. Figure 2 As shown in the figure, we use matrix transformation to transform the circular standard Gaussian distribution into a directed elliptical Gaussian distribution. In the following formula, R is the rotation matrix and E is the stretching matrix.
[0063]
[0064] Reweighting of positive position points: On the one hand, due to the different acoustic impedances of various tissues in the human body, different tissues are presented differently on ultrasound images, resulting in uneven grayscale distribution of the generated ultrasound images; on the other hand, when the capsule robot moves in the gastrointestinal tract, it is easy to contact the gastrointestinal wall with similar grayscale distribution. Both of the above situations will lead to unreasonable weight distribution of the position points inside the capsule robot, so we use the Gaussian probability density function to reweight the position points in the directed elliptical Gaussian region.
[0065]
[0066] Where X = [x, y] T ~N(μ,C), C represents the covariance matrix of two variables, and μ represents the mean vector.
[0067] Generate capsule robot region: After obtaining the weights of all positions in the directed elliptical Gaussian region, traverse all positions and regard the positions with weight values greater than 0 as points in the capsule robot region, and the positions with weight values equal to 0 as points outside the capsule robot region. Finally, the attached Figure 3 The directed elliptical area of the capsule robot after weight assignment is shown.
[0068] Backbone network and feature pyramid module: We chose Darknet53 as our backbone network. First, we gradually extracted the features of the ultrasound image through stacked convolutional layers with a kernel size of 3×3 and residual blocks, and retained the low-level features through jump connections to build a deep convolutional neural network. Then, we performed a pooling operation on the feature map to extract multi-scale feature information. Then, we upsampled the feature map with an upsampling factor of 2. Then, we fused the feature maps of different levels through upsampling and jump connections to help the network better understand the different scale features and semantic information of the ultrasound image. Finally, we located the target on the fused feature map and converted the feature map into the prediction result of the target position through a series of convolution operations.
[0069] Prediction head module: This module first receives the feature maps output by the backbone network and feature pyramid module; then rearranges the input feature tensor into a shape suitable for decoding; then, decodes the features by calling private methods to obtain the position (x, y, w, h, angle) and confidence of the detection box; further processing uses the Sigmoid function to make the confidence range between 0 and 1, and processes the rotation angle to ensure that it is within a reasonable range.
[0070] The loss function module specifically includes the following steps:
[0071] Representation conversion: The model prediction results (x, y, w, h, angle) output in the prediction head are converted into [x, y, w, h, δ1, δ2, δ3, δ4, ar] using the capsule robot bounding box representation based on sliding vertices.
[0072] Construct the positive and negative sample allocation loss function: construct this loss function to measure the difference between the positive and negative sample allocation in the model prediction results and the positive and negative sample allocation in the true value. obj as follows:
[0073]
[0074] In the formula, Indicates the location information of the positive sample area predicted by the model, obj x,yrepresents the positive sample area position information generated based on the true value, and the subscript (x, y) represents the coordinate information of the position point in the positive sample area.
[0075] Construct a loss function for bounding box regression: Construct this loss function to measure the difference between the bounding box predicted by the model and the bounding box in the true value. The bounding box regression loss function Loss obb as follows:
[0076]
[0077] Where δ i Indicates the offset between the four vertices in the rotation box obtained in the model prediction and the four vertices in the horizontal box. Represents the offset between the four vertices in the rotation box marked by the doctor in the true value and the four vertices in the horizontal box.
[0078] Construct the joint loss function:
[0079] Loss=Loss obj +Loss obb
[0080] Total loss value calculation: Calculate the loss value between the predicted result and the true value, and determine whether the current loss value converges. If it converges, stop training. Otherwise, backpropagate the loss value, call the optimizer to update the parameters, and continue training.
[0081] Example 2
[0082] As attached Figure 4 As shown, a capsule robot automatic positioning method based on ultrasound images includes the following steps:
[0083] Step 1: Data preprocessing;
[0084] Step 2, generating a directed elliptical Gaussian region of the capsule robot's adaptability;
[0085] Step 3: Feature extraction of ultrasound images based on backbone network;
[0086] Step 4: Feature map processing based on feature pyramid;
[0087] Step 5: Capsule robot bounding box representation based on sliding vertices;
[0088] Step 6: Network parameter optimization based on joint loss function.
[0089] In step 1, we first perform data augmentation operations such as random horizontal translation, random vertical translation, and random rotation on the 2631 initial ultrasound images to generate 52620 ultrasound images and corresponding annotation files to improve the generalization and robustness of the model; then, we divide the dataset into training set, validation set, and test set in a ratio of 7:2:1. The training set is used to build the model, the validation set is used to evaluate the performance of the model during the training process, perform parameter adjustment and model selection, and the test set is used to evaluate the performance of the trained model.
[0090] In step 2, generating the directed elliptical Gaussian region of the capsule robot's adaptability includes the following steps:
[0091] Step 21, generate a standard Gaussian region: take the position information of the capsule robot in the ultrasound image annotated by the doctor together with the ultrasound image as input, and generate a circular standard Gaussian region as a candidate region for the positive sample.
[0092] Step 22, generate a directed elliptical Gaussian region: transform the circular standard Gaussian region into a directed elliptical Gaussian region by stretching and rotating.
[0093] Step 23: Weight allocation of the location points of the positive sample candidate area: according to the Gaussian probability density function Calculate the weights for all the points in the directed elliptical Gaussian region. Where X = [x, y] T ~N(μ,C), C represents the covariance matrix of two variables, and μ represents the mean vector.
[0094] Step 24, Generate capsule robot region: Traverse all position points in the directed elliptical region. If the weight of the position point is equal to 0, the position point is considered to be a negative sample, otherwise the position point is considered to be a positive sample. The region formed by all positive samples is the directed elliptical Gaussian region of the capsule robot.
[0095] In step 22, generating a directed elliptical Gaussian region includes the following steps:
[0096] Step 221, calculate the coordinates of the center point of the ellipse: calculate the coordinates of the center point of the ellipse area according to the position information of the capsule robot in the ultrasound image marked by the doctor, and the formula is as follows:
[0097]
[0098] symbol Indicates that the result is rounded up, x i ,y i ,i∈[1,2,3,4] represents the coordinates of the four vertices of the capsule robot bounding box marked by the doctor, and stride=[8,16,32] represents the corresponding downsampling ratio.
[0099] Step 222, calculate the lengths of the major and minor axes of the ellipse: calculate the lengths of the major and minor axes of the Gaussian region of the directed ellipse according to the formula, which is as follows:
[0100]
[0101] Step 223, constructing a rotation matrix and a stretching matrix: constructing a rotation matrix and a stretching matrix according to the obtained coordinates of the center point of the ellipse and the lengths of the major and minor semi-axes. R represents the rotation matrix, and E represents the stretching matrix.
[0102]
[0103] Where T IOU Represents the IOU threshold, here we set T IOU =0.3, angle represents the rotation angle of the capsule robot.
[0104] Step 224, generate a directed elliptical Gaussian region: generate a directed elliptical Gaussian region that fits the shape and direction of the capsule robot according to the stretching and rotation matrix. See the attached diagram for the conversion diagram. Figure 2 .
[0105] ax=[i-gridx,j-gridy] T
[0106]
[0107] symbol represents matrix multiplication, i and j represent the horizontal and vertical coordinates of any position point in the positive sample candidate area generated in step 22, respectively.
[0108] In step 3, the ultrasound image feature extraction based on the backbone network includes the following steps:
[0109] Step 31, image preprocessing: The size and format of the input ultrasound image are processed into the input size and format required by our backbone network DarkNet53.
[0110] Step 32: Load pre-trained weights: Load the pre-trained DarkNET53 weights to accelerate the convergence of the model and improve the performance of the model.
[0111] Step 33, convolutional layer feature extraction: The preprocessed ultrasound image is subjected to feature extraction through five convolutional layers with a convolution kernel size of 3×3 in sequence.
[0112] Step 34, pooling operation: Use the maximum pooling operation to compress the features extracted by the convolutional layer and remove redundant information, thereby simplifying the network complexity and improving the robustness of feature extraction.
[0113] In step 4, after obtaining the preliminary extracted feature map, the feature map processing based on the feature pyramid first reduces the number of channels of the C5 layer of the backbone network to obtain the P5 layer of the feature pyramid; then upsampling operations are performed in sequence to obtain the P4 and P3 layers, thereby obtaining features with the same length and width as C4 and C3; finally, the feature map of each layer is fused with the upsampled feature map of the previous layer from bottom to top to generate the final feature map.
[0114] In step 5, the capsule robot bounding box representation based on sliding vertices includes the following steps:
[0115] Step 51, calculate the length and width of the capsule robot's horizontal frame: We first calculate the length and width of the horizontal frame using the formula based on the information of the capsule robot's rotation frame marked by the doctor:
[0116] w=max(x1,x2,x3,x4)-min(x1,x2,x3,x4)
[0117] h=max(y1,y2,y3,y4)-min(y1,y2,y3,y4)
[0118] Step 52: Calculate the distance S between the corresponding vertices of the horizontal frame and the rotation frame i ,i∈[1,2,3,4].
[0119] S i =||V i -V i '||
[0120] Step 53: Calculate the ratio of the distance between vertices to the side length of the corresponding horizontal box δ i ,i∈[1,2,3,4]:
[0121]
[0122] Step 54: Calculate the area ratio ar between the horizontal frame and the rotation frame.
[0123] Step 55, represent the capsule robot bounding box: After completing the above steps, we can use the nine-tuple o to represent the bounding box that better fits the capsule robot, o = [x, y, w, h, δ1, δ2, δ3, δ4, ar]. See the attached diagram for a specific diagram. Figure 3 .
[0124] In step 6, the network parameter optimization based on the joint loss function includes: first constructing the loss function for the distribution of positive and negative samples and the loss function for the regression capsule robot bounding box; then calculating the loss value between the model prediction result and the true value and the gradient of the loss function with respect to the current network parameters; updating the network parameters according to the loss value and the learning rate; repeating the above steps until the value of the loss function converges or reaches a preset threshold.
[0125] The above is only a preferred embodiment of the present invention. For those skilled in the art, several improvements and modifications may be made without departing from the principle of the present invention. These improvements and modifications should also be within the scope of protection of the present invention.
Claims
1. A capsule robot automatic positioning method based on ultrasound images, characterized in that: The steps include: Step 1: Data preprocessing; Step 2, generating a directed elliptical Gaussian region of the capsule robot's adaptability; Step 3: Ultrasonic image feature extraction based on backbone network; Step 4: Feature map processing based on feature pyramid; Step 5: Capsule robot bounding box representation based on sliding vertices; Step 6: Network parameter optimization based on joint loss function.
2. The method for automatic positioning of a capsule robot based on ultrasonic images according to claim 1, characterized in that: In step 1, the data preprocessing steps specifically include: first, performing data enhancement operations such as random lateral translation, random longitudinal translation, and random rotation on the 2631 initial ultrasound images to generate 52620 ultrasound images and corresponding annotation files to improve the generalization ability and robustness of the model; then, dividing the data set into training set, validation set, and test set in a ratio of 7:2:1; the training set is used to build the model, the validation set is used to evaluate the performance of the model during the training process, perform parameter adjustment and model selection, and the test set is used to evaluate the performance of the trained model.
3. The method for automatic positioning of a capsule robot based on ultrasonic images according to claim 1, characterized in that: In step 2, generating the directed elliptical Gaussian region of the capsule robot's adaptability includes the following steps: Step 21, generating a standard Gaussian region: taking the position information of the capsule robot in the ultrasound image annotated by the doctor together with the ultrasound image as input, generating a circular standard Gaussian region as a candidate region of the positive sample; Step 22, generating a directed elliptical Gaussian region: transforming the circular standard Gaussian region into a directed elliptical Gaussian region by stretching and rotating; Step 23: Weight allocation of the location points of the positive sample candidate area: according to the Gaussian probability density function Calculate the weights for all points in the directed elliptical Gaussian region, where X = [x, y] T ~N(μ,C), C represents the covariance matrix of two variables, μ represents the mean vector; Step 24, generate capsule robot area: traverse all position points in the directed elliptical area. If the weight of the position point is equal to 0, the position point is considered to be a negative sample, otherwise the position point is considered to be a positive sample. The area formed by all positive samples is the directed elliptical Gaussian area of the capsule robot.
4. The method for automatic positioning of a capsule robot based on ultrasonic images according to claim 3, characterized in that: In step 22, generating a directed elliptical Gaussian region includes the following steps: Step 221, calculate the coordinates of the center point of the ellipse: calculate the coordinates of the center point of the ellipse area according to the position information of the capsule robot in the ultrasound image marked by the doctor, and the formula is as follows: symbol Indicates that the result is rounded up, x i ,y i ,i∈[1,2,3,4] represents the coordinates of the four vertices of the capsule robot bounding box marked by the doctor, and stride=[8,16,32] represents the corresponding upsampling ratio; Step 222, calculate the lengths of the major and minor axes of the ellipse: calculate the lengths of the major and minor axes of the Gaussian region of the directed ellipse according to the formula, which is as follows: Step 223, constructing a rotation matrix and a stretching matrix: constructing a rotation matrix and a stretching matrix according to the obtained coordinates of the center point of the ellipse and the lengths of the major and minor semi-axes, where R represents the rotation matrix and E represents the stretching matrix; Where T IOU Represents the IOU threshold, here we set T IOU =0.3, angle represents the rotation angle of the capsule robot; Step 224, generating a directed elliptical Gaussian region: generating a directed elliptical Gaussian region that better fits the shape and direction of the capsule robot according to the stretching and rotation matrix. ax=[i-gridx,j-gridy] T symbol represents matrix multiplication, i and j represent the horizontal and vertical coordinates of any position point in the positive sample candidate area generated in step 22, respectively.
5. The method for automatic positioning of a capsule robot based on ultrasonic images according to claim 1, characterized in that: The feature extraction of ultrasound images based on the backbone network in step 3 includes the following steps: Step 31, image preprocessing: The input ultrasound image needs to be adjusted to the format and size required by the backbone network Darknet we selected. Here, all images will be resized to (800,800,1) when input into the convolutional neural network. Here 1 represents the number of channels, which means that the input data is a gray image; Step 32: Load pre-trained weights: Load the pre-trained Darknet53 weights to accelerate the convergence of the model and improve the performance of the model. Step 33, convolutional layer feature extraction: five convolutional layers with a convolution kernel size of 3×3 are sequentially used to extract features from the preprocessed ultrasound image; Step 34, pooling operation: Use the maximum pooling operation to compress the features extracted by the convolutional layer and remove redundant information, thereby simplifying the network complexity and improving the robustness of feature extraction.
6. The method for automatic positioning of a capsule robot based on ultrasonic images according to claim 1, characterized in that: The feature map processing steps based on the feature pyramid in step 4 specifically include: first, reducing the number of channels of the C5 layer of the backbone network to obtain the P5 layer of the feature pyramid; then performing upsampling operations in sequence to obtain the P4 and P3 layers, thereby obtaining features with the same length and width as C4 and C3; finally, fusing the feature map of each layer with the upsampled feature map of the previous layer from bottom to top to generate the final feature map.
7. The method for automatic positioning of a capsule robot based on ultrasonic images according to claim 1, characterized in that: The capsule robot bounding box representation based on sliding vertices in step 5 includes the following steps: Step 51, calculate the length and width of the capsule robot's horizontal frame: We first calculate the length and width of the horizontal frame using the formula based on the information of the capsule robot's rotation frame marked by the doctor: w=max(x1,x2,x3,x4)-min(x1,x2,x3,x4) h=max(y1,y2,y3,y4)-min(y1,y2,y3,y4) Step 52: Calculate the distance S between the corresponding vertices of the horizontal frame and the rotation frame i ,i∈[1,2,3,4]; S i =||V i -V i '|| Step 53: Calculate the ratio of the distance between vertices to the side length of the corresponding horizontal box δ i ,i∈[1,2,3,4]: Step 54, calculating the area ratio ar between the horizontal frame and the rotation frame; Step 55, represent the capsule robot bounding box: After completing the above steps, we can use the nine-tuple o to represent the bounding box that better fits the capsule robot, o = [x, y, w, h, δ1, δ2, δ3, δ4, ar].
8. The method for automatic positioning of a capsule robot based on ultrasonic images according to claim 1, characterized in that: The network parameter optimization based on the joint loss function in step 6 specifically includes the following steps: First, construct the loss function for the distribution of positive and negative samples and the loss function for regressing the capsule robot bounding box; Then calculate the loss value between the model's predicted result and the true value, as well as the gradient of the loss function with respect to the current network parameters; update the network parameters according to the loss value and the learning rate; repeat the above steps until the value of the loss function converges or reaches a preset threshold.
Citation Information
Patent Citations
Image equal-proportion scaling processing method and system based on affine transformation
CN114331819A
Remote sensing image arbitrary direction target detection method based on deep learning
CN115115936A
Reservoir inspection method and device
CN115793685A
Capsule robot gastrointestinal tract path planning method based on self-adaptive variation golden litsea rotundifolia algorithm
CN116863106A
Video face fusion method and device based on neural network, equipment and medium
CN116895006A
