A segmentation method based on hepatobiliary images
Through differentiated prediction filtering window size and bidirectional prediction model, the problems of Gaussian filtering denoising effect and edge fidelity in the image processing of hepatic bile duct stones are solved, and more efficient and accurate image processing and segmentation are achieved.
Patent Information
- Application Number
- CN202510086283.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-01-20
AI Technical Summary
In the prior art, Gaussian filtering is difficult to take into account both the noise removal effect and the fidelity of the edge of the stone in the hepatic bile duct stone image processing, and the calculation complexity is high, so it cannot adapt to the local characteristics and complexity of the image.
Differentiated prediction filter window size range is adopted, and the optimal filter window size is dynamically selected through the connectivity domain division and the filter window bidirectional prediction model, and the filter value is evaluated in combination with grayscale feature vectors and negative indexes to improve the adaptability and accuracy of filter processing.
It improves the denoising effect and image processing efficiency of hepatobiliary duct images, preserves the details of the edge of stones, reduces waste of computing resources, and enhances the accuracy of image segmentation.
Smart Images

Figure CN119942121B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a segmentation method based on hepatobiliary images. Background Art
[0002] Hepatolithiasis refers to hard stones that form within the hepatobiliary system. These stones can block the normal flow of bile, leading to cholestasis and a range of symptoms and complications. Currently, B-ultrasound is commonly used to detect hepatolithiasis. However, the relatively low resolution of ultrasound waves used in B-ultrasound imaging can be limiting, particularly in detecting deep tissue or small stones. Small or closely packed stones can be difficult to clearly visualize, making B-ultrasound images more susceptible to noise and hindering the segmentation of stone regions. Therefore, denoising of B-ultrasound images is necessary. Gaussian filtering is commonly used to denoise B-ultrasound images, removing noise and facilitating subsequent hepatolith segmentation. However, when using Gaussian filtering for denoising B-ultrasound images, a larger filter window improves denoising effectiveness but can blur the edges of hepatolithiasis in the image. A smaller filter window enhances the structural integrity of hepatolithiasis in the B-ultrasound image, but results in poor denoising. When the size of the filter window of the Gaussian filter is not appropriately selected, the noise reduction effect of the B-ultrasound image will be unsatisfactory, and the accuracy of hepatobiliary stone segmentation will be reduced.
[0003] The patent document with patent application number 202410772853.0 discloses a method for segmenting images of the bile duct and bile stones. It traverses all values within the window size range to obtain all reference pixel sets for each pixel in the bile duct B-ultrasound image. Based on the grayscale value, degree of confusion and confusion credibility of each pixel in the bile duct B-ultrasound image, as well as the grayscale value of each pixel in the initial filtered image, the optimal filter window size is comprehensively and globally screened, thereby further improving the enhancement effect of the bile duct B-ultrasound image.
[0004] However, in hepatobiliary B-ultrasound images and gallstone images, due to the complexity of the tissue and the diversity of lesions, the images often show non-uniformity and anisotropy, especially in the gallstone area. Due to the large difference in grayscale values between the stones and the surrounding tissues, as well as the uncertainty of the stone shape, size and position, the use of a unified filter window for Gaussian filtering denoising may result in poor local denoising effect.
[0005] Specifically, if a globally optimal filter window size is used for sliding traversal denoising, this window size may be selected based on the overall image evaluation value and may not be well adapted to the specificities of the local image. For example, at the edge of a gallstone or in an area with small stones, a larger filter window may blur the stone edge, causing morphological distortion; while a smaller filter window may not effectively remove surrounding noise. Furthermore, traversing all values within a uniformly preset window size range invisibly increases the computational complexity and resources of image processing, lacks specificity, and reduces image processing efficiency. Summary of the Invention
[0006] In response to the technical problems existing in the prior art, the present invention provides a segmentation method based on hepatobiliary images, which differentially predicts the size range of the filtering window, enhances the adaptability and accuracy of image filtering processing, and improves the efficiency of image processing.
[0007] The present invention solves the above technical problems with the following technical solutions: A segmentation method based on hepatobiliary images, comprising: S101, obtaining at least one hepatobiliary image obtained by continuous scanning within a preset time window and generating a hepatobiliary image sequence;
[0008] S102, taking any one of the hepatobiliary duct images in the hepatobiliary duct image sequence as an image to be processed, dividing the image to be processed into a plurality of sub-images using a preset grayscale domain division mechanism, uniquely numbering each sub-image according to its position in the image to be processed, and assigning a corresponding filter window size interval to each sub-image;
[0009] S103, based on each sub-image of the image to be processed, traverse each value of the filter window size range, establish a filter window with any pixel as the center, and obtain the value factor of the pixel;
[0010] S104, filtering the sub-image using the filtering window to obtain a target image, and obtaining the filtering value of the filtering window for the sub-image based on the value factor of each pixel in the sub-image and the grayscale value of the pixel at the same position in the corresponding target image;
[0011] S105, counting the filtering value of each filter window in the filter window size interval corresponding to each sub-image in the image to be processed, selecting the one with the largest filtering value as the optimal filter window for the sub-image, and filtering each sub-image using the optimal filter window to generate a target hepatobiliary image of the image to be processed;
[0012] S106: Input the target hepatobiliary duct image into the image segmentation model to identify the hepatobiliary duct.
[0013] Preferably, the preset grayscale domain division mechanism includes:
[0014] S201, performing connected domain analysis on the image to be processed, obtaining all connected domains, and recording the grayscale value of each connected domain;
[0015] S202: For each connected domain, the average coordinates of all pixels therein are calculated as its centroid, and the Euclidean distance, grayscale difference, and area between the centroids of any two connected domains are calculated to obtain a normalized trend value between any two connected domains.
[0016] S203, based on the normalized trend values between connected domains, dividing the connected domains whose normalized trend values are less than a preset trend threshold into a cluster, thereby obtaining a plurality of clusters, each cluster including at least one connected domain;
[0017] S204 , obtaining the maximum bounding rectangle of each cluster based on the connected domain within the cluster, and dividing the image to be processed into a plurality of sub-images based on the distribution of all the maximum bounding rectangles in the image to be processed.
[0018] Preferably, in S202, the normalized trend value is calculated according to the following formula:
[0019]
[0020]
[0021] in, The normalized trend value of the i-th connected domain and the j-th connected domain, is the proximity factor of two connected domains, is the Euclidean distance between the centroids of two connected domains, is the area of the i-th connected domain, is the area of the jth connected domain, is the gray value of the i-th connected component, is the gray value of the j-th connected component, and are the influence weights of the proximity factor and grayscale difference value on the normalized trend value.
[0022] Preferably, allocating a corresponding filter window size interval to each sub-image specifically includes:
[0023] S301, based on each sub-image, extracting its grayscale feature vector, the grayscale feature vector is composed of grayscale change degree and pixel information richness;
[0024] S302: Input the grayscale feature vector of the sub-image into a pre-trained filtering window bidirectional prediction model, and output the filtering window size interval of the sub-image.
[0025] Preferably, the pre-trained filter window bidirectional prediction model includes a filter window forward prediction model, a filter window reverse prediction model, and a bidirectional linkage decision module;
[0026] The filtering window bidirectional prediction model is used to input the received grayscale feature vector into the filtering window forward prediction model and the filtering window reverse prediction model respectively;
[0027] The filter window forward prediction model is used to output a forward prediction result according to the input grayscale feature vector and transmit it to the bidirectional linkage decision module;
[0028] The filter window reverse prediction model is used to output a reverse prediction result according to the input grayscale feature vector and transmit it to the bidirectional linkage decision module;
[0029] The bidirectional linkage decision module is used to output the filter window size interval of the sub-image according to the received forward prediction result and the reverse prediction result;
[0030] The forward prediction result includes an ideal filtering window size, and the reverse prediction result includes a reverse filtering window size and a reverse size interval.
[0031] Preferably, the method for acquiring the filter window reverse prediction model includes:
[0032] B1. Collect a large number of hepatobiliary images with non-ideal filtering results, their grayscale feature vectors before filtering, and the actual filter window size used. Perform cluster analysis on the collected hepatobiliary images using a clustering algorithm based on the grayscale feature vectors to obtain several clusters, each of which includes at least one hepatobiliary image and corresponds to a cluster center.
[0033] B2. Based on each cluster, generating at least one inverse size interval according to the continuous clustering range of the filter window sizes actually used by all the hepatobiliary images therein;
[0034] B3. Using the grayscale feature vectors corresponding to each non-ideal hepatobiliary image as training data, and labeling each training data, with the label content set to: the actual filter window size used, and the inverse size interval corresponding to the cluster to which it belongs;
[0035] B4. Use the labeled training data to train the pre-selected neural network model structure, continuously optimize the model parameters, and obtain the final filter window reverse prediction model.
[0036] Preferably, the bidirectional linkage decision module is specifically used to:
[0037] C1. Obtain reverse confidence based on the reverse filtering window size and the reverse size interval; wherein, the reverse confidence is obtained as follows: , h is the reverse confidence, L is the difference between the reverse filter window size and the center point of the reverse size interval;
[0038] C2. Based on the positional relationship between the ideal filter window size and the reverse size interval and the reverse confidence, the target length is expanded in the left and right directions with the ideal filter window size as the reference center to obtain the final filter window size interval.
[0039] Preferably, in S103, establishing a filtering window with any pixel as the center to obtain the value factor of the pixel specifically includes:
[0040] Based on each sub-image of the image to be processed, traverse each value of its filter window size range, establish a filter window with any pixel as the center, and obtain the grayscale feature vector of the pixel in the filter window;
[0041] Based on the unique number of each sub-image, all sub-images having the same unique number as the sub-image in other hepatobiliary duct images in the hepatobiliary duct image sequence are determined to form a comparison sequence, wherein the comparison sequence includes at least one comparison sub-image;
[0042] The value factor of each pixel in each sub-image is obtained according to the matching degree of the grayscale feature vector between each pixel in each sub-image and the pixel at the same position in the comparison sub-image in the comparison sequence.
[0043] Preferably, in S104, the filtering value of the filtering window for the sub-image is calculated according to the following formula:
[0044]
[0045] Among them, Q is the filtering value of the filter window for the sub-image, N is the total number of pixels in the sub-image, is the gray value of the i-th pixel in the sub-image, is the grayscale value of the i-th pixel in the target image corresponding to the sub-image, is the value factor of the i-th pixel in the sub-image.
[0046] Preferably, after S104, the method further includes:
[0047] S401, performing connected domain analysis on a target image corresponding to the sub-image to obtain all target connected domains in the target image;
[0048] S402: Obtain the maximum area value in the target connected domain as the second area value, and the maximum area value in all connected domains of the sub-image as the first area value, and calculate the negative index of the filter window according to the following formula:
[0049]
[0050] in, is the negative index of the filter window, S1 is the first area value, and S2 is the second area value;
[0051] S403, multiplying the negative index by the filtering value determined in S104 to obtain a new filtering value to replace the original filtering value, and executing step S105.
[0052] The beneficial effects of the present invention are:
[0053] A grayscale domain division mechanism based on connected domains is introduced to divide the image to be processed into several sub-images, which can perform more detailed feature analysis based on the characteristics of different regions and improve the adaptability and accuracy of filtering; a bidirectional prediction model of the filter window is used to comprehensively consider the forward and reverse prediction results to determine the filter window size range, which can more accurately predict the appropriate filter window size and improve the denoising effect while retaining image details and improving the efficiency of image processing; the value factor is calculated by comparing the matching degree of the grayscale feature vectors of the pixel points in the sequence, and the filtering value is calculated based on the grayscale value difference, and the time series information is used to improve the accuracy of the filtering value and make the filtering processing more targeted; a negative index is introduced to measure the negative impact of the filtering processing on the image structure and avoid the destruction of important texture information by the filtering processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 Schematic diagram of a flow chart of a segmentation method based on hepatobiliary images according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described 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 those skilled in the art without making creative efforts are within the scope of protection of this application.
[0056] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the described features. In the description of this application, "plurality" means two or more, unless otherwise specifically specified.
[0057] In the description of this application, the term "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any person skilled in the art to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art will recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.
[0058] Figure 1 4 is a flow chart of a segmentation method based on a hepatobiliary image according to an embodiment of the present invention.
[0059] like Figure 1 As shown, a segmentation method based on a hepatobiliary image includes the following steps:
[0060] S101, obtaining at least one hepatobiliary duct image obtained by continuous scanning within a preset time window and generating a hepatobiliary duct image sequence, wherein each hepatobiliary duct image corresponds to a scanning time node.
[0061] During medical examinations, B-ultrasound equipment is usually used to perform continuous scanning of the hepatobiliary ducts to obtain hepatobiliary duct images at different time points. These images are arranged in chronological order to form a hepatobiliary duct image sequence. The preset time window is a specified time period used to determine the range of images that need to be processed.
[0062] For example, if one image is acquired per second and the preset time window is 10 seconds, a sequence containing 10 images is generated.
[0063] S102: Use any one of the hepatobiliary duct images in the hepatobiliary duct image sequence as the image to be processed, and use a pre-set grayscale domain division mechanism to divide the image to be processed into several sub-images. Each sub-image is uniquely numbered according to its position in the image to be processed (which may be composed of the center pixel position or the edge key pixel position, which is not limited in the present invention), and a corresponding filter window size range is assigned to each sub-image.
[0064] In some embodiments, the pre-set grayscale domain division mechanism includes:
[0065] S201 , performing connected domain analysis on the image to be processed, obtaining all connected domains, and recording the grayscale value of each connected domain.
[0066] Since in the hepatobiliary image, the hepatobiliary and other tissue structures, noise, etc. are more obviously reflected in the grayscale image as connected domains, the grayscale division mechanism based on the connected domain can perform reasonable image division in special image types, which has great processing advantages in the subsequent block filtering process.
[0067] S202: For each connected domain, the average coordinates of all pixels therein are calculated as its centroid, and the Euclidean distance, grayscale difference, and area between the centroids of each connected domain are calculated. The normalized trend value of any two connected domains is calculated according to the following formula:
[0068]
[0069]
[0070] in, The normalized trend value of the i-th connected domain and the j-th connected domain, is the proximity factor of two connected domains, is the Euclidean distance between the centroids of two connected domains, is the area of the i-th connected domain, is the area of the jth connected domain, is the gray value of the i-th connected component, is the gray value of the j-th connected component, and are the weights of the influence of the proximity factor and grayscale difference value on the normalized trend value, which are set according to the actual situation and expert experience. and The sum of is 1, and Greater than ,For example, =0.8, =0.2, because when two connected domains are normalized, the relative position information is more important. Only adjacent or close connected domains can be reasonably classified into one sub-image. In order to avoid the situation where the grayscale value difference between two connected domains is small but they are distributed far apart in the image to be processed and normalized, Set the value to be greater than , and on the premise of close distance, the connected domains with smaller grayscale difference values are merged into one sub-image.
[0071] S203 , based on the normalized trend values between connected domains, the connected domains whose normalized trend values are less than a preset trend threshold are divided into a cluster to obtain a plurality of clusters, each cluster including at least one connected domain.
[0072] The preset trend threshold is set according to actual conditions and expert experience, for example, to 0.3.
[0073] S204 , obtaining the maximum bounding rectangle of each cluster based on the connected domain within the cluster, and dividing the image to be processed into a plurality of sub-images based on the distribution of all the maximum bounding rectangles in the image to be processed.
[0074] Specifically, for all maximum bounding rectangles, when two maximum bounding rectangles intersect, the average grayscale value within the intersection and the average grayscale value within the area of the two maximum bounding rectangles excluding the intersection are calculated. The intersection is then assigned to the maximum bounding rectangle closest to the average value. It should be noted that the number of sub-images is greater than or equal to the total number of maximum bounding rectangles. This is because, in addition to the areas corresponding to the maximum bounding rectangles of all clusters, the image to be processed may contain remaining areas. Boundary smoothing can be performed to evenly divide the image. This is not detailed in this invention.
[0075] Therefore, through connected domain analysis, the hepatobiliary image is divided into several sub-images. Compared with the global analysis of the entire hepatobiliary image, this image content-based segmentation method can better adapt to the complexity of the hepatobiliary structure, more accurately reflect the distribution of the hepatobiliary structure, and reduce the artifacts and distortion caused by cross-structure filtering; the calculation of the normalized trend value takes into account the position, grayscale and area information between connected domains, ensuring that adjacent and similar connected domains are divided into the same sub-image, providing more uniform and consistent image blocks for subsequent filtering processing.
[0076] In some embodiments, each sub-image is assigned a corresponding filter window size interval, specifically including:
[0077] S301: Extract the grayscale feature vector of each sub-image. The grayscale feature vector is composed of grayscale variation and pixel information richness. Grayscale variation reflects the fluctuation of grayscale values within the sub-image, while pixel information richness reflects the diversity of grayscale levels.
[0078] Specifically, the grayscale change degree is calculated according to the following formula:
[0079]
[0080] Among them, V is the degree of grayscale change, N is the number of pixels in the sub-image, is the gray value of the i-th pixel, is the mean grayscale value of all pixels in the sub-image.
[0081] Specifically, the pixel information richness is calculated according to the following formula:
[0082]
[0083] Among them, E is the richness of pixel information, K is the number of gray levels in the sub-image, is the probability that gray level k appears in the sub-image.
[0084] S302: Input the grayscale feature vector of the sub-image into a pre-trained filtering window bidirectional prediction model, and output the filtering window size interval of the sub-image.
[0085] Specifically, the pre-trained filter window bidirectional prediction model includes a filter window forward prediction model, a filter window reverse prediction model, and a bidirectional linkage decision module; the filter window bidirectional prediction model is used to input the received grayscale feature vector into the filter window forward prediction model and the filter window reverse prediction model respectively; the filter window forward prediction model is used to output the forward prediction result according to the input grayscale feature vector and transmit it to the bidirectional linkage decision module; the filter window reverse prediction model is used to output the reverse prediction result according to the input grayscale feature vector and transmit it to the bidirectional linkage decision module; the bidirectional linkage decision module is used to output the filter window size range of the sub-image based on the received forward prediction result and reverse prediction result.
[0086] The forward prediction result includes the ideal filtering window size, and the reverse prediction result includes the reverse filtering window size and the reverse size interval.
[0087] Specifically, the methods for obtaining the filter window forward prediction model include:
[0088] A1. Collect a large number of ideal hepatobiliary images and their grayscale feature vectors before filtering, and label each grayscale feature vector. The label content is set to: the actual filter window size used;
[0089] A2. Use the labeled grayscale feature vector as a training data set, use the training data set to train the pre-selected neural network model structure, continuously optimize the model parameters, and obtain the final filter window forward prediction model.
[0090] The methods for obtaining the filter window reverse prediction model include:
[0091] B1. Collect a large number of hepatobiliary images with non-ideal filtering results, their grayscale feature vectors before filtering, and the actual filter window size used. Perform cluster analysis on the collected hepatobiliary images using a clustering algorithm (such as K-means or DBSCAN) based on the grayscale feature vectors to obtain several clusters. Each cluster includes at least one hepatobiliary image, and each cluster corresponds to a cluster center (average grayscale feature vector).
[0092] B2. Based on each cluster, generating at least one inverse size interval according to the continuous clustering range of the filter window sizes actually used by all the hepatobiliary images therein, to reflect the possible variation range of the image filter window size in the cluster;
[0093] The continuous clustering range specifically means that within each cluster obtained after cluster analysis, the filter window sizes actually used for all hepatobiliary images tend to be continuously and densely distributed within one or more size intervals. For example, a cluster includes 10 hepatobiliary images, and the corresponding actual filter window sizes used are: 3, 4, 4, 5, 8, 9, 7, 7, 8, 9, mainly distributed in two intervals: [3, 5] and [7, 9]. Therefore, the inverse size interval of this cluster is [3, 5]∪[7, 9].
[0094] B3. Using the grayscale feature vectors corresponding to each non-ideal hepatobiliary image as training data, and labeling each training data, with the label content set to: the actual filter window size used, and the inverse size interval corresponding to the cluster to which it belongs;
[0095] B4. Use the labeled training data to train the pre-selected neural network model structure, continuously optimize the model parameters, and obtain the final filter window reverse prediction model.
[0096] The two-way linkage decision module is specifically used for:
[0097] C1. Based on the reverse filtering window size and the reverse size interval, the reverse confidence is obtained. The reverse confidence is obtained as follows: , where h is the reverse confidence and L is the difference between the reverse filtering window size and the center point of the reverse size interval.
[0098] C2. Based on the positional relationship between the ideal filter window size and the reverse size interval and the reverse confidence, the target length is expanded in the left and right directions with the ideal filter window size as the reference center to obtain the final filter window size interval.
[0099] Specifically, the target length is determined as follows:
[0100] Based on the inverse confidence level of the inverse size interval, the expansion amplitude factor is subtracted from 1. A pre-set extension reference length is set. If the ideal filter window size is to the right of the center of the inverse size interval, the extension reference length to the left of the reference center is multiplied by the expansion amplitude factor of the inverse size interval to obtain the target extension length of the reference center in that direction. Similarly, the target extension length to the right of the reference center can be determined. The pre-set extension reference length is set based on actual conditions and expert experience, with the reference center appropriately extended to the left and right by a certain length to avoid an excessively large range.
[0101] Therefore, a fixed and unified filter window size may not be able to adapt to all image contents, resulting in poor filtering effect. In order to adapt to most image features, the range must be large, which can easily cause waste of computing resources and reduce image processing efficiency. Therefore, the degree of grayscale change and the richness of pixel information are used as grayscale feature vectors, and the filter window bidirectional prediction model is used to dynamically determine the filter window size. This image feature-based filter window selection method can significantly improve the accuracy and efficiency of filtering, especially when processing complex and changeable hepatobiliary images; through the grayscale feature vector extraction of sub-images and the filter window bidirectional prediction model, the filter window size range is dynamically allocated to each sub-image. This adaptability can predict the most suitable filtering parameters according to different image contents and improve the filtering effect; the bidirectional linkage decision module combines the results of forward prediction and reverse prediction, and dynamically adjusts the filter window size range extended based on the predicted ideal filter window size through reverse confidence and expansion amplitude factor, which can improve the robustness and adaptability of the algorithm while ensuring the filtering effect.
[0102] S103, based on each sub-image of the image to be processed, traverse each value of its filter window size range, establish a filter window with any pixel as the center, and obtain the value factor of the pixel.
[0103] Specifically, step S103 includes:
[0104] Based on each sub-image of the image to be processed, traverse each value of its filter window size range, establish a filter window with any pixel as the center, and obtain the grayscale feature vector of the pixel in the filter window;
[0105] Based on the unique number of each sub-image, all sub-images with the same unique number as the sub-image in other hepatobiliary duct images in the hepatobiliary image sequence are determined to form a comparison sequence, that is, each sub-image in the image to be processed corresponds to a comparison sequence, and the comparison sequence includes at least one comparison sub-image;
[0106] The value factor of each pixel in each sub-image is obtained based on the matching degree (Euclidean distance) between the grayscale feature vectors of each pixel in each sub-image and the pixel at the same position in the comparison sub-image in the comparison sequence. The higher the matching degree, the greater the value factor.
[0107] Among them, the average is taken based on the matching degree of the grayscale feature vector between each pixel point and the pixel point at the same position of each comparison sub-image in the comparison sequence, or a different weight value is assigned to each comparison sub-image according to the difference between the scanning time node of the comparison sub-image and the scanning time node of the sub-image. The smaller the difference, the greater the weight value. According to the corresponding weight value, all matching values are weighted and summed to obtain the final value factor.
[0108] S104: Filter the sub-image using the filter window to obtain a target image. Based on the value factor of each pixel in the sub-image and the grayscale value of the pixel at the same position in the target image, the filter value of the filter window for the sub-image is calculated according to the following formula:
[0109]
[0110] Among them, Q is the filtering value of the filter window for the sub-image, N is the total number of pixels in the sub-image, is the gray value of the i-th pixel in the sub-image, is the grayscale value of the i-th pixel in the target image corresponding to the sub-image, is the value factor of the i-th pixel in the sub-image.
[0111] S105, counting the filtering value of each filtering window in the filtering window size interval corresponding to each sub-image in the image to be processed, selecting the optimal filtering window for the sub-image with the largest filtering value, filtering each sub-image using its optimal filtering window, and splicing them according to their unique numbers to obtain a processed hepatobiliary image as the target hepatobiliary image.
[0112] S106, inputting the target hepatobiliary image into an image segmentation model to identify the hepatobiliary region. The image segmentation model can be based on deep learning technology, such as convolutional neural network (CNN) or fully convolutional network (FCN), etc., which will not be described in detail in the present invention.
[0113] Therefore, traditional methods usually use a fixed filtering window size, while this embodiment dynamically selects the optimal filtering window according to the content of the sub-image, thereby improving the adaptability and accuracy of the filtering; by using other images in the image sequence for comparison, the accuracy of pixel matching is improved, thereby improving the reliability of the value factor, and introducing the value factor of the pixel points in the sub-image, more reasonably evaluating the influence of each pixel point on the filtering effect, further improving the accuracy of the filtering evaluation.
[0114] However, in step S104, the filtering value of the filtering window for the sub-image is calculated based on the value factor and grayscale value difference value of each pixel in the sub-image and its target image. Although the degree of change in the grayscale value after filtering can reflect the effect of Gaussian filtering to a certain extent, it may also affect certain special structural tissues and other positions while performing denoising. For example, blurred boundaries and grayscale value merging cause a certain range to become larger, making the filtering process counterproductive and causing some important texture information to disappear. Therefore, in order to avoid negative impacts on the image segmentation and bile duct area identification in step S106, the calculation method of the filtering value in step S104 is further improved.
[0115] In some embodiments, after step S104, the method further includes:
[0116] S401 , performing connected domain analysis on a target image corresponding to a sub-image to obtain all target connected domains in the target image.
[0117] S402: Obtain the maximum area value in the target connected domain as the second area value, and the maximum area value in all connected domains of the sub-image as the first area value, and calculate the negative index of the filter window according to the following formula:
[0118]
[0119] in, is the negative index of the filter window, S1 is the first area value, and S2 is the second area value.
[0120] S403, multiplying the negative index by the filtering value determined in step S104 to obtain a new filtering value to replace the original filtering value, and executing step S105.
[0121] Therefore, traditional methods usually only consider the grayscale value changes after filtering to evaluate the filtering effect, while this embodiment introduces a negative index to more comprehensively evaluate the negative impact of filtering on the image structure. The filtering value of different filtering window sizes is dynamically adjusted through the negative index, so that the final filtering window retains more important texture information, improves the accuracy of image segmentation, and thus facilitates subsequent image analysis and processing tasks; after calculating the filtering value, the negative index is introduced to measure the negative impact of filtering on the image structure, avoid the destruction of important texture information by filtering, and improve the accuracy of image segmentation.
[0122] In summary, the grayscale domain division mechanism based on connected domain is introduced to divide the image to be processed into several sub-images, which can perform more detailed feature analysis based on the characteristics of different regions and improve the adaptability and accuracy of filtering; the filter window bidirectional prediction model is used to comprehensively consider the forward and reverse prediction results to determine the filter window size range, which can more accurately predict the appropriate filter window size and improve the denoising effect while retaining image details and improving the efficiency of image processing; the value factor is calculated by comparing the matching degree of the grayscale feature vectors of the pixel points in the sequence, and the filtering value is calculated in combination with the grayscale value difference, and the time series information is used to improve the accuracy of the filtering value and make the filtering processing more targeted; the negative index is introduced to measure the negative impact of the filtering processing on the image structure and avoid the destruction of important texture information by the filtering processing.
[0123] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, 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 magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts 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, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0125] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0127] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0128] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A segmentation method based on hepatobiliary images, characterized in that: include: S101, obtaining at least one hepatobiliary image obtained by continuous scanning within a preset time window and generating a hepatobiliary image sequence; S102: Taking any one of the hepatobiliary duct images in the hepatobiliary image sequence as the image to be processed, using a pre-set grayscale domain division mechanism, the image to be processed is divided into a number of sub-images, each of which is uniquely numbered according to its position in the image to be processed. For each sub-image, a grayscale feature vector consisting of grayscale variation and pixel information richness is extracted, and the grayscale feature vector is input into a pre-trained filter window bidirectional prediction model to output a filter window size interval for the sub-image. The filter window bidirectional prediction model includes a filter window forward prediction model, a filter window reverse prediction model, and a bidirectional linkage decision module; the bidirectional linkage decision module is used to output the filter window size interval of the sub-image according to the forward prediction results and reverse prediction results transmitted by the filter window forward prediction model and the filter window reverse prediction model respectively; S103, based on each sub-image of the image to be processed, traverse each value in its filter window size interval, establish a filter window with any pixel point as the center, and obtain the value factor of the pixel point; S104, use the filter window to filter the sub-image to obtain the target image, and based on the value factor of each pixel point in the sub-image and the grayscale value of the pixel point at the same position in the corresponding target image, obtain the filter value of the filter window for the sub-image; based on the second area value of the largest connected domain of the target image and the first area value of the largest connected domain of the sub-image, obtain the negative index of the filter window, and multiply it with the filter value to update the filter value; S105, count the filter value of the filter window of each value in the filter window size interval corresponding to each sub-image in the image to be processed, select the one with the largest filter value as the optimal filter window of the sub-image, use the optimal filter window of each sub-image to filter it separately, and generate the target bile duct image of the image to be processed; S106, input the target bile duct image into the image segmentation model for bile duct identification.
2. The method for segmenting the hepatobiliary duct image according to claim 1, wherein: The preset grayscale domain division mechanism includes: S201, performing connected domain analysis on the image to be processed, obtaining all connected domains, and recording the grayscale value of each connected domain; S202: For each connected domain, the average coordinates of all pixels therein are calculated as its centroid, and the Euclidean distance, grayscale difference, and area between the centroids of any two connected domains are calculated to obtain a normalized trend value between any two connected domains. S203, based on the normalized trend values between connected domains, dividing the connected domains whose normalized trend values are less than a preset trend threshold into a cluster, thereby obtaining a plurality of clusters, each cluster including at least one connected domain; S204 , obtaining the maximum bounding rectangle of each cluster based on the connected domain within the cluster, and dividing the image to be processed into a plurality of sub-images based on the distribution of all the maximum bounding rectangles in the image to be processed.
3. The method for segmenting the hepatobiliary duct image according to claim 2, wherein: In S202, the normalized trend value is calculated according to the following formula: in, The normalized trend value of the i-th connected domain and the j-th connected domain, is the proximity factor of two connected domains, is the Euclidean distance between the centroids of two connected domains, is the area of the i-th connected domain, is the area of the jth connected domain, is the gray value of the i-th connected component, is the gray value of the j-th connected component, and are the weights of the influence of the proximity factor and grayscale difference value on the normalized trend value.
4. The method for segmenting the hepatobiliary duct based on an image according to claim 1, wherein: The filtering window bidirectional prediction model is used to input the received grayscale feature vector into the filtering window forward prediction model and the filtering window reverse prediction model respectively; The forward prediction result includes an ideal filtering window size, and the reverse prediction result includes a reverse filtering window size and a reverse size interval.
5. The method for segmenting the hepatobiliary duct image according to claim 4, wherein: The method for obtaining the filter window reverse prediction model includes: B1. Collect a large number of hepatobiliary images with non-ideal filtering results, their grayscale feature vectors before filtering, and the actual filter window size used. Perform cluster analysis on the collected hepatobiliary images using a clustering algorithm based on the grayscale feature vectors to obtain several clusters, each of which includes at least one hepatobiliary image and corresponds to a cluster center. B2. Based on each cluster, generating at least one inverse size interval according to the continuous clustering range of the filter window sizes actually used by all the hepatobiliary images therein; B3. Using the grayscale feature vectors corresponding to each non-ideal hepatobiliary image as training data, and labeling each training data, with the label content set to: the actual filter window size used, and the inverse size interval corresponding to the cluster to which it belongs; B4. Use the labeled training data to train the pre-selected neural network model structure, continuously optimize the model parameters, and obtain the final filter window reverse prediction model.
6. The method for segmenting the hepatobiliary duct image according to claim 4, wherein: The bidirectional linkage decision module is specifically used for: C1. Obtain reverse confidence based on the reverse filtering window size and the reverse size interval; wherein, the reverse confidence is obtained as follows: , h is the reverse confidence, L is the difference between the reverse filter window size and the center point of the reverse size interval; C2. Based on the positional relationship between the ideal filter window size and the reverse size interval and the reverse confidence, the target length is expanded in the left and right directions with the ideal filter window size as the reference center to obtain the final filter window size interval.
7. The method for segmenting the hepatobiliary duct image according to claim 1, wherein: In S103, a filtering window is established with any pixel as the center to obtain the value factor of the pixel, which specifically includes: Based on each sub-image of the image to be processed, traverse each value of its filter window size range, establish a filter window with any pixel as the center, and obtain the grayscale feature vector of the pixel in the filter window; Based on the unique number of each sub-image, all sub-images having the same unique number as the sub-image in other hepatobiliary duct images in the hepatobiliary duct image sequence are determined to form a comparison sequence, wherein the comparison sequence includes at least one comparison sub-image; The value factor of each pixel in each sub-image is obtained according to the matching degree of the grayscale feature vector between each pixel in each sub-image and the pixel at the same position in the comparison sub-image in the comparison sequence.
8. The method for segmenting the hepatobiliary duct image according to claim 1, wherein: In S104, the filtering value of the filtering window for the sub-image is calculated according to the following formula: Among them, Q is the filtering value of the filter window for the sub-image, N is the total number of pixels in the sub-image, is the gray value of the i-th pixel in the sub-image, is the grayscale value of the i-th pixel in the target image corresponding to the sub-image, is the value factor of the i-th pixel in the sub-image.
9. The method for segmenting the hepatobiliary duct image according to claim 1, wherein: The negative index of the filter window is calculated according to the following formula: in, is the negative index of the filter window, S1 is the first area value, and S2 is the second area value.
Citation Information
Patent Citations
A method for segmenting hepatobiliary and bile duct stones images
CN118365534B
Design optimization method and device of filter, filter, equipment and medium
CN116111984A
Hepatobiliary duct and biliary tract calculus image segmentation method
CN118365534A
Electronic medical record data analysis method for pulmonary tuberculosis patient
CN118397031A