A thyroid cross-section segmentation result correction method and device
By selecting a reference image and performing contour correction in ultrasound imaging, the problem of misidentifying paraglandular glands and blood vessels in thyroid segmentation was solved, achieving more accurate and stable thyroid contour extraction and improving the positioning accuracy and lesion identification capability of the ultrasound robot.
Patent Information
- Application Number
- CN202510141301.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-02-08
Smart Images

Figure CN120052960B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a thyroid cross-sectional segmentation result correction method and device. BACKGROUND
[0002] In the field of medical imaging, ultrasound imaging is widely used in clinical diagnosis as a non-invasive, real-time and cost-effective examination method. Especially for the detection of thyroid diseases, ultrasound imaging provides key information for evaluating the size, shape, structure and lesion location of the thyroid. However, due to the inherent limitations of ultrasound imaging, such as poor fit, individual tissue differences, insufficient imaging clarity, etc., automatic segmentation of thyroid cross-sections becomes a challenging task.
[0003] In recent years, with the development of computer vision and deep learning technology, it is possible to automatically perform image segmentation by training neural network models. These models can identify and segment the thyroid region in ultrasound images, and the thyroid cross-sections generated by segmentation can guide the mechanical arm to plan the scanning path of the thyroid, judge the overall shape of the thyroid, and identify thyroid lesions, etc. SUMMARY
[0004] In order to obtain a more accurate thyroid contour, the present application provides a thyroid cross-sectional segmentation result correction method and device.
[0005] In a first aspect, the present application provides a thyroid cross-sectional segmentation result correction method, which can include:
[0006] Acquiring ultrasound images collected in real time by ultrasound robots performing cross-sectional scanning along a preset path from the isthmus of the thyroid to one side of the thyroid;
[0007] When there is only one contour in a plurality of consecutive ultrasound images, any one of the plurality of ultrasound images is taken as a reference image, the width of the contour in the reference image in the X-axis direction is determined as a reference width;
[0008] For ultrasound images collected after the plurality of ultrasound images, the following method is used for correction:
[0009] For each contour to be processed in the ultrasound image, the width of the contour to be processed in the X-axis direction is determined as a real-time width, and the proportion of the point set located within the contour circumscribed circle of the last ultrasound image is calculated;
[0010] If the point set proportion is greater than a preset correct recognition threshold, the contour to be processed is retained;
[0011] If the point set proportion is less than a preset misrecognition threshold, the contour to be processed is deleted from all contours of the ultrasound image.
[0012] if the point set ratio is greater than the preset misrecognition threshold and less than the preset correct recognition threshold, determining whether a ratio of the real-time width to the reference width is greater than a preset width threshold;
[0013] if yes, retaining points of the to-be-processed contour located in a circumscribed circle of the contour of the previous ultrasound image to obtain a corresponding corrected to-be-processed contour;
[0014] if no, retaining the to-be-processed contour.
[0015] In one or some optional embodiments of the embodiments of the present application, the point set ratio of the to-be-processed contour located in the circumscribed circle of the contour of the previous ultrasound image is calculated by the following manner, comprising:
[0016] fitting a minimum circumscribed circle of all contours in the previous ultrasound image to obtain the circumscribed circle of the contour of the previous ultrasound image;
[0017] determining a center and a radius of the circumscribed circle of the contour of the previous ultrasound image;
[0018] calculating Euclidean distances of all points in the to-be-processed contour to the center of the circumscribed circle of the contour of the previous ultrasound image;
[0019] based on the following formula, calculating the point set ratio of the to-be-processed contour located in the circumscribed circle of the contour of the previous ultrasound image according to the Euclidean distances of all points in the to-be-processed contour to the center of the circumscribed circle of the contour of the previous ultrasound image and the radius of the circumscribed circle of the contour of the previous ultrasound image:
[0020]
[0021] In the formula, Ra is the point set ratio, n is the total number of pixel points in the to-be-processed contour, dis[t] represents the Euclidean distance of the tth pixel point in the to-be-processed contour to the center of the circumscribed circle of the contour of the previous ultrasound image, R i-1 represents the radius of the circumscribed circle of the contour of the previous ultrasound image, 1 ||判断式|| is an indicator function, indicating that the value of the indicator function is 1 if the judgment formula is true, and the value of the indicator function is 0 if the judgment formula is not true.
[0022] In one or some optional embodiments of the embodiments of the present application, after processing all to-be-processed contours in an ultrasound image, further comprising:
[0023] calculating the width of each contour in the processed ultrasound image in the X-axis direction;
[0024] If a width of the contour in the X-axis direction in the processed ultrasound image is greater than the reference width, the width of the contour in the X-axis direction is taken as a new reference width.
[0025] In one or some optional embodiments of the embodiments of the application, after processing all contours in an ultrasound image, the method further comprises:
[0026] fitting a minimum circumscribed circle of all contours in the processed ultrasound image to obtain a contour circumscribed circle of the processed ultrasound image;
[0027] determining a center and a radius of the contour circumscribed circle of the processed ultrasound image;
[0028] If a ratio of the radius of the contour circumscribed circle to the radius of the contour circumscribed circle of the previous ultrasound image is less than a preset radius threshold, the center and the radius of the contour circumscribed circle of the previous ultrasound image are taken as the center and the radius of the contour circumscribed circle of the processed ultrasound image.
[0029] In one or some optional embodiments of the embodiments of the application, the contour in the ultrasound image is obtained by the following manner:
[0030] performing image segmentation on the ultrasound image based on a preset image segmentation model to obtain a mask image;
[0031] performing contour searching on the mask image to obtain all contours in the ultrasound image.
[0032] In one or some optional embodiments of the embodiments of the application, after obtaining all contours in the ultrasound image, the method further comprises:
[0033] If there is a contour completely surrounded by another contour, the surrounded contour is deleted;
[0034] and, contours composed of single pixel points are deleted.
[0035] In a second aspect, the embodiments of the application provide a thyroid transverse segmentation result correction device, which can include:
[0036] An image acquisition module is configured to acquire ultrasound images collected in real time by an ultrasound robot performing transverse scanning along a preset path from the thyroid isthmus as a starting point to one side of the thyroid.
[0037] A reference confirmation module is configured to, when there is only one contour in a plurality of continuous ultrasound images, take any one of the plurality of ultrasound images as a reference image, determine a width of the contour in the reference image in the X-axis direction as a reference width.
[0038] The first calculation module is configured to correct an ultrasound image acquired after the plurality of ultrasound images by determining, for each to-be-processed contour in the ultrasound image, a width of the to-be-processed contour in an X-axis direction as a real-time width, and calculating a point set proportion of the to-be-processed contour located within a contour circumscribed circle of a previous ultrasound image;
[0039] The first judgment module is configured to retain the to-be-processed contour when the point set proportion is greater than a preset correct recognition threshold value.
[0040] The second judgment module is configured to delete the to-be-processed contour from all contours of the ultrasound image when the point set proportion is less than a preset misrecognition threshold value.
[0041] The third judgment module is configured to judge whether a ratio of the real-time width to the reference width is greater than a preset width threshold value when the point set proportion is greater than the preset misrecognition threshold value and less than the preset correct recognition threshold value; if yes, retaining points of the to-be-processed contour located within the contour circumscribed circle of the previous ultrasound image to obtain a corresponding corrected processed contour; and if no, retaining the to-be-processed contour.
[0042] In a third aspect, a computer readable storage medium is provided, which stores a computer program / instruction, and the computer program / instruction is executed by a processor to implement the thyroid cross-sectional segmentation result correction method.
[0043] In a fourth aspect, a computer program product is provided, which includes a computer program / instruction, and the computer program / instruction is executed by a processor to implement the thyroid cross-sectional segmentation result correction method.
[0044] In a fifth aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the thyroid cross-sectional segmentation result correction method.
[0045] The above technical solution provided by the embodiments of the present application has at least the following beneficial effects:
[0046] The embodiment of the present application provides a thyroid transverse segmentation result correction method, which comprises the following steps: acquiring real-time ultrasound images collected by an ultrasound robot in a transverse scanning process according to a preset path; when only one contour exists in a plurality of continuous ultrasound images, selecting one of the ultrasound images as a reference image and determining the width of the contour in the X-axis direction as a reference width; for each ultrasound image collected after the reference image, the following correction is performed: for each contour to be processed in the ultrasound image, the width of the contour in the X-axis direction is calculated, and the point set ratio of the contour in the circumcircle of the contour in the last image is obtained; if the point set ratio is greater than a preset correct recognition threshold, the contour is retained; if the point set ratio is less than a preset misrecognition threshold, the contour is deleted; if the point set ratio is between the two thresholds, whether the ratio of the real-time width to the reference width is greater than a preset width threshold is further judged; if yes, the points in the circumcircle of the contour in the last image are retained; if no, the contour is directly retained. The present method effectively removes noise and false contours, ensures that only the real thyroid contour is retained, reduces misrecognition caused by parathyroid glands, blood vessels and the like, and significantly improves the accuracy and robustness of the thyroid ultrasound image segmentation result. In combination with the fitting strategy of the minimum circumcircle and the intelligent judgment mechanism, different scanning angles and image qualities are adapted, and the stability and consistency of the contour extraction are ensured. The corrected ultrasound image segmentation result improves the positioning accuracy and lesion recognition capability of the ultrasound robot, and provides more reliable support for thyroid ultrasound scanning.
[0047] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims.
[0048] The technical solutions of the present application will be further described in detail below with the help of the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0049] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, illustrate the present application, and are used to explain the present application together with the embodiments of the present application, and do not constitute a limitation on the present application. In the drawings:
[0050] Figure 1 A flowchart of a thyroid transverse segmentation result correction method provided by the embodiment of the present application is shown in the figure.
[0051] Figure 2 A thyroid structure schematic diagram provided by the embodiment of the present application is shown in the figure.
[0052] Figure 3 A parathyroid gland misrecognition ultrasound image schematic diagram provided by the embodiment of the present application is shown in the figure.
[0053] Figure 4The parathyroid gland misrecognition mask image schematic diagram provided for the embodiment of the present application;
[0054] Figure 5 The blood vessel misrecognition ultrasound image schematic diagram provided for the embodiment of the present application;
[0055] Figure 6 The blood vessel misrecognition mask image schematic diagram provided for the embodiment of the present application;
[0056] Figure 7 The thyroid lesion correct recognition ultrasound image schematic diagram provided for the embodiment of the present application;
[0057] Figure 8 The thyroid lesion correct recognition mask image schematic diagram provided for the embodiment of the present application;
[0058] Figure 9 The envelope contour ultrasound image schematic diagram provided for the embodiment of the present application;
[0059] Figure 10 The envelope contour mask image schematic diagram provided for the embodiment of the present application;
[0060] Figure 11 The parathyroid gland misrecognition elimination segmentation result schematic diagram provided for the embodiment of the present application;
[0061] Figure 12 The blood vessel misrecognition elimination segmentation result schematic diagram provided for the embodiment of the present application;
[0062] Figure 13 The structure schematic diagram of the thyroid transverse segmentation result correction device provided for the embodiment of the present application. DETAILED DESCRIPTION
[0063] Exemplary embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be more thoroughly understood, and the scope of the present disclosure can be accurately conveyed to those skilled in the art.
[0064] The inventors found that in the prior art, due to the influence of similar structures such as parathyroid glands and complex factors such as blood vessels near the thyroid, the existing image segmentation method may have misrecognition problems, for example, misrecognizing parathyroid glands as thyroid glands or misjudging blood vessels as lesions, which greatly affects the accuracy of the segmentation result.
[0065] Based on this, the inventors have made further research and development, and made the present application, providing a thyroid transverse segmentation result correction method and device.
[0066] Embodiment one
[0067] The embodiment one of the present application provides a thyroid cross-section segmentation result correction method, referring to the figure, the method can comprise the following steps S101-S108: Figure 1
[0068] S101: An ultrasound robot is used to collect real-time ultrasound images by cross-section scanning along a preset path from the thyroid isthmus to one side of the thyroid.
[0069] S102: When there is only one contour in a plurality of continuous ultrasound images, any one of the plurality of ultrasound images is taken as a reference image, the width of the contour in the reference image in the X-axis direction is determined as a reference width.
[0070] S103: The ultrasound images collected after the plurality of ultrasound images are corrected by the following method: for each contour to be processed in the ultrasound image, the width of the contour to be processed in the X-axis direction is determined as a real-time width, and the point set ratio of the contour to be processed in the contour circumscribed circle of the last ultrasound image is calculated.
[0071] S104: If the point set ratio is greater than a preset correct recognition threshold, the contour to be processed is retained.
[0072] S105: If the point set ratio is less than a preset misrecognition threshold, the contour to be processed is deleted from all contours of the ultrasound image.
[0073] S106: If the point set ratio is greater than the preset misrecognition threshold and less than the preset correct recognition threshold, it is judged whether the ratio of the real-time width to the reference width is greater than a preset width threshold: if yes, step S107 is executed; if no, step S108 is executed.
[0074] S107: The points of the contour to be processed located in the contour circumscribed circle of the last ultrasound image are retained to obtain a corresponding corrected processed contour.
[0075] S108: The contour to be processed is retained.
[0076] The embodiment of the present application provides a thyroid transverse segmentation result correction method, which acquires real-time ultrasound images in the process of transverse scanning of an ultrasound robot according to a preset path, selects one of the continuous multiple ultrasound images as a reference image when only one contour exists in the continuous multiple ultrasound images, determines the width of the contour in the X-axis direction as a reference width, and corrects each ultrasound image collected after the reference image by the following method. For each contour to be processed in the ultrasound image, the width of the contour in the X-axis direction is calculated, and the point set ratio of the contour in the circumcircle of the contour of the last image is obtained. If the point set ratio is greater than a preset correct recognition threshold, the contour is retained. If the ratio is less than a preset misrecognition threshold, the contour is deleted. If the ratio is between the two, it is further judged whether the ratio of the real-time width to the reference width is greater than a preset width threshold. If yes, the points in the circumcircle of the contour of the last image are retained. If no, the contour is directly retained. The present method effectively removes noise and false contours, ensures that only the real thyroid contour is retained, reduces misrecognition caused by parathyroid glands, blood vessels and other interference, and significantly improves the accuracy and robustness of the thyroid ultrasound image segmentation result. Combined with the fitting strategy of the minimum circumcircle and the intelligent judgment mechanism, different scanning angles and image qualities are adapted to ensure the stability and consistency of the contour extraction. The corrected ultrasound image segmentation result improves the positioning accuracy and lesion recognition ability of the ultrasound robot, and provides more reliable support for thyroid ultrasound scanning.
[0077] In the embodiment of the present application, referring to the thyroid structure shown in Figure 2 When the thyroid ultrasound is transversely scanned, the thyroid isthmus is a connecting area connecting the left lobe and the right lobe, and is distributed between the organ and the skin. The thyroid transverse area close to the isthmus is displayed more clearly and single in the ultrasound image, and the recognition accuracy is higher. The farther from the isthmus, the less clear the imaging is.
[0078] Based on the above-mentioned thyroid ultrasound imaging characteristics, when the mechanical arm performs thyroid ultrasound scanning, the mechanical arm moves to a position where the left lobe or the right lobe is basically level with the isthmus from the position of the isthmus as a starting point, and then scans upward. After reaching the upper end point of the left lobe or the right lobe, the mechanical arm scans downward until reaching the lower end point, and then returns to the position where the left lobe or the right lobe is basically level with the isthmus.
[0079] Due to the influence of similar structures such as parathyroid glands and complex factors such as blood vessels near the thyroid, the existing image segmentation method may have misrecognition problems, such as mistaking the parathyroid glands as thyroid glands or mistaking the blood vessels near the glands as lesions, which greatly affects the accuracy of the segmentation result.
[0080] Specifically, in the scanning process, the image segmentation model based on deep learning may misidentify the parathyroid glands as thyroid glands, or misidentify the blood vessels near the glands as thyroid glands, which needs to be distinguished from the thyroid ultrasound images with lesions.
[0081] In a specific embodiment, the ultrasound image and the mask image in which the parathyroid gland misrecognition occurs are as shown in Figure 3 and Figure 4 , in which the red curve is the correctly recognized thyroid position, and the blue curve is the misrecognized parathyroid gland position. Figure 3 Figure 4 The left side in is the correctly recognized mask region, and the right side is the misrecognized parathyroid gland mask region. The ultrasound image and the mask image in which the blood vessel misrecognition occurs are as shown in Figure 5 and Figure 6 , in which the red curve is the correctly recognized thyroid position, and the purple curve is the misrecognized blood vessel position. Figure 5 Figure 6 The mask region in is the connected thyroid and parathyroid gland. The ultrasound image and the mask image of the thyroid with a lesion are as shown in Figure 7 and Figure 8 , in which the red curve is the correctly recognized thyroid lesion position. Figure 7 Figure 8 The mask region in is the thyroid lesion.
[0082] In the above step S101, the ultrasound robot collects the ultrasound image in real time by transverse scanning from the thyroid isthmus as the starting point to the thyroid side along a preset path.
[0083] Specifically, the ultrasound robot can control the mechanical arm to perform transverse scanning from the thyroid isthmus as the starting point to the thyroid side (left side or right side) along a preset path. During the scanning process, the robot collects the ultrasound image in real time through precise mechanical arm control.
[0084] In the embodiments of the present application, after the above step S101, the method further includes a step S109 of pre-processing the ultrasound image collected in real time. The preprocessing specifically includes the following steps S1091-S1094:
[0085] S1091: performing image segmentation on the ultrasound image based on a preset image segmentation model to obtain a mask image.
[0086] Specifically, the ultrasound image collected can be segmented by a preset image segmentation model to obtain a mask image of the thyroid region, and the mask image represents the position and shape of the thyroid in the image. (Such as U-Net, etc.)
[0087] A person skilled in the art can select a suitable neural network to be pre-trained according to the detailed description of the prior art to obtain a preset image segmentation model. The training process can specifically include:
[0088] First, collect thyroid ultrasound images and label the contours of the thyroid in each image. After preprocessing, a thyroid contour dataset is obtained.
[0089] Second, select an appropriate neural network model as the initial image segmentation network, such as the U-Net model, SegNet model, etc.
[0090] Third, divide the thyroid contour dataset into a training set and a test set.
[0091] Fourth, define the loss function (such as cross-entropy loss function, mean square error loss function, etc.), optimization algorithm (such as Adam, SGD, etc.), etc.
[0092] Fifth, use the training set of the thyroid contour dataset to train the selected neural network model, obtaining a trained image segmentation network.
[0093] Repeat the above image segmentation model training process until the preset condition is met, stop training, and obtain the preset image segmentation model. The preset condition can be set to reach a fixed number of iterations, the accuracy reaches a threshold, the accuracy no longer changes within a preset number of iterations, etc. No specific limitation is made here.
[0094] S1092: Find contours in the mask image to obtain all contours in the ultrasound image.
[0095] Specifically, the findContours function in OpenCV (Open Source Computer Vision Library) can be used to find contours in the mask image to obtain all contours in the ultrasound image.
[0096] S1093: If one contour is completely surrounded by another contour among all contours, delete the surrounded contour.
[0097] Specifically, due to problems such as unclear images and high noise in ultrasound imaging, there may be smaller contours within some contours in the mask image, i.e., envelope contours. For example, as shown in Figure 9 and Figure 10 , the ultrasound image is Figure 9 , the corresponding mask image is Figure 10 , and the red curve in Figure 9 is a larger contour, and the yellow curve is a smaller contour inside, which corresponds to the black block in Figure 10 .
[0098] To simplify the algorithm complexity, all contours are traversed to determine whether there is a contour completely contained in another contour, if so, the contour is considered as noise or invalid contour, and the contour is deleted.
[0099] S1094: deleting a contour composed of a single pixel point.
[0100] Specifically, the total number of included pixel points of each contour can be checked, if a contour is composed of a single pixel point, the contour is considered to be too small or not to meet the requirements of an actual contour, and the contour is deleted.
[0101] In the embodiments of the present application, the above steps S101 and S109 are processed by collecting ultrasound images, using a preset image segmentation model, combining contour finding and envelope contour rejection, effectively removing noise contours and small contours that do not conform to reality, thereby simplifying the algorithm complexity and improving the calculation efficiency. In addition, for the unclear and noise problems in ultrasound imaging, the envelope rejection strategy is used to further optimize the image processing result, ensuring the accurate extraction of the thyroid region, and providing a reliable basis for subsequent diagnosis and analysis.
[0102] In the above step S102, when there is only one contour in a plurality of continuous ultrasound images, any one of the plurality of ultrasound images is taken as a reference image, the width of the contour in the reference image in the X-axis direction is determined as the reference width.
[0103] Specifically, when there is only one contour in a plurality of continuous ultrasound images, these ultrasound images are taken as a reference set, and any one of them is taken as a reference image, and the subsequent thyroid scan misidentification correction work is started from the reference image.
[0104] The maximum width value of the contour in the reference image in the X-axis direction is calculated as the reference width.
[0105] In the embodiments of the present application, in the thyroid transverse scan misidentification rejection process, the selection of the reference image is particularly important. As described above, the area near the thyroid isthmus is displayed more clearly and single in the ultrasound image, and the recognition accuracy is higher, therefore, the present method starts from the thyroid isthmus as the starting point, and determines the reference image based on the single contour, which can minimize the interference caused by image noise and unclear imaging, and is helpful for the subsequent contour correction, and ensures the consistency and accuracy of the entire thyroid scan process.
[0106] In step S103, for the ultrasound image acquired after the plurality of ultrasound images, the width of each to-be-processed contour in the X-axis direction is determined as the real-time width, and the proportion of the point set of the to-be-processed contour in the contour circumscribed circle of the previous ultrasound image is calculated. Specifically, steps S1031-S1035 are included.
[0107] S1031: For the ultrasound image acquired after the plurality of ultrasound images, the width of each to-be-processed contour in the X-axis direction is determined as the real-time width.
[0108] Specifically, for each to-be-processed contour, the width of the contour in the X-axis direction can be calculated as the real-time width of the to-be-processed width by using an image processing tool such as the cv2.boundingRect() function in OpenCV. The real-time width refers to the span of the minimum bounding box of the contour in the X-axis, that is, the difference between the right boundary and the left boundary of the rectangle.
[0109] S1032: The minimum circumscribed circle of all contours in the previous ultrasound image is fitted to obtain the contour circumscribed circle of the previous ultrasound image.
[0110] Specifically, the contours in the previous ultrasound image can be processed by using the cv2.minEnclosingCircle() function in OpenCV to obtain the minimum circumscribed circle of all contours as the contour circumscribed circle of the previous ultrasound image.
[0111] It should be noted that in step S102, the plurality of ultrasound images with only one contour in the interior are taken as the reference set, and the first ultrasound image acquired after the reference set is the reference image. Therefore, the ultrasound images other than the reference image in the reference set do not need to be processed.
[0112] S1033: The center and radius of the contour circumscribed circle of the previous ultrasound image are determined.
[0113] Specifically, based on the contour circumscribed circle of the previous ultrasound image obtained in step S1032, the center and radius of the circumscribed circle calculated by using the cv2.minEnclosingCircle() function can be obtained.
[0114] S1034: The Euclidean distance of all points in the to-be-processed contour to the center of the contour circumscribed circle of the previous ultrasound image is calculated.
[0115] Specifically, the Euclidean distance of each pixel point in the to-be-processed contour to the center of the circumscribed circle of the contour of the previous ultrasound image can be calculated based on the following formula 1:
[0116]
[0117] In the formula, dis[t] represents the Euclidean distance of the tth pixel point in the to-be-processed contour to the center of the circumscribed circle of the contour of the previous ultrasound image, points[t] represents the tth pixel point in the to-be-processed contour, O i-1 represents the center of the circumscribed circle of the contour of the previous ultrasound image.
[0118] S1035: According to the Euclidean distances of all points in the to-be-processed contour to the center of the circumscribed circle of the contour of the previous ultrasound image and the radius of the circumscribed circle of the contour of the previous ultrasound image, the proportion of the point set of the to-be-processed contour in the circumscribed circle of the contour of the previous ultrasound image is calculated based on the following formula:
[0119]
[0120] In the formula, Ra is the proportion of the point set, n is the total number of pixel points in the to-be-processed contour, dis[t] represents the Euclidean distance of the tth pixel point in the to-be-processed contour to the center of the circumscribed circle of the contour of the previous ultrasound image, R i-1 represents the radius of the circumscribed circle of the contour of the previous ultrasound image, 1 ||判断式|| is an indicator function, which is 1 if the judgment formula is true, and 0 if the judgment formula is false.
[0121] To facilitate those skilled in the art to understand the present scheme, the specific implementation process of step S103 provided by the embodiments of the present application will be described more clearly and completely in combination with data expressions: all to-be-processed contours P i in the ith ultrasound image P i Contours1, P i Contours2, …, P i Contours j (j>0) are processed in turn. First, the Euclidean distance of each pixel point points[t] in the to-be-processed contour P i Contours j to the center O i-1 of the circumscribed circle of the contour of the previous ultrasound image is calculated based on the above formula 1, and then the proportion Ra of the point set of the to-be-processed contour in the circumscribed circle of the contour of the previous ultrasound image is calculated based on the above formula 2.
[0122] In the embodiments of the present application, the step S103 described above provides an efficient and accurate way to analyze the contour changes in the ultrasound images by automatically evaluating whether the contours meet the expectations or need further processing by effectively comparing the contour changes between the continuous ultrasound images, thereby optimizing the image analysis process.
[0123] In the step S104 described above, if the point set ratio is greater than the preset correct recognition threshold, the contour to be processed is retained.
[0124] Specifically, if the point set ratio is greater than the preset correct recognition threshold, it is considered that most of the pixel points of the contour to be processed are located within the circumscribed circle of the contour of the previous ultrasound image, and the contour to be processed is a correctly identified thyroid contour, and the thyroid contour is included. The preset correct recognition threshold can be exemplarily set to 0.7.
[0125] In the step S105 described above, if the point set ratio is less than the preset misrecognition threshold, the contour to be processed is deleted from all the contours of the ultrasound images.
[0126] Specifically, if the point set ratio is less than the preset misrecognition threshold, it is considered that the contour to be processed is located outside the circumscribed circle of the contour of the previous ultrasound image, and is a misidentified parathyroid or blood vessel, and the contour to be processed is deleted. The preset misrecognition threshold can be exemplarily set to 0.2.
[0127] In the step S106 described above, if the point set ratio is greater than the preset misrecognition threshold and less than the preset correct recognition threshold, it is determined whether the ratio of the real-time width to the reference width is greater than the preset width threshold: if yes, the step S107 is performed; and if no, the step S108 is performed to retain the contour to be processed.
[0128] Specifically, if the point set ratio is greater than the preset misrecognition threshold and less than the preset correct recognition threshold, it is necessary to further determine the ratio of the real-time width to the reference width.
[0129] If the ratio of the real-time width to the reference width is greater than the preset width threshold, i.e., L j > αL base It is considered that part of the contour to be processed is an effective contour, which meets the expected thyroid region characteristics, and the subsequent thyroid transverse segmentation result correction process can be continued.
[0130] If the ratio of the real-time width to the reference width is less than the preset width threshold, i.e., L j < αL base It is considered that the contour to be processed is an effective contour, which is correctly identified and retained.
[0131] L j represents the real-time width, and L baseThe reference width is represented, and a represents a preset width threshold, which can be set to 1.2 as an example.
[0132] In the step S107, the points in the contour to be processed that are located in the circumscribed circle of the contour of the last ultrasound image are reserved to obtain a corresponding corrected contour to be processed.
[0133] Specifically, all the pixel points in the contour to be processed that are located in the circumscribed circle of the contour of the last ultrasound image can be reserved, and all the pixel points in the contour to be processed that are located outside the circumscribed circle of the contour of the last ultrasound image can be deleted to form a new contour covering the original contour to be processed.
[0134] In the embodiments of the present application, the steps S103-S108 are used to judge the validity of the contour to be processed based on the point set ratio, so as to reduce the possibility of misrecognition and missed recognition. Meanwhile, the ratio of the real-time width to the reference width is used for judgment, so as to further improve the accuracy of recognition and ensure that the contour of the thyroid region is accurately extracted. An efficient and automated scheme is provided for ultrasound image analysis, the accuracy and reliability of image processing are improved, and manual intervention is reduced.
[0135] In the embodiments of the present application, after all the contours to be processed in an ultrasound image are processed through the steps S103-S108, the step S110 of updating the reference width and the step S111 of updating the circumscribed circle, the center and the radius of the contour of the last ultrasound image need to be performed.
[0136] The step S110 specifically includes the following steps S1101-S1102:
[0137] S1101: The width of each contour in the processed ultrasound image in the X-axis direction is calculated.
[0138] Specifically, for each contour in the processed ultrasound image, the width of the contour in the X-axis direction can be calculated by using an image processing tool, such as the cv2.boundingRect() function in OpenCV. The width refers to the span of the minimum circumscribed rectangle (bounding box) of the contour in the X-axis direction, that is, the difference between the right boundary and the left boundary of the rectangle.
[0139] S1102: If the width of a contour in the processed ultrasound image in the X-axis direction is greater than the reference width, the width of the contour in the X-axis direction is taken as the new reference width.
[0140] Specifically, if the X-axis width of a contour is greater than the reference width, the width of the contour is taken as the new reference width to complete the update of the reference width. In this way, the reference width can always reflect the maximum thyroid contour width in the continuous ultrasound images, and the accuracy of subsequent contour comparison can be ensured.
[0141] Step S111 specifically includes steps S1111-S1113 as follows:
[0142] S1111: Fit the minimum circumscribed circle of all contours in the processed ultrasound image to obtain the contour circumscribed circle of the ultrasound image.
[0143] Specifically, the cv2.minEnclosingCircle() function in OpenCV can be used to process all contours in the processed ultrasound image, fit the minimum circumscribed circle containing all contours, and obtain the contour circumscribed circle of the processed ultrasound image.
[0144] S1112: Determine the center and radius of the contour circumscribed circle of the processed ultrasound image.
[0145] Specifically, based on the result returned by cv2.minEnclosingCircle() in step S1111, the center and radius of the contour circumscribed circle can be extracted.
[0146] S1113: If the ratio of the radius of the contour circumscribed circle to the radius of the contour circumscribed circle of the previous ultrasound image is less than a preset radius threshold, the center and radius of the contour circumscribed circle of the previous ultrasound image are taken as the center and radius of the contour circumscribed circle of the processed ultrasound image.
[0147] Specifically, the ratio of the radius of the contour circumscribed circle of the current processed ultrasound image to the radius of the contour circumscribed circle of the previous ultrasound image is calculated. If the ratio is less than a preset radius threshold (such as 0.6), it is considered that the contour circumscribed circle in the processed ultrasound image is too small, and the gland may not be recognized. Therefore, the center and radius of the contour circumscribed circle of the previous ultrasound image are retained as the center and radius of the contour circumscribed circle of the processed ultrasound image. The mathematical expression is shown in the following formula 3:
[0148]
[0149] In the formula, O i is the center of the contour circumscribed circle in the processed ultrasound image, O i-1 is the center of the contour circumscribed circle in the previous ultrasound image, R i is the radius of the contour circumscribed circle in the processed ultrasound image, and R i-1 is the radius of the contour circumscribed circle in the previous ultrasound image.
[0150] This step helps to maintain the consistency of the contour in the continuous image and avoid unnecessary changes that introduce errors.
[0151] In the embodiment of the present application, the post-processing step S110 described above avoids the influence of width fluctuation between different ultrasound images by ensuring that the reference width always reflects the largest thyroid profile, thereby maintaining the accuracy of profile comparison. Step S111 ensures profile consistency in consecutive images by dynamically adjusting the center and radius of the profile circumscribed circle. When the profile circumscribed circle of the ultrasound image is too small or inaccurate, the profile circumscribed circle information of the last ultrasound image is automatically retained, thereby reducing the risk of misidentification or omission. These post-processing steps collectively optimize the automatic analysis process of ultrasound images, improving the stability and reliability of image processing.
[0152] In the embodiment of the present application, the ultrasound image corrected by the method can effectively eliminate misidentification. Based on the parathyroid misidentification mask image as shown in Figure 4 After the parathyroid is removed by the method, the mask image as shown in Figure 11 The right parathyroid profile is correctly removed. Based on the blood vessel misidentification mask image as shown in Figure 6 After the blood vessels are removed by the method, the mask image as shown in Figure 12 The left connected blood vessel region is truncated, and the correct thyroid transverse segmentation result is retained.
[0153] Embodiment two
[0154] Based on the same inventive concept, the embodiment of the present application also provides a thyroid transverse segmentation result correction device. Referring to Figure 13 The device comprises:
[0155] An image acquisition module 101 is configured to acquire ultrasound images collected by an ultrasound robot in real time, starting from the thyroid isthmus and transversely scanning one side of the thyroid according to a preset path;
[0156] A reference confirmation module 102 is configured to, when there is only one profile in a plurality of consecutive ultrasound images, take any one of the plurality of ultrasound images as a reference image, determine the width of the profile in the reference image in the X-axis direction as a reference width, and determine the profile in the reference image in the X-axis direction as a reference width.
[0157] A first calculation module 103 is configured to correct ultrasound images collected after the plurality of ultrasound images by the following method: for each to-be-processed profile in the ultrasound images, determining the width of the to-be-processed profile in the X-axis direction as a real-time width, and calculating the proportion of the point set of the to-be-processed profile located in the profile circumscribed circle of the last ultrasound image.
[0158] A first judgment module 104 is configured to, when the point set proportion is greater than a preset correct identification threshold, retain the to-be-processed profile.
[0159] The second judging module 105 is configured to delete the contour to be processed from all contours of the ultrasound image when the point set ratio is less than a preset misrecognition threshold.
[0160] The third judging module 106 is configured to judge whether the ratio of the real-time width to the reference width is greater than a preset width threshold when the point set ratio is greater than the preset misrecognition threshold and less than a preset correct recognition threshold; if yes, the points of the contour to be processed located in the circumscribed circle of the contour of the last ultrasound image are reserved to obtain a corresponding corrected contour to be processed; if no, the contour to be processed is reserved.
[0161] Embodiment three
[0162] Based on the same inventive concept, the present application also provides a computer readable storage medium, which stores computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the thyroid cross-section segmentation result correction method described in the above embodiment one.
[0163] Embodiment four
[0164] Based on the same inventive concept, the present application also provides a computer program product, which includes computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the thyroid cross-section segmentation result correction method described in the above embodiment one.
[0165] Embodiment five
[0166] Based on the same inventive concept, the present application also provides a computer device, which includes a memory, a processor, and computer programs stored in the memory, and the processor executes the computer programs to implement the thyroid cross-section segmentation result correction method described in the above embodiment one.
[0167] Those skilled in the art should understand that embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including, but not limited to, disk memory and optical memory, etc.) containing computer usable program code.
[0168] The present application is described in reference to the accompanying drawings, which use flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more flow or flow diagrams and / or block or blocks. Figure 1 one or more flow or flow diagrams and / or block or blocks.
[0169] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more flow or flow diagrams and / or block or blocks. Figure 1 one or more flow or flow diagrams and / or block or blocks.
[0170] The computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more flow or flow diagrams and / or block or blocks. Figure 1 one or more flow or flow diagrams and / or block or blocks.
[0171] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their legal equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A thyroid cross-sectional segmentation result correction method, characterized by, The method comprises the following steps: An ultrasound robot is acquired to take the thyroid isthmus as a starting point, and to cross-sectionally scan an ultrasound image in real time along a preset path to one side of the thyroid; When only one contour exists in a plurality of continuous ultrasound images, any one of the plurality of ultrasound images is taken as a reference image, the width of the contour in the reference image in the X-axis direction is determined as a reference width; For an ultrasound image acquired after the plurality of ultrasound images, the following correction is performed: For each contour to be processed in the ultrasound image, the width of the contour to be processed in the X-axis direction is determined as a real-time width, and a point set ratio of the contour to be processed within the circumscribed circle of the contour of the previous ultrasound image is calculated; If the point set ratio is greater than a preset correct recognition threshold, the contour to be processed is retained; If the point set ratio is less than a preset misrecognition threshold, the contour to be processed is deleted from all contours of the ultrasound image; If the point set ratio is greater than the preset misrecognition threshold and less than the preset correct recognition threshold, it is determined whether the ratio of the real-time width to the reference width is greater than a preset width threshold; If yes, the points of the contour to be processed within the circumscribed circle of the contour of the previous ultrasound image are retained to obtain a corresponding corrected processed contour; If no, the contour to be processed is retained.
2. The method of claim 1, wherein, The point set ratio of the contour to be processed within the circumscribed circle of the contour of the previous ultrasound image is calculated in the following manner: The minimum circumscribed circle of all contours in the previous ultrasound image is fitted to obtain the circumscribed circle of the contour of the previous ultrasound image; The center and radius of the circumscribed circle of the contour of the previous ultrasound image are determined; The Euclidean distances of all points in the contour to be processed to the center of the circumscribed circle of the contour of the previous ultrasound image are calculated; Based on the Euclidean distances of all points in the contour to be processed to the center of the circumscribed circle of the contour of the previous ultrasound image and the radius of the circumscribed circle of the contour of the previous ultrasound image, the point set ratio of the contour to be processed within the circumscribed circle of the contour of the previous ultrasound image is calculated based on the following formula: In the formula, Ra is the point set ratio, n is the total number of pixel points in the contour to be processed, dis[t] represents the Euclidean distance from the tth pixel point in the contour to be processed to the center of the circumscribed circle of the contour of the last ultrasound image, R i-1 represents the radius of the circumscribed circle of the contour of the last ultrasound image, 1 ||判断式|| is an indicator function, and represents that if the judgment formula is established, the value of the indicator function is 1, and if the judgment formula is not established, the value of the indicator function is 0.
3. The method of claim 1, wherein, After all contours to be processed in an ultrasound image are processed, the following steps are further included: The width of each contour in the processed ultrasound image in the X-axis direction is calculated; If the width of a contour in the processed ultrasound image in the X-axis direction is greater than the reference width, the width of the contour in the X-axis direction is taken as a new reference width.
4. The method of claim 1, wherein, After all contours to be processed in an ultrasound image are processed, the following steps are further included: The minimum circumscribed circle of all contours in the processed ultrasound image is fitted to obtain the circumscribed circle of the contour of the processed ultrasound image; The center and radius of the circumscribed circle of the contour of the processed ultrasound image are determined; If the ratio of the radius of the circumscribed circle of the contour to the radius of the circumscribed circle of the contour of the previous ultrasound image is less than a preset radius threshold, the center and radius of the circumscribed circle of the contour of the previous ultrasound image are taken as the center and radius of the circumscribed circle of the contour of the processed ultrasound image.
5. The method of claim 1, wherein, The contour in the ultrasound image is obtained in the following manner: perform image segmentation on the ultrasound image based on a preset image segmentation model to obtain a mask image; perform contour searching on the mask image to obtain all contours in the ultrasound image.
6. The method of claim 5, wherein, After all contours in the ultrasound image are obtained, the method further includes: if one contour is completely surrounded by another contour, deleting the surrounded contour; and deleting a contour composed of a single pixel point.
7. A thyroid cross section segmentation result correction apparatus characterized by comprising: a thyroid cross section segmentation result correction unit configured to correct a thyroid cross section segmentation result based on a result of a thyroid cross section segmentation process. The method includes: an image acquisition module configured to acquire ultrasound images collected in real time by ultrasound robots performing transverse scanning of a thyroid isthmus as a starting point and a side of a thyroid according to a preset path; a reference confirmation module configured to, when only one contour exists in a plurality of continuous ultrasound images, take any one of the plurality of ultrasound images as a reference image, determine a width of the contour in the reference image in an X-axis direction as a reference width; a first calculation module configured to, for an ultrasound image collected after the plurality of ultrasound images, correct the ultrasound image by the following manner: for each contour to be processed in the ultrasound image, determining a width of the contour to be processed in the X-axis direction as a real-time width, and calculating a point set proportion of the contour to be processed located in a circumcircle of a contour in a previous ultrasound image; a first judgment module configured to, when the point set proportion is greater than a preset correct recognition threshold, retain the contour to be processed; a second judgment module configured to, when the point set proportion is less than a preset misrecognition threshold, delete the contour to be processed from all contours of the ultrasound image; a third judgment module configured to, when the point set proportion is greater than the preset misrecognition threshold and less than the preset correct recognition threshold, judge whether a ratio of the real-time width to the reference width is greater than a preset width threshold; if yes, retaining points of the contour to be processed located in the circumcircle of the contour in the previous ultrasound image to obtain a corresponding corrected contour to be processed; and if no, retaining the contour to be processed.
8. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the thyroid transverse segmentation result correction method of any one of claims 1-6.
9. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the thyroid transverse segmentation result correction method of any one of claims 1-6.
10. A computer device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the processor to perform the method of any one of claims 1-9. The processor executes the computer program to implement the thyroid transverse segmentation result correction method of any one of claims 1-6.
Citation Information
Patent Citations
Ultrasonic imaging system and ultrasonic image display method
CN118557219A
Thyroid region segmentation method and system based on CT image
CN118864504A