A fetal heart ultrasound image optimization segmentation method, device and electronic equipment

By constructing a fetal cardiac ultrasound image database and an adaptive edge search algorithm, the problem of difficulty in identifying the center of the fetal cardiac ultrasound image is solved, and high-precision segmentation and diagnostic support are achieved.

CN119027436BActive Publication Date: 2024-12-20NANJING DASHU FUTURE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411497855.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2024-12-20
Estimated Expiration
2044-10-25

AI Technical Summary

Technical Problem

The precise identification of the center and gut edge of fetal heart ultrasound images is affected by spot noise and artifacts, which leads to a decrease in the effectiveness of traditional segmentation techniques, which in turn affects the formulation of diagnostic and treatment strategies.

Method used

A database containing ultrasound segmentation images of fetal hearts at different developmental stages was constructed, and the adaptive search method and Dijkstra algorithm were used to find the edge path of the heart on the weight graph, and the B-spline curve was smoothed to accurately segment the heart area.

Benefits of technology

It improves the recognition accuracy and segmentation efficiency of the heart edge, reduces manual intervention, provides more accurate cardiac profile data, adapts to the variability of heart morphology, and enhances clinical diagnostic support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027436B_ABST
    Figure CN119027436B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and electronic device for optimizing the segmentation of fetal heart ultrasound images, and relates to the technical field of medical image segmentation. The method for optimizing the segmentation of fetal heart ultrasound images includes the following steps: obtaining fetal heart ultrasound segmentation images at different developmental stages in history and constructing a segmentation image database; obtaining a new fetal heart ultrasound image, and finding the heart edge path of the new fetal heart ultrasound image based on the segmentation image database and using an adaptive search method; segmenting and smoothing the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain the new fetal heart ultrasound segmentation image. The present invention can reduce manual intervention, not only improve the accuracy and efficiency of segmentation, but also be able to cope with complex heart structures, and provide reliable data support for clinicians.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image segmentation, and in particular to a method, device and electronic equipment for optimizing the segmentation of fetal heart ultrasound images. Background Art

[0002] Congenital heart disease is the disease with the highest morbidity rate among newborns and poses a serious threat to the health of the fetus. In prenatal ultrasound examinations, doctors rely on ultrasound images to carefully observe the status of the fetal ventricles, atria, and cusps as an important means of screening for congenital heart disease. However, accurate interpretation of ultrasound images is a difficult task for doctors. Accurate segmentation of the fetal heart area in ultrasound images is crucial for doctors to quickly locate, identify, and measure the heart area, which helps improve the accuracy and efficiency of diagnosis. However, since two-dimensional ultrasound images are often interfered by speckle noise, strong artifacts, and differences in shooting angles of the heart area, segmenting the fetal heart becomes an extremely challenging task. Therefore, it is particularly urgent and important to develop more advanced image processing techniques to meet these challenges.

[0003] Currently, accurate identification of the heart edge in fetal heart ultrasound image analysis faces severe challenges. Speckle noise and artifacts are prevalent, causing blurred edges, which seriously affects the effectiveness of traditional segmentation techniques. These techniques are unable to handle complex or low-contrast boundaries, resulting in reduced segmentation accuracy, which in turn has an adverse impact on clinical diagnosis and treatment strategy formulation.

[0004] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention

[0005] In view of this, the present invention provides a method, device and electronic device for optimizing segmentation of fetal heart ultrasound images to solve the above-mentioned problems.

[0006] In order to solve the above problems, the specific technical solutions adopted by the present invention are as follows:

[0007] According to one aspect of the present invention, a method for optimizing segmentation of fetal heart ultrasound images is provided, and the method for optimizing segmentation of fetal heart ultrasound images comprises the following steps:

[0008] S1. Obtain ultrasound segmented images of fetal hearts at different developmental stages in history and construct a segmented image database;

[0009] S2, acquiring a new fetal heart ultrasound image, and finding a heart edge path of the new fetal heart ultrasound image based on a segmented image database and using an adaptive search method;

[0010] S3, performing segmentation and smoothing processing on the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain a new fetal heart ultrasound segmentation image;

[0011] Preferably, obtaining a new fetal heart ultrasound image, and finding the heart edge path of the new fetal heart ultrasound image based on the segmented image database and using an adaptive search method comprises the following steps:

[0012] S21, obtaining the developmental stage of the new fetal heart ultrasound image, and selecting a segmented image of the same developmental stage from a segmented image database as a reference image;

[0013] S22, performing threshold processing and morphological filtering on the reference image, and extracting the initial region contour of the reference image;

[0014] S23, constructing a weight map of the new fetal heart ultrasound image based on the new fetal heart ultrasound image;

[0015] S24. Based on the weight map of the new fetal heart ultrasound image and the initial region contour of the reference image, the Dijkstra algorithm is used to find the heart edge path on the weight map.

[0016] Preferably, obtaining ultrasound segmented images of the fetal heart at different developmental stages in history and constructing a segmented image database comprises the following steps:

[0017] S11. Collect ultrasound images of the fetal heart at different developmental stages;

[0018] S12, marking the fetal heart contour on fetal heart ultrasound images at different developmental stages;

[0019] S13, segmenting the fetal heart ultrasound images at different developmental stages according to the fetal heart contour labeling result to obtain the fetal heart ultrasound segmentation images;

[0020] S14, classifying and storing the obtained fetal heart ultrasound segmented images according to the developmental stages, and constructing a segmented image database.

[0021] Preferably, performing threshold processing and morphological filtering on the reference image and extracting the initial region contour of the reference image comprises the following steps:

[0022] S221, performing threshold processing on the reference image using the Otsu threshold method to obtain a binary image;

[0023] S222, performing morphological closing operation and opening operation processing on the obtained binary image respectively;

[0024] S223. Based on the processed binary image, an edge detection algorithm is used to extract the initial area contour of the fetal heart in the reference image.

[0025] Preferably, constructing a weight map of a new fetal heart ultrasound image based on the new fetal heart ultrasound image comprises the following steps:

[0026] S231, respectively calculating the gradient of each pixel point of the new fetal heart ultrasound image in the X and Y directions based on the Sobel operator;

[0027] S232, calculating the gradient magnitude and gradient direction of each pixel point according to the gradient of each pixel point in the X and Y directions respectively;

[0028] S233, using the Laplace operator to identify the zero-crossing point of the grayscale change of the new fetal heart ultrasound image, and obtaining the Laplace zero-crossing point;

[0029] S234, calculating the local cost of each pixel to the adjacent pixel based on the gradient magnitude, gradient direction and Laplace zero-crossing point, and constructing a weight map.

[0030] Preferably, the calculation formula for calculating the local cost of each pixel to the adjacent pixel based on the gradient amplitude, gradient direction and Laplace zero crossing point is:

[0031] T(r,t)=ω Z ×f Z (t)+ω D ×f D (r,t)+ω G ×f G (t);

[0032] Where T(r,t) represents the local cost from pixel r to its adjacent pixel t;

[0033] f Z (t) represents the Laplace zero-crossing cost;

[0034] f D (r, t) represents the gradient direction cost from pixel r to its adjacent pixel t;

[0035] f G (t) represents the gradient of pixel t in the X and Y directions;

[0036] ω Z ,ω D and G They represent the circle coefficients of the Laplace zero crossing, gradient direction, and gradient direction cost respectively.

[0037] Preferably, based on the weight map of the new fetal heart ultrasound image and the initial region contour of the reference image, searching for the heart edge path on the weight map using the Dijkstra algorithm comprises the following steps:

[0038] S241, randomly selecting a path point from the initial area contour of the reference image as a seed point, and selecting a path point from a preset neighborhood of the seed point as a free point;

[0039] S242, locating nodes corresponding to the seed points and the free points on the weight graph of the new fetal heart ultrasound image;

[0040] S243, based on the Dijkstra algorithm, starting from the node corresponding to the seed point, searching on the weight graph for the shortest path to the node corresponding to the free point;

[0041] S244, adding the found shortest path to the current heart edge contour, and updating the contour information;

[0042] S245. Repeat steps S241 to S244 to continuously update the heart edge contour until the heart edge contour no longer increases, thereby obtaining the heart edge path.

[0043] Preferably, based on the Dijkstra algorithm, starting from the node corresponding to the seed point, searching the shortest path to the node corresponding to the free point on the weight graph includes the following steps:

[0044] S2431, taking the node corresponding to the seed point as the starting point, setting the distances of all other nodes in the weight graph to infinity and creating a priority queue for storing all nodes;

[0045] S2432, adding the starting point to the priority queue, and sorting them according to the distance from the node to the starting point;

[0046] S2433, taking out the node with the smallest distance from the priority queue as the current node, and traversing all its neighboring nodes;

[0047] S2434. For each neighbor node, if the distance from the current node to the neighbor node is less than the previously recorded distance, the distance of the neighbor node is updated, and its position in the priority queue is updated.

[0048] Preferably, performing segmentation and smoothing processing on the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain the new fetal heart ultrasound segmented image includes the following steps:

[0049] S31, extracting edge points of the heart according to the heart edge path of the new fetal heart ultrasound image to obtain an edge point set;

[0050] S32, selecting control points from the edge point set, and using a B-spline curve to perform shape-preserving interpolation to construct a smooth curve passing through all the control points;

[0051] S33, using the constructed smooth curve as the contour of the new fetal heart, and segmenting the new fetal heart ultrasound image according to the contour of the new fetal heart to obtain a new fetal heart ultrasound segmentation image.

[0052] According to another aspect of the present invention, a fetal heart ultrasound image optimization segmentation device is provided, the fetal heart ultrasound image optimization segmentation device comprising: a segmentation image database construction module, a heart edge path search module and a fetal ultrasound heart image segmentation module;

[0053] A segmentation image database construction module is used to obtain ultrasound segmentation images of fetal hearts at different historical developmental stages and construct a segmentation image database;

[0054] A heart edge path finding module is used to obtain a new fetal heart ultrasound image and find the heart edge path of the new fetal heart ultrasound image based on a segmented image database and using an adaptive finding method;

[0055] The fetal ultrasonic heart image segmentation module is used to perform segmentation and smoothing processing on the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain a new fetal heart ultrasound segmented image.

[0056] According to another aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the above-mentioned method for optimizing segmentation of fetal heart ultrasound images when executing the program.

[0057] The beneficial effects of the present invention are:

[0058] 1. The present invention constructs a database containing ultrasound segmented images of fetal hearts at different developmental stages. The method can provide rich reference information for new images. Such historical data enables the algorithm to more accurately identify and segment the heart edges in new images, especially in cases where the heart structure is complex or the image quality is poor. By automatically selecting the most matching reference image and applying the corresponding segmentation algorithm, manual intervention can be reduced, which not only improves the accuracy and efficiency of segmentation, but also can cope with complex heart structures, providing reliable data support for clinicians.

[0059] 2. The accuracy of new image segmentation is improved by comparing historical segmented images that match the developmental stage. This comparison method based on similar developmental stages makes edge detection more accurate, especially in the fetal stage where the heart morphology is changeable. Automated image processing and edge detection reduce the need for manual operation, speed up processing, and improve the ability to process large amounts of image data. By using the Dijkstra algorithm to search for the optimal path on the weight map, it is ensured that the edge path found is optimal in the sense of minimizing local cost, thereby more accurately depicting the heart edge. By calculating the gradient amplitude, gradient direction, and Laplace zero-crossing point of the pixel, the weight map gives each pixel a cost value that integrates multiple factors, so that the search for the edge path is more in line with the characteristics of the actual image.

[0060] 3. The present invention can accurately define the actual contour of the heart by extracting a specific set of edge points from the edge path, providing detailed basic data for subsequent operations, and interpolating the edge points using B-spline curves to generate a smooth and continuous heart contour. B-spline curves are a standard method for approximating curves and surfaces in mathematics, with good shape-preserving properties, which can maintain the natural form of image features and avoid shape distortion introduced by interpolation. The image is finally segmented using accurate and smooth contours, and the resulting new fetal heart ultrasound segmentation image will be closer to the actual heart structure, which is crucial for subsequent analysis such as cardiac function assessment and lesion detection. The heart may show a variety of morphological variations in different fetal and developmental stages. Flexible B-spline curve adjustment can effectively adapt to these changes and provide a customized segmentation solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0062] Figure 1 is a flow chart of a method for optimizing segmentation of fetal heart ultrasound images according to an embodiment of the present invention;

[0063] Figure 2 The invention is a principle block diagram of a fetal heart ultrasound image optimization segmentation device according to an embodiment of the present invention.

[0064] In the figure:

[0065] 1. Segmentation image database construction module; 2. Heart edge path finding module; 3. Fetal ultrasound heart image segmentation module. DETAILED DESCRIPTION

[0066] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0067] According to an embodiment of the present invention, a method, device and electronic device for optimizing segmentation of fetal heart ultrasound images are provided.

[0068] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to one embodiment of the present invention, a method for optimizing segmentation of fetal heart ultrasound images is provided, and the method for optimizing segmentation of fetal heart ultrasound images comprises the following steps:

[0069] S1. Obtain ultrasound segmented images of fetal hearts at different developmental stages in history and construct a segmented image database;

[0070] As a preferred embodiment, obtaining ultrasound segmented images of fetal hearts at different historical developmental stages and constructing a segmented image database includes the following steps:

[0071] S11. Collect fetal cardiac ultrasound images at different developmental stages;

[0072] It should be noted that the specific time point for collecting ultrasound images can be determined by selecting pregnant women as the collection object, and then according to the developmental stage of the fetus. Generally speaking, fetal cardiac ultrasound examination is best performed in the second trimester (18-26 weeks) because the fetal heart structure is most clearly displayed during this period. However, in order to collect images at different developmental stages, multiple time points can be selected between the first trimester (such as 12 weeks) and the third trimester (such as 32 weeks) for collection. Use a high-quality color Doppler ultrasound diagnostic instrument to collect fetal cardiac ultrasound images at different developmental stages.

[0073] S12, marking the fetal heart contour on fetal heart ultrasound images at different developmental stages;

[0074] Specifically, labeling the fetal heart contour of fetal heart ultrasound images at different developmental stages includes the following steps:

[0075] Preprocess the ultrasound images, including noise removal and contrast enhancement, to improve image quality and make the heart contour clearer;

[0076] The heart's edge outline is manually drawn by a medical professional or trained technician using an image annotation tool;

[0077] After the annotation is completed, the annotated heart contour is reviewed to ensure the accuracy and consistency of the annotation. Specifically, multiple experts independently annotate the same image, then compare and discuss the differences, and finally determine the annotation results, which include the coordinate points of the heart contour.

[0078] S13, segmenting the fetal heart ultrasound images at different developmental stages according to the fetal heart contour labeling result to obtain the fetal heart ultrasound segmentation images;

[0079] It should be noted that, according to the fetal heart contour labeling result, the fetal heart ultrasound images at different developmental stages are cut to obtain the fetal heart ultrasound segmentation images, which includes the following steps:

[0080] Use the coordinate points in the labeled data to generate a binary mask, where the labeled heart area is 1 (or any non-zero value) and other areas are 0;

[0081] The original ultrasound image is cut using the mask, which is done by element-wise multiplication of the mask and the original image, so that only the heart area is retained and the other parts are set to the background (usually black or zero value);

[0082] The cut edges are smoothed and the processed images are saved as new files. At the same time, for ease of management and use, they are classified and named according to developmental stages or other relevant attributes.

[0083] S14, classifying and storing the obtained fetal heart ultrasound segmented images according to the developmental stages, and constructing a segmented image database.

[0084] For example, by creating a segmented image database containing ultrasound segmented images of fetal hearts at different developmental stages.

[0085] Store the segmented images for each stage in corresponding folders in the database, such as "First Trimester", "Second Trimester", and "Third Trimester".

[0086] Each segmented image is assigned a unique identifier and related metadata such as the maternal age, gestational age, examination date, etc. are recorded.

[0087] Build a user-friendly interface to facilitate researchers and doctors to browse, search and download the required segmentation images.

[0088] S2, acquiring a new fetal heart ultrasound image, and finding a heart edge path of the new fetal heart ultrasound image based on a segmented image database and using an adaptive search method;

[0089] As a preferred embodiment, obtaining a new fetal heart ultrasound image, and finding the heart edge path of the new fetal heart ultrasound image based on the segmented image database and using an adaptive search method include the following steps:

[0090] S21, obtaining the developmental stage of the new fetal heart ultrasound image, and selecting a segmented image of the same developmental stage from a segmented image database as a reference image;

[0091] It should be noted that the developmental stage of the new fetal heart ultrasound image is determined by combining the standard fetal development stage division. For example, if the pregnant woman's gestational age is 20 weeks, then the image belongs to the second trimester. Access the previously constructed segmented image database, and find the segmented image of the same developmental stage as the new fetal heart ultrasound image in the segmented image database. For example, if the new image belongs to the second trimester, then the segmented image that also belongs to the second trimester should be selected from the database.

[0092] S22, performing threshold processing and morphological filtering on the reference image, and extracting the initial region contour of the reference image;

[0093] As a preferred implementation, performing threshold processing and morphological filtering on the reference image and extracting the initial region contour of the reference image includes the following steps:

[0094] S221, performing threshold processing on the reference image using the Otsu threshold method to obtain a binary image;

[0095] It should be noted that the Otsu threshold method, also known as the Otsu algorithm or the maximum inter-class variance method, is an automatic threshold segmentation technique widely used in image processing. It aims to automatically select the best global threshold based on the grayscale histogram of the image, thereby dividing the image into foreground and background.

[0096] Specifically, the Otsu threshold method is used to perform threshold processing on the reference image to obtain a binary image, which includes the following steps:

[0097] Step 1: Calculate the grayscale histogram of the reference image. The grayscale histogram represents the frequency of each gray level in the image.

[0098] Step 2: Select the average grayscale of the image as the initial threshold, and use the current threshold to divide the image into two parts: one part contains all pixels with grayscale values ​​greater than or equal to the threshold, and the other part contains all pixels with grayscale values ​​less than the threshold;

[0099] Step 3: Calculate the grayscale mean and variance of the two parts of pixels respectively. The grayscale mean represents the average grayscale level of the pixels in the part, while the variance represents the discrete degree of the grayscale of the pixels in the part.

[0100] Step 4: Calculate the inter-class variance between the two parts of pixels respectively, and use the gray value that maximizes the inter-class variance as the new threshold;

[0101] Step 5: Repeat steps 3 to 4 using the new threshold until the threshold no longer changes or the predetermined number of iterations is reached.

[0102] Step 6. Use the final threshold to convert the reference image into a binary image. All pixels with grayscale values ​​greater than or equal to the threshold are set to white (or 1), and all pixels with grayscale values ​​less than the threshold are set to black (or 0).

[0103] For example, suppose there is a simple grayscale image whose grayscale histogram is mainly concentrated in two gray levels: darker background and brighter foreground. The Otsu method will be used to find a suitable threshold to separate the foreground (heart area) from the background.

[0104] Step 1: Calculate the grayscale histogram: First, calculate the frequency of each grayscale level in the image. For example, from grayscale 0 to 255, count the number of pixels at each grayscale level.

[0105] Step 2: Select the initial threshold: Calculate the average grayscale value of the entire image and use this average value as the initial threshold. Assume that the average grayscale is 128.

[0106] Step 3: Divide the image into two parts and calculate statistics: Use a threshold of 128 to divide the image into two parts, where the high grayscale part contains all pixels with grayscale values ​​greater than or equal to 128, and the low grayscale part contains all pixels with grayscale values ​​less than 128.

[0107] Calculate the pixel grayscale mean and variance of these two parts respectively.

[0108] Step 4: Calculate the inter-class variance and update the threshold: Calculate the inter-class variance between the two parts. Select a new grayscale value to maximize the inter-class variance. Assume that the new threshold is 150.

[0109] Step 5: Iterative optimization: Repeat steps 3 and 4 using a new threshold of 150 until the threshold is stable (no longer changes) or the preset number of iterations is reached.

[0110] Step 6: Apply threshold and get binary image: After the threshold is finally determined, use this threshold to convert the image into a binary image. For example, all pixels with grayscale values ​​greater than or equal to 150 are set to 1 (white), and those less than 150 are set to 0 (black).

[0111] S222, performing morphological closing and opening operations on the obtained binary image respectively;

[0112] Specifically, the binary images were processed by morphological closing and opening operations. The closing operation aims to fill small holes in the image and maintain the general shape of the foreground area by first dilating and then corroding; while the opening operation removes small objects or noise in the image by first corroding and then dilating, while keeping the outline of the foreground area clear. Both morphological processing methods help improve the accuracy and effect of subsequent heart edge contour extraction.

[0113] S223. Based on the processed binary image, an edge detection algorithm is used to extract the initial area contour of the fetal heart in the reference image.

[0114] It should be noted that edge detection algorithms (such as the Canny algorithm, the Laplacian algorithm, etc.) can be used to identify areas in an image where grayscale changes are obvious, namely, edges.

[0115] The edge detection algorithm determines edge pixels based on the grayscale changes of pixels. In a binary image, edge pixels are usually transition points from white to black or from black to white. The detected edge pixels are connected to form the initial regional outline of the fetal heart.

[0116] S23, constructing a weight map of the new fetal heart ultrasound image based on the new fetal heart ultrasound image;

[0117] As a preferred embodiment, constructing a weight map of a new fetal heart ultrasound image based on the new fetal heart ultrasound image includes the following steps:

[0118] S231, respectively calculating the gradient of each pixel point of the new fetal heart ultrasound image in the X and Y directions based on the Sobel operator;

[0119] It should be noted that the Sobel operator is a set of 3x3 convolution kernels for edge detection. For gradient detection in the X direction (horizontal direction), the Gx convolution kernel is used; for gradient detection in the Y direction (vertical direction), the Gy convolution kernel is used.

[0120] Convolution operations are performed on each pixel in the new fetal heart ultrasound image and its surrounding pixels using the Gx and Gy convolution kernels, respectively. The essence of convolution operations is to multiply the convolution kernel with the pixel value at the corresponding position in the image and add the results to obtain a new pixel value. For each pixel in the image, the convolution result obtained by the Gx convolution kernel is the gradient of the pixel in the X direction, and the convolution result obtained by the Gy convolution kernel is the gradient of the pixel in the Y direction.

[0121] S232, calculating the gradient magnitude and gradient direction of each pixel point according to the gradient of each pixel point in the X and Y directions respectively;

[0122] It should be noted that the gradient amplitude indicates the intensity of the grayscale change of the pixel. For each pixel in the image, its gradient amplitude can be calculated by the square root of the sum of the squares of the X-direction gradient and the Y-direction gradient; the gradient direction indicates the main direction of the grayscale change of the pixel. For each pixel in the image, its gradient direction can be calculated by the inverse tangent function of the X-direction gradient and the Y-direction gradient.

[0123] S233, using the Laplace operator to identify the zero-crossing point of the grayscale change of the new fetal heart ultrasound image, and obtaining the Laplace zero-crossing point;

[0124] Specifically, the Laplacian operator is a second-order differential operator used to identify the zero-crossing point of the second-order derivative of the grayscale change in the image. In a two-dimensional image, the commonly used Laplacian operator can be represented as a 3x3 convolution kernel.

[0125] The Laplace operator is convolved with each pixel in the new fetal heart ultrasound image and its surrounding pixels. The essence of the convolution operation is to multiply the convolution kernel with the pixel value at the corresponding position in the image and add the results to obtain a new pixel value. This new pixel value represents the second-order derivative of the grayscale change of the original image at that point.

[0126] After the convolution operation, a new image of the same size as the original image is obtained, in which each pixel value represents the second-order derivative of the grayscale change at the corresponding position in the original image. Next, it is necessary to identify the zero-crossing points in this new image. Zero-crossing points are those pixels where the sign of the second-order derivative changes, that is, from a positive value to a negative value, or from a negative value to a positive value. These points usually correspond to the edges or contours of the grayscale changes in the image.

[0127] By identifying the zero-crossing points in the new image, a set of Laplace zero-crossing points can be obtained. These zero-crossing points roughly outline the edge or contour position of the grayscale change in the new fetal heart ultrasound image.

[0128] S234, calculating the local cost of each pixel to the adjacent pixel based on the gradient magnitude, gradient direction and Laplace zero-crossing point, and constructing a weight map.

[0129] It should be noted that for each pixel t, if it is a Laplace zero-crossing point, then f Z (t) can be set to a low value (such as 0 or a value close to 0), indicating that the point may be part of an edge and therefore has a low cost with neighboring pixels. If it is not a zero crossing point, then f Z (t) can be set to a higher value (such as 1 or a value close to 1), indicating that the cost between the point and its neighboring pixels is higher.

[0130] For pixel r and its adjacent pixel t, calculate the difference in gradient direction between them. If the gradient directions are similar (i.e., the difference is small), then f D (r, t) can be set to a lower value, indicating that the cost between the two pixels is low. If the gradient direction difference is large, then f D (r,t) can be set to a higher value, indicating that the cost between these two pixels is higher.

[0131] Based on the calculated local cost T(r, t), a weight graph can be constructed. In this graph, each pixel is connected to its adjacent pixel through a weighted edge. The size of the weight is the local cost T(r, t), which reflects the degree of similarity or difference between adjacent pixels.

[0132] As a preferred implementation, the calculation formula for calculating the local cost of each pixel to the adjacent pixel based on the gradient amplitude, gradient direction and Laplace zero crossing point is:

[0133] T(r,t)=ω Z ×f Z (t)+ω D ×f D (r,t)+ω G ×f G (t);

[0134] Where T(r,t) represents the local cost from pixel r to its adjacent pixel t;

[0135] f Z (t) represents the Laplace zero-crossing cost;

[0136] f D (r, t) represents the gradient direction cost from pixel r to its adjacent pixel t;

[0137] f G (t) represents the gradient of pixel t in the X and Y directions;

[0138] ω Z ,ω D and G They represent the circle coefficients of the Laplace zero crossing, gradient direction, and gradient direction cost respectively.

[0139] S24. Based on the weight map of the new fetal heart ultrasound image and the initial region contour of the reference image, the Dijkstra algorithm is used to find the heart edge path on the weight map.

[0140] It should be noted that the Dijkstra algorithm, also known as the Dijkstra algorithm or Dijkstra algorithm, is an algorithm for finding the shortest path between nodes in a graph. The algorithm is mainly used to solve the single-source shortest path problem of weighted directed or undirected graphs, that is, to find the shortest path from a source node to all other nodes in the graph.

[0141] As a preferred embodiment, based on the weight map of the new fetal heart ultrasound image and the initial region contour of the reference image, searching for the heart edge path on the weight map using the Dijkstra algorithm includes the following steps:

[0142] S241, randomly selecting a path point from the initial area contour of the reference image as a seed point, and selecting a path point from a preset neighborhood of the seed point as a free point;

[0143] It should be noted that, on the initial area contour of this reference image, a path point is randomly selected as a seed point. This seed point will serve as the starting point for searching the heart edge path. For the selected seed point, a preset neighborhood range is defined. This neighborhood range can be a circular, square or other shaped area centered on the seed point. The size of the neighborhood can be adjusted according to the specific application scenario and image characteristics. A larger neighborhood may contain more potential path points, but it may also increase the computational complexity. Within the determined preset neighborhood, a path point is randomly selected again as a free point. This free point will serve as the end point for searching the heart edge path (in the current iteration). The purpose of selecting a free point is to find the shortest path starting from the seed point, passing through a series of path points, and finally reaching the free point. This shortest path will be used as part of the heart edge.

[0144] S242, locating nodes corresponding to the seed points and the free points on the weight graph of the new fetal heart ultrasound image;

[0145] It should be noted that the weight graph is a graphical representation in which each pixel or node is connected to its adjacent pixels or nodes through weighted edges. The weight reflects the similarity or difference between adjacent pixels and is usually calculated based on pixel grayscale value, gradient magnitude, gradient direction or Laplace zero crossing.

[0146] Seed points and free points are randomly selected path points on the initial region contour of the reference image. The seed point is used as the starting point for searching the heart edge path, while the free point is used as the end point in the current iteration.

[0147] In order to locate the nodes corresponding to the seed points and the free points on the weight map, the coordinates of these two points in the reference image are mapped to the new fetal heart ultrasound image. This usually involves a coordinate transformation process because the reference image and the new fetal heart ultrasound image may have different sizes, resolutions or orientations. Once the coordinates of the seed points and the free points on the new fetal heart ultrasound image are determined, the corresponding nodes can be found on the weight map.

[0148] S243, based on the Dijkstra algorithm, starting from the node corresponding to the seed point, searching on the weight graph for the shortest path to the node corresponding to the free point;

[0149] As a preferred implementation, based on the Dijkstra algorithm, starting from the node corresponding to the seed point, searching the shortest path to the node corresponding to the free point on the weight graph includes the following steps:

[0150] S2431, taking the node corresponding to the seed point as the starting point, setting the distances of all other nodes in the weight graph to infinity and creating a priority queue for storing all nodes;

[0151] It should be noted that the node corresponding to the seed point is used as the starting point, which is the starting position of the search. The distances of all other nodes in the weight graph are set to infinity, indicating that their initial distances to the starting point are unknown or unreachable. Create a priority queue to store all nodes and sort them according to the distance from the node to the starting point. In this way, the head of the queue is always the node closest to the starting point.

[0152] S2432, adding the starting point to the priority queue, and sorting them according to the distance from the node to the starting point;

[0153] It should be noted that the starting point is added to the priority queue as an element. When adding, it is necessary to ensure that the priority queue can be sorted according to the distance from the node to the starting point. A sorting mechanism is used inside the priority queue to ensure that the node closest to the starting point is taken out each time. This is usually achieved by comparing the distance from the node to the starting point. The node with a smaller distance has a higher priority. Once the starting point is added to the priority queue, the algorithm can start iterating. In each iteration, the algorithm will take out the node closest to the starting point from the priority queue and update the distance and priority of its neighbor nodes.

[0154] S2433, taking out the node with the smallest distance from the priority queue as the current node, and traversing all its neighboring nodes;

[0155] It should be noted that the head (or top) of the priority queue is always the node with the shortest distance to the starting point, because this is determined by the sorting mechanism of the priority queue. Take the node with the shortest distance from the priority queue and process it as the current node. The current node may have a series of adjacent nodes in the weight graph, which are called neighbor nodes. Traverse all neighbor nodes of the current node and find possible paths to reach these neighbor nodes through the current node.

[0156] S2434. For each neighbor node, if the distance from the current node to the neighbor node is less than the previously recorded distance, the distance of the neighbor node is updated, and its position in the priority queue is updated.

[0157] It should be noted that for each neighbor node, the total distance from the starting point to the neighbor node via the current node must first be calculated. This newly calculated distance is compared with the previously recorded distance for the neighbor node. If the newly calculated distance is shorter, the distance record of the neighbor node is updated and set to the shorter distance.

[0158] After updating the distance of the neighbor node, you also need to adjust the sorting position of the node in the priority queue. This is because the priority queue is sorted according to the distance from the node to the starting point. Updating the position of the node in the priority queue can ensure that the queue is always sorted correctly, so that the node closest to the starting point is always at the front of the queue.

[0159] S244, adding the found shortest path to the current heart edge contour, and updating the contour information;

[0160] S245. Repeat steps S241 to S244 to continuously update the heart edge contour until the heart edge contour no longer increases, thereby obtaining the heart edge path.

[0161] S3, performing segmentation and smoothing processing on the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain a new fetal heart ultrasound segmentation image;

[0162] As a preferred implementation, segmenting and smoothing the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain the new fetal heart ultrasound segmented image includes the following steps:

[0163] S31, extracting edge points of the heart according to the heart edge path of the new fetal heart ultrasound image to obtain an edge point set;

[0164] It should be noted that the heart edge path refers to the trajectory of the heart edge in the ultrasound image. Common methods for extracting heart edge points include gradient-based edge detection (such as Sobel operator, Canny edge detector), template matching-based edge detection, active contour model-based edge detection, etc. It can analyze each pixel in the image and determine whether it is an edge point based on the changes in the pixel values ​​around it.

[0165] S32, selecting control points from the edge point set, and using a B-spline curve to perform shape-preserving interpolation to construct a smooth curve passing through all the control points;

[0166] It should be noted that from the edge point set, a part of the points are selected as control points according to certain criteria (such as uniform distribution, maximum curvature point, feature point, etc.). The number of control points should be moderate, which should be able to accurately reflect the shape of the heart edge, but also avoid too many points that lead to complex calculations. B-spline curve is a curve used for interpolation and approximation. It has conformal properties, that is, it can maintain the shape characteristics between control points. The definition of B-spline curve depends on a set of control points and a parameter called "node vector".

[0167] Specifically, the control points are selected from the edge point set, and the shape-preserving interpolation is performed using the B-spline curve to construct a smooth curve passing through all the control points, including the following steps:

[0168] According to the number and distribution of control points, determine a suitable node vector. The choice of node vector will affect the shape and smoothness of the B-spline curve.

[0169] The interpolation algorithm of the B-spline curve is used to calculate the B-spline curve passing through all the control points according to the control points and the node vectors. During the interpolation process, it is ensured that the curve has the required continuity and smoothness at the control points.

[0170] The control points, node vectors or interpolation algorithms are adjusted to optimize the shape and smoothness of the curve. Finally, a smooth B-spline curve passing through all control points is output, which will serve as the outline of the new fetal heart.

[0171] S33, using the constructed smooth curve as the contour of the new fetal heart, and segmenting the new fetal heart ultrasound image according to the contour of the new fetal heart to obtain a new fetal heart ultrasound segmentation image.

[0172] Specifically, the previously constructed smooth B-spline curve is determined as the outline of the new fetal heart, and the region-based segmentation method is applied to the new fetal heart ultrasound image, using the heart outline as a guide. The region-based segmentation method separates the heart region from other regions in the image based on the shape and position of the outline. A new fetal heart ultrasound segmentation image is generated, which only contains the heart region, while other regions are removed or marked as background.

[0173] like Figure 2 As shown, according to another embodiment of the present invention, a fetal heart ultrasound image optimization segmentation device is provided, the fetal heart ultrasound image optimization segmentation device comprises: a segmentation image database construction module 1, a heart edge path search module 2 and a fetal ultrasound heart image segmentation module 3;

[0174] The segmented image database construction module 1 is used to obtain ultrasound segmented images of the fetal heart at different historical developmental stages and construct a segmented image database;

[0175] A heart edge path finding module 2 is used to obtain a new fetal heart ultrasound image, and find the heart edge path of the new fetal heart ultrasound image based on the segmented image database and using an adaptive finding method;

[0176] The fetal ultrasound heart image segmentation module 3 is used to perform segmentation and smoothing processing on the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain a new fetal heart ultrasound segmented image.

[0177] According to another embodiment of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the program, the method for optimizing segmentation of fetal heart ultrasound images as described above is implemented.

[0178] In summary, with the help of the above-mentioned technical scheme of the present invention, the present invention constructs a database containing ultrasound segmentation images of the fetal heart at different developmental stages. The method can provide rich reference information for new images. Such historical data enables the algorithm to more accurately identify and segment the heart edges in new images, especially in cases where the heart structure is complex or the image quality is poor. By automatically selecting the most matching reference image and applying the corresponding segmentation algorithm, manual intervention can be reduced, which not only improves the accuracy and efficiency of the segmentation, but also can cope with complex heart structures, providing reliable data support for clinicians. The present invention improves the accuracy of new image segmentation by comparing historical segmentation images that match the developmental stage. This comparison method based on similar developmental stages makes edge detection more accurate, especially in the fetal stage where the heart morphology is changeable. Through automated image processing and edge detection, the need for manual operation is reduced, the processing speed is accelerated, and the ability to process large amounts of image data is improved. By using the Dijkstra algorithm to search for the optimal path on a weight map, it is ensured that the edge path found is optimal in the sense of minimizing the local cost, thereby more accurately depicting the heart edge. By calculating the gradient amplitude, gradient direction and Laplace zero-crossing point of the pixel, the weight map assigns a cost value that integrates multiple factors to each pixel, so that the search for the edge path is more in line with the characteristics of the actual image. The present invention can accurately define the actual contour of the heart by extracting a specific set of edge points from the edge path, providing detailed basic data for subsequent operations, and generating a smooth and continuous heart contour by interpolating the edge points using B-spline curves. B-spline curves are a standard method for approximating curves and surfaces in mathematics, and have good shape-preserving properties. They can maintain the natural form of image features and avoid shape distortion introduced by interpolation. The image is finally segmented using accurate and smooth contours, and the resulting new fetal heart ultrasound segmentation image will be closer to the actual heart structure, which is crucial for subsequent analysis such as cardiac function assessment and lesion detection. The heart may show a variety of morphological variations in different fetal and developmental stages. Flexible B-spline curve adjustment can effectively adapt to these changes and provide a customized segmentation solution.

[0179] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.

[0180] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A fetal heart ultrasound image optimization segmentation method, characterized in that: The fetal heart ultrasound image optimization segmentation method comprises the following steps: S1. Obtain ultrasound segmented images of fetal hearts at different developmental stages in history and construct a segmented image database; S2, acquiring a new fetal heart ultrasound image, and finding a heart edge path of the new fetal heart ultrasound image based on a segmented image database and using an adaptive search method; S3, performing segmentation and smoothing processing on the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain a new fetal heart ultrasound segmentation image; The method of acquiring a new fetal heart ultrasound image and finding the heart edge path of the new fetal heart ultrasound image based on the segmented image database and using an adaptive search method comprises the following steps: S21, obtaining the developmental stage of the new fetal heart ultrasound image, and selecting a segmented image of the same developmental stage from a segmented image database as a reference image; S22, performing threshold processing and morphological filtering on the reference image, and extracting the initial region contour of the reference image; S23, constructing a weight map of the new fetal heart ultrasound image based on the new fetal heart ultrasound image; S24, based on the weight map of the new fetal heart ultrasound image and the initial region contour of the reference image, using the Dijkstra algorithm to find the heart edge path on the weight map; The method of searching for the heart edge path on the weight map based on the weight map of the new fetal heart ultrasound image and the initial region contour of the reference image by using the Dijkstra algorithm comprises the following steps: S241, randomly selecting a path point from the initial area contour of the reference image as a seed point, and selecting a path point from a preset neighborhood of the seed point as a free point; S242, locating nodes corresponding to the seed points and the free points on the weight graph of the new fetal heart ultrasound image; S243, based on the Dijkstra algorithm, starting from the node corresponding to the seed point, searching on the weight graph for the shortest path to the node corresponding to the free point; S244, adding the found shortest path to the current heart edge contour, and updating the contour information; S245. Repeat steps S241 to S244 to continuously update the heart edge contour until the heart edge contour no longer increases, thereby obtaining the heart edge path.

2. The method for optimizing segmentation of fetal heart ultrasound images according to claim 1, characterized in that: The method of obtaining ultrasound segmented images of the fetal heart at different developmental stages in history and constructing a segmented image database comprises the following steps: S11. Collect ultrasound images of the fetal heart at different developmental stages; S12, marking the fetal heart contour on fetal heart ultrasound images at different developmental stages; S13, segmenting the fetal heart ultrasound images at different developmental stages according to the fetal heart contour labeling result to obtain the fetal heart ultrasound segmentation images; S14, classifying and storing the obtained fetal heart ultrasound segmented images according to the developmental stages, and constructing a segmented image database.

3. The method for optimizing segmentation of fetal heart ultrasound images according to claim 1, characterized in that: The step of performing threshold processing and morphological filtering on the reference image and extracting the initial region contour of the reference image comprises the following steps: S221, performing threshold processing on the reference image using the Otsu threshold method to obtain a binary image; S222, performing morphological closing operation and opening operation processing on the obtained binary image respectively; S223. Based on the processed binary image, an edge detection algorithm is used to extract the initial area contour of the fetal heart in the reference image.

4. The method for optimizing segmentation of fetal heart ultrasound images according to claim 1, characterized in that: The step of constructing a weight map of a new fetal heart ultrasound image based on the new fetal heart ultrasound image comprises the following steps: S231, respectively calculating the gradient of each pixel point of the new fetal heart ultrasound image in the X and Y directions based on the Sobel operator; S232, calculating the gradient magnitude and gradient direction of each pixel point according to the gradient of each pixel point in the X and Y directions respectively; S233, using the Laplace operator to identify the zero-crossing point of the grayscale change of the new fetal heart ultrasound image, and obtaining the Laplace zero-crossing point; S234, calculating the local cost of each pixel to the adjacent pixel based on the gradient magnitude, gradient direction and Laplace zero-crossing point, and constructing a weight map.

5. The method for optimizing segmentation of fetal heart ultrasound images according to claim 4, characterized in that: The calculation formula for calculating the local cost of each pixel to the adjacent pixel based on the gradient amplitude, gradient direction and Laplace zero crossing point is: T(r,t)=ω Z ×f Z (t)+ω D ×f D (r,t)+ω G ×f G (t); Where T(r,t) represents the local cost from pixel r to its adjacent pixel t; f Z (t) represents the Laplace zero-crossing cost; f D (r, t) represents the gradient direction cost from pixel r to its adjacent pixel t; f G (t) represents the gradient of pixel t in the X and Y directions; ω Z ,ω D and G They represent the circle coefficients of the Laplace zero crossing, gradient direction, and gradient direction cost respectively.

6. The method for optimizing segmentation of fetal heart ultrasound images according to claim 1, characterized in that: The method based on the Dijkstra algorithm, starting from the node corresponding to the seed point, searching the shortest path to the node corresponding to the free point on the weight graph includes the following steps: S2431, taking the node corresponding to the seed point as the starting point, setting the distances of all other nodes in the weight graph to infinity and creating a priority queue for storing all nodes; S2432, adding the starting point to the priority queue, and sorting them according to the distance from the node to the starting point; S2433, taking out the node with the smallest distance from the priority queue as the current node, and traversing all its neighboring nodes; S2434. For each neighbor node, if the distance from the current node to the neighbor node is less than the previously recorded distance, the distance of the neighbor node is updated, and its position in the priority queue is updated.

7. The method for optimizing segmentation of fetal heart ultrasound images according to claim 1, characterized in that: The step of performing segmentation and smoothing processing on the new fetal heart ultrasound image based on the heart edge path of the new fetal heart ultrasound image to obtain the new fetal heart ultrasound segmented image comprises the following steps: S31, extracting edge points of the heart according to the heart edge path of the new fetal heart ultrasound image to obtain an edge point set; S32, selecting control points from the edge point set, and using a B-spline curve to perform shape-preserving interpolation to construct a smooth curve passing through all the control points; S33, using the constructed smooth curve as the contour of the new fetal heart, and segmenting the new fetal heart ultrasound image according to the contour of the new fetal heart to obtain a new fetal heart ultrasound segmentation image.

8. A fetal heart ultrasound image optimization segmentation device, used to implement the fetal heart ultrasound image optimization segmentation method according to any one of claims 1 to 7, characterized in that: The fetal heart ultrasound image optimization segmentation device comprises: a segmentation image database construction module, a heart edge path search module and a fetal ultrasound heart image segmentation module; The segmented image database construction module is used to obtain ultrasound segmented images of fetal hearts at different historical developmental stages and construct a segmented image database; The heart edge path finding module is used to obtain a new fetal heart ultrasound image, and find the heart edge path of the new fetal heart ultrasound image based on the segmented image database and using an adaptive finding method; The fetal ultrasonic heart image segmentation module is used to perform segmentation and smoothing processing on the new fetal heart ultrasonic image based on the heart edge path of the new fetal heart ultrasonic image to obtain a new fetal heart ultrasonic segmented image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method for optimizing the segmentation of fetal heart ultrasound images according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • B-mode ultrasound image fetus head circumference detection method based on closed-loop shortest path

    CN110916724A

  • Fetal heart and fetal lung deep learning combined segmentation method based on U-Net ultrasound

    CN111242956A