A method and system for detecting thyroid calcifications based on image processing
By using gridding and grayscale difference analysis, artifact interference is suppressed, and calcification boundaries in thyroid ultrasound images are identified. This solves the problem of inaccurate segmentation of calcification regions in existing technologies, and improves detection accuracy and clinical diagnostic support capabilities.
Patent Information
- Application Number
- CN202510465883.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-04-10
AI Technical Summary
Current technology lacks sufficient accuracy in segmenting calcified areas in thyroid ultrasound imaging, and artifact interference has a significant impact, resulting in inaccurate detection results and limiting its clinical application.
An image processing-based approach is employed, which extracts edge gradient directions, suppresses artifact interference, and identifies calcification boundaries through gridding and grayscale difference analysis. Combined with grayscale concentration and stability analysis, calcification detection results are generated.
It improves the detection accuracy of calcified areas in thyroid ultrasound images, ensures accurate boundaries, enhances clinical diagnostic support capabilities, and adapts to different image qualities and disease types.
Smart Images

Figure CN120374562B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and in particular to a method and system for detecting thyroid calcification based on image processing. Background Technology
[0002] The field of medical image processing technology encompasses the analysis, processing, and interpretation of image data acquired using medical imaging equipment. Its core content involves the analysis and processing of different types of medical image data, such as CT scans, MRI, ultrasound images, and X-ray images. The primary task of medical image processing is to assist medical personnel in the early diagnosis, disease assessment, and treatment planning of diseases. By extracting and analyzing detailed information from medical images, medical image processing technology can provide scientific evidence and support for clinical medicine. This field involves techniques such as image preprocessing, feature extraction, image segmentation, and image fusion, and is widely applied in various medical fields, including cancer detection, lesion analysis, and organ function assessment.
[0003] The image processing-based thyroid calcification detection method refers to automatically detecting and identifying calcified areas within the thyroid gland by processing thyroid ultrasound images. This patent primarily addresses the automatic identification of calcifications in thyroid ultrasound images, using image segmentation and feature extraction techniques to label calcified areas in the images. By preprocessing the image data to remove noise and enhance the contrast of the region of interest, a specific algorithm is then used to segment the image, accurately extracting the calcified areas and distinguishing them from normal tissue. This method further utilizes feature analysis to evaluate the morphological characteristics of the calcified areas, providing auxiliary diagnostic information for clinical practice.
[0004] Existing technologies for processing thyroid ultrasound images have certain limitations, primarily in image preprocessing and the accuracy of calcification region segmentation. Traditional methods typically rely on simple image denoising algorithms, failing to adapt to the specific characteristics of different images. This results in ineffective suppression of background noise, affecting the clear extraction of calcified regions. The calculation of grayscale differences relies too heavily on basic threshold settings, making it insufficient for recognizing subtle changes in complex images and prone to overlooking edge details or introducing errors in the definition of calcified regions. During segmentation, existing technologies lack precision in boundary identification, frequently resulting in missed detections or incorrect segmentation. Due to insufficient consideration of grayscale variations and gradient information between pixels, the boundaries of calcified regions often appear blurred or discontinuous. Furthermore, existing technologies have limited effectiveness in handling artifact interference, lacking precise identification of artifact regions in the image and failing to effectively avoid the influence of artifacts on the final detection results. These problems mean that existing technologies often fail to provide sufficiently accurate calcification detection results in practical applications, especially in cases of poor image quality or complex disease characteristics, limiting their widespread clinical application and reliability. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a method and system for detecting thyroid calcification based on image processing.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a thyroid calcification detection method based on image processing, comprising the following steps:
[0007] S1: Divide the ultrasound image of the thyroid region into equal regions according to a fixed pixel grid, calculate the local contrast intensity and edge tendency based on the gray difference, screen the gray variation region, record the gradient continuity edge pixel group as the feature point set, and generate the image boundary response region set.
[0008] S2: Based on the image boundary response region set, extract the edge gradient direction, calculate the angle fluctuation value, filter segments and detect frequency differences, perform edge smoothing operation to align pixel grayscale mean, and generate artifact interference suppressed image frames.
[0009] S3: Based on the artifact interference suppressed image frame, extract the start and end points of the edge curve, calculate the length ratio and filter the closed curves, compare the gray level difference, and obtain the calcified boundary closed region.
[0010] S4: Based on the closed region of the calcification boundary, collect the gray value within the contour, evaluate the gray concentration through a sliding window, select window blocks that exceed the tolerance threshold as target units, and mark their positions and affiliations to generate a list of calcification structure recognition units;
[0011] S5: Based on the list of calcification structure recognition units, the segments that meet the calcification imaging conditions are selected by combining the image frame position index and the area ratio and grayscale concentration stability, and the calcification detection results are obtained.
[0012] As a further aspect of the present invention, the image boundary response region set is a grid region, a gradient continuity edge pixel group, and a feature point set; the artifact interference suppression image frame includes the edge smoothing processing result and the artifact interference suppression effect; the calcification boundary closed region is the calcification outer boundary, the gray-level difference of the closed region, and the calcification boundary standard; the calcification structure identification unit list includes the structural target unit, gray-level concentration, unit position and attribution relationship; and the calcification detection result is a segment that meets the calcification imaging conditions, the closure integrity, and the gray-level concentration stability standard segment.
[0013] As a further aspect of the present invention, the specific steps for dividing the ultrasound image of the thyroid region into equally divided regions according to a fixed pixel grid, calculating the local contrast intensity and edge tendency based on gray-level difference, screening gray-level variation regions, recording gradient continuity edge pixel groups as feature point sets, and generating an image boundary response region set are as follows:
[0014] S101: Divide the ultrasound image of the thyroid region into grid regions according to a set pixel spacing, calculate the gray level difference between adjacent pixels in the horizontal and vertical directions within each grid, and generate local contrast intensity values based on the gray level difference sequence.
[0015] S102: Based on the comparison between the local contrast intensity value and the overall gray median difference of the image, filter out grid areas where the gray change amplitude exceeds the median difference, extract and record the edge pixel groups in the area, and generate edge tendency pixel distribution values.
[0016] S103: Based on the sequence of pixels with consistent direction and connected edges in the edge tendency pixel distribution value, record the position of the points, merge the edge pixels, and generate an image boundary response region set.
[0017] As a further aspect of the present invention, based on the image boundary response region set, the specific steps for extracting the edge gradient direction, calculating the included angle fluctuation value, filtering segments and detecting frequency differences, performing edge smoothing operation to align pixel grayscale mean values, and generating artifact interference suppressed image frames are as follows:
[0018] S201: Based on the image boundary response region set, extract the gradient direction of the edge pixels in each region, obtain the gradient value of each edge pixel, and calculate the gradient direction angle fluctuation value between adjacent pixels. By comparing the fluctuation value with the set angle change range threshold, filter out segments that exceed the threshold and generate edge direction fluctuation value segments.
[0019] S202: Based on the edge direction fluctuation value segment, detect the degree of difference between the gray frequency change value in the segment area and the gray distribution stability of the neighborhood; based on the calculation of the difference between the gray frequency value and the stability, determine the boundary of the gradient stability interval of the difference value, and generate the difference value judgment segment.
[0020] S203: Based on the difference value determination segment, perform edge smoothing operation with pixel grayscale mean alignment. Adjust the grayscale value of each pixel by calculating the grayscale mean, perform edge alignment smoothing operation, and generate an image frame with artifact interference suppression.
[0021] As a further aspect of the present invention, the formula for calculating the grayscale mean is as follows:
[0022]
[0023] Among them, I new (x,y) represents the gray value at position (x,y) in the smoothed image, I(x+i,y+j) represents the gray value at position (x+i,y+j) in the image, N is the size of the convolution kernel, and k represents the radius of the convolution kernel. This represents the summation of all pixel values within the convolution kernel region.
[0024] As a further aspect of the present invention, based on the artifact interference suppressed image frame, the specific steps for extracting the start and end points of the edge curves, calculating the length ratio and filtering closed curves, and comparing the grayscale difference to obtain the calcified boundary closed region are as follows:
[0025] S301: Based on the artifact interference suppression image frame, extract the start and end pixels of all edge curves, calculate the ratio of the length of the curve to the straight-line distance between the endpoints, filter curves that are close to a closed state by the ratio, and generate closed curve features.
[0026] S302: Based on the closed curve features, extract the average gray value of the region enclosed by the closed curve and the gradient difference of gray value change at the curve boundary. By calculating and comparing the threshold standard, filter out regions that meet the standard and generate candidate regions for calcification boundaries.
[0027] S303: Based on the candidate calcification boundary region, analyze the outer boundary of calcification and generate a closed calcification boundary region;
[0028] As a further aspect of the present invention, the formula for calculating the ratio of the length of the curve to the straight-line distance between the endpoints is as follows:
[0029]
[0030] Among them, R i L represents the ratio of the length of the i-th edge curve to the straight-line distance between its endpoints. i D represents the total path length of the i-th edge curve along all pixels. i γ represents the Euclidean linear distance between the starting and ending pixels of the i-th edge curve. i n represents the local curvature adjustment coefficient of the i-th curve. i This represents the total number of pixels on the i-th curve, (x j ,y j ) represents the coordinates of the j-th pixel on the i-th curve.
[0031] As a further aspect of the present invention, based on the closed region of the calcification boundary, grayscale values within the contour are collected, grayscale concentration is evaluated through a sliding window, window blocks exceeding the tolerance threshold are selected as target units, and their positions and affiliations are marked to generate a list of calcification structure recognition units. The specific steps are as follows:
[0032] S401: Based on the set of closed regions of the calcified boundary, collect the gray values of all pixels within the closed contour range, calculate the gray concentration of the units inside the window, and generate the gray concentration value by calculating the concentration of each window.
[0033] S402: Based on the grayscale concentration value, determine the window block whose concentration reaches the unified difference threshold, identify it as a structural target unit, mark the position of each target unit and its belonging relationship in the contour structure, and generate a target unit label set;
[0034] S403: Based on the target unit tag set, list the location and affiliation of each structural target unit to obtain a list of calcification structure identification units.
[0035] As a further aspect of the present invention, based on the list of calcification structure recognition units, the segments that meet the calcification imaging conditions are selected by combining and labeling according to the image frame position index, and by combining the area ratio and grayscale concentration stability, in order to obtain the calcification detection results, the specific steps are as follows:
[0036] S501: Based on the list of calcification structure recognition units, the units are combined and labeled according to their position index in the image frame. By merging the units within the labeled interval, a combined labeled area is generated.
[0037] S502: Based on the combined labeled area, perform area ratio determination, compare the area ratio within the area with the boundary ratio, filter areas that meet the conditions, and generate area determination areas;
[0038] S503: Based on the area determination region, combined with the contour closure integrity and grayscale concentration stability, segments that meet the calcification imaging conditions are selected to obtain calcification detection results.
[0039] A thyroid calcification detection system based on image processing, comprising:
[0040] The image partitioning module divides thyroid ultrasound images based on a fixed pixel grid, calculates the gray-level difference of continuous pixels in the horizontal and vertical directions within each grid, obtains the local contrast intensity and edge tendency values, filters out grid regions where gray-level variation exceeds the median difference range, records edge pixel groups, and generates a set of image boundary response regions.
[0041] The artifact suppression module calculates the angle fluctuation value based on the image boundary response region set, filters regions where the fluctuation exceeds the set range, identifies artifact interference areas by gray-level frequency changes and neighborhood gray-level differences, performs gray-level mean alignment and smoothing operation, and generates artifact-suppressed image frames.
[0042] The calcification region identification module extracts the start and end pixels of the edge curve based on the artifact-suppressed image frame, calculates the ratio of the length to the straight-line distance between the start and end points, filters closed curves and compares gray-level changes, determines the region that meets the calcification standard as the outer boundary of calcification, and generates the calcification region boundary.
[0043] The target unit identification module calculates the grayscale concentration by sliding window based on the pixel grayscale values within the boundary of the calcified region, filters out windows that exceed the difference threshold as structural target units, marks the unit position and belonging relationship, and generates a list of calcified structural target units.
[0044] The calcification imaging determination module, based on the list of target units of calcified structures, marks the regions by location index, calculates the area ratio, and combines contour closure and grayscale stability to screen segments that meet the imaging conditions, thereby obtaining the calcification detection results.
[0045] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0046] In this invention, the detection accuracy of calcified regions in thyroid ultrasound images is improved through gridding processing and grayscale difference analysis. By analyzing the gradient direction and angle changes of edge pixels, artifact interference is effectively suppressed, ensuring accurate boundaries of calcified regions. The identification of closed curves enhances boundary extraction and avoids curve blurring. Grayscale concentration and stability analysis makes the identification of calcified structures more stable and reliable, improving detection accuracy, adapting to different image qualities and disease types, and enhancing clinical diagnostic support capabilities. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a schematic diagram of the steps of the present invention;
[0049] Figure 2 This is a system module diagram of the present invention. Detailed Implementation
[0050] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0051] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0052] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, their intended meanings are consistent. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, their intended meanings are consistent.
[0053] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0054] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0055] This invention provides an image processing-based method for detecting thyroid calcifications, comprising the following steps:
[0056] S1: Divide the ultrasound image of the thyroid region into equal regions according to a fixed pixel grid. Based on the continuous pixel gray-level difference in the horizontal and vertical directions in each grid, calculate the local contrast intensity and edge tendency value, and compare it with the overall gray-level median difference of the image. Filter the grid regions where the gray-level variation exceeds the median difference level, record the edge pixel group with gradient continuity in the region as the feature point set, and generate the image boundary response region set.
[0057] S2: Based on the image boundary response region set, extract the gradient direction of the edge pixels in each region, and calculate the angle fluctuation value between adjacent pixels. Based on the continuity of the edge direction, filter the segments whose fluctuation value exceeds the angle change range, detect the degree of difference between the gray frequency change value in the segment region and the gray distribution stability of the neighborhood, and determine the segment whose difference value crosses the gradient stability interval as the artifact interference region. Perform the edge smoothing operation of pixel gray mean alignment to generate artifact interference suppressed image frame.
[0058] S3: Based on the image frame with artifact interference suppression, extract the start and end pixels of all edge curves, calculate the ratio of curve length to straight-line distance between endpoints, filter curves with ratios close to closed feature intervals, call the average gray value of the area enclosed by the closed curve and the gradient difference of gray value change of the curve boundary, compare the area with the threshold standard as the calcification outer boundary, and generate the calcification boundary closed area.
[0059] S4: Based on the set of closed regions of calcification boundary, collect the gray values of all pixels within the closed contour range, calculate the gray concentration of the internal units by sliding the window of fixed size, and determine the window blocks whose concentration reaches a unified difference threshold as structural target units. Mark the unit position and the belonging relationship in the contour structure, and generate a list of calcification structure recognition units.
[0060] S5: Based on the list of calcification structure recognition units, the units are combined and labeled according to their position index in the image frame. The area ratio of the continuously labeled areas is judged, and the integrity of the contour closure and the stability of gray-level concentration are combined to determine whether the area meets the calcification imaging conditions. Index segments that meet the standards are selected to obtain the calcification detection results.
[0061] The image boundary response region set consists of grid regions, gradient continuity edge pixel groups, and feature point sets. The artifact interference suppression image frame includes the edge smoothing processing results and artifact interference suppression effect. The calcification boundary closed region consists of the calcification outer boundary, gray-level difference of the closed region, and calcification boundary standard. The calcification structure identification unit list includes the structural target unit, gray-level concentration, unit location and attribution relationship. The calcification detection result consists of segments that meet the calcification imaging conditions, closure integrity, and gray-level concentration stability standard segments.
[0062] The specific steps of S1 are as follows:
[0063] S101: Divide the ultrasound image of the thyroid region into grid regions according to a set pixel spacing, calculate the gray level difference between adjacent pixels in the horizontal and vertical directions within each grid, and generate local contrast intensity values based on the gray level difference sequence.
[0064] First, the ultrasound image of the thyroid region is processed to remove noise. This can be done through basic image processing steps to remove background noise and enhance image contrast. Next, the image is divided into grid regions according to a set pixel spacing. A 10x10 pixel grid is selected, with each grid containing multiple adjacent pixels. For each pixel within a grid, the gray-level difference between adjacent pixels in the horizontal and vertical directions is calculated. For example, if a pixel in a grid has a gray-level value of 150 and its right-hand neighbor has a gray-level value of 145, the horizontal gray-level difference is 5. Similarly, the vertical gray-level difference is calculated. These gray-level differences form a sequence, and then the local contrast intensity value of the grid is obtained by calculating the standard deviation or average of these differences. If the gray-level difference sequence of a grid is [5,3,4,6], then the local contrast intensity value may be 1.41, which can identify areas with high contrast in the image and help detect abnormal lesions in the thyroid region.
[0065] S102: Based on the comparison between the local contrast intensity value and the overall gray level median difference of the image, the grid areas with gray level changes exceeding the median difference are selected, the edge pixel groups in the area are extracted and recorded, and the edge tendency pixel distribution value is generated.
[0066] First, the median grayscale difference of the entire image is calculated. The median grayscale difference refers to the difference between the median grayscale value of all pixels in the entire image and its median value. For example, assuming the grayscale values of an image are [120, 130, 140, 150, 160], and the median is 140, then the median difference is the difference between 140 and other pixel values. Next, the local contrast intensity values of each grid region are compared with the overall median grayscale difference of the image, and grid regions whose local contrast intensity values exceed a certain threshold of the overall median grayscale difference are selected. For example, if the median grayscale difference of the image is 15, and the local contrast intensity of a certain grid is 20, then the contrast intensity of that grid is greater than the median difference threshold and is therefore selected. This selection method can identify areas with large grayscale variations, which may contain more information and details, and are particularly important for the identification of thyroid lesions. In practical applications, the threshold is set based on the overall grayscale difference of the image, and an appropriate median difference threshold can be set using overall image statistics.
[0067] S103: Based on the sequence of pixels with consistent direction and edge connection in the edge tendency pixel distribution value, record the position of the points, merge edge pixels, and generate an image boundary response region set;
[0068] First, pixels with significant grayscale variations within a region are detected to determine if they belong to edges. In a given grid, if the grayscale difference of a pixel exceeds a set threshold, that pixel is considered an edge pixel. Then, by analyzing the relative positions and orientations of these edge pixels, if they exhibit a consistent orientation and their connections are uninterrupted, these edge pixels can be merged into a continuous edge line. For example, if several consecutive pixels in a grid show similar grayscale differences and their orientations are consistent, these points will be grouped into the same edge line, and their positions will be recorded. Through this process, edge pixels can be merged to form continuous edge response regions. These sets of edge response regions can help further analyze the boundaries of the thyroid region and identify potentially abnormal tissue or lesions.
[0069] The specific steps of S2 are as follows:
[0070] S201: Based on the image boundary response region set, extract the gradient direction of edge pixels in each region, obtain the gradient value of each edge pixel, and calculate the fluctuation value of the gradient direction angle between adjacent pixels. By comparing the fluctuation value with the set angle change range threshold, filter the segments that exceed the threshold and generate edge direction fluctuation value segments.
[0071] First, extract the edge pixels in each region one by one. For each edge pixel, calculate the grayscale difference in the horizontal and vertical directions. For example, if the grayscale value of a pixel is 110 on the left and 140 on the right, the horizontal grayscale difference is 30. Similarly, if the grayscale value is 120 on the top and 135 on the bottom, the vertical grayscale difference is 15. Then, based on the horizontal and vertical grayscale differences, determine the direction of grayscale change of the pixel, i.e., the gradient direction, by calculating the ratio of the two. Subsequently, calculate the gradient intensity value of the pixel, which can be obtained by taking the square root of the sum of the squares of the horizontal and vertical grayscale differences. For example, when the grayscale difference is 30 and 15, the corresponding gradient intensity is approximately 33.54. Then, for the same region... The gradient direction of edge pixels is recorded. Next, the angle difference between the gradient directions of two adjacent edge pixels is calculated to obtain the angular fluctuation value of the gradient direction. For example, if the gradient directions of two pixels are 45 degrees and 60 degrees respectively, the angular fluctuation value is 15 degrees. These fluctuation values are compared with a set threshold for the angle change range. If the fluctuation value is greater than the set threshold, the segment is filtered out. The method of setting the threshold can refer to the edge change pattern in the actual image. In thyroid ultrasound images, the angle fluctuation threshold is often set between 10 degrees and 20 degrees. If the gradient direction difference between a pixel and its adjacent points exceeds 15 degrees, it is considered to have significant fluctuation. The fluctuation segment is marked, thereby generating an edge direction fluctuation value segment.
[0072] S202: Based on edge direction fluctuation value segments, detect the degree of difference between the gray frequency change value in the segment area and the stability of the gray distribution in the neighborhood. Based on the calculation of the difference between the gray frequency value and the stability, determine the boundary of the gradient stability interval of the difference value and generate the difference value judgment segment.
[0073] First, the grayscale frequency distribution within the segment region is extracted, that is, the number of times different grayscale values appear in this region is counted. For example, in a 10x10 region, a pixel with a grayscale value of 130 appears 20 times, and a pixel with a grayscale value of 135 appears 25 times. The complete grayscale frequency distribution is recorded accordingly. Then, the stability of the grayscale distribution in the adjacent grid regions is counted. The stability is judged by calculating the degree of change in the grayscale frequency distribution in the adjacent grids. For example, if the frequency change of grayscale value from 130 to 135 in the adjacent region is less than 5 times, it can be regarded as a stable region. If the frequency difference in the current segment region is 20 times, it indicates that the difference is large. The absolute difference between the grayscale frequency difference and the neighborhood stability difference is calculated, and then the difference value is judged against the set gradient stability interval boundary. If the difference value exceeds the set range, it indicates that there is an abnormal change in this region. This range can be obtained through a large number of samples. For example, if the gradient stability difference boundary value is set to 15, and the difference value of a certain region is 18, it is judged as an abnormal segment and marked as a difference value judgment segment.
[0074] S203: Based on the difference value, determine the segment, perform edge smoothing operation with pixel grayscale mean alignment, adjust the grayscale value of each pixel by calculating the grayscale mean, perform edge alignment smoothing operation, and generate image frames with artifact interference suppression.
[0075] The specific formula for calculating the grayscale mean is as follows:
[0076]
[0077] Among them, I new (x,y) represents the gray value at position (x,y) in the smoothed image, I(x+i,y+j) represents the gray value at position (x+i,y+j) in the image, N is the size of the convolution kernel, and k represents the radius of the convolution kernel. This represents the summation of all pixel values within the convolution kernel region;
[0078] Assuming a 3x3 convolution kernel is chosen and k=1, then N=9, meaning that each pixel has 9 surrounding pixels that participate in the calculation of the gray-level mean. At a certain position (x,y) in the image, the mean gray-level value of the 9 pixels surrounding that position will be calculated.
[0079] The calculation process of the formula is as follows:
[0080] Select a target pixel position (x, y), for example, the position is (5, 5);
[0081] Choose a 3x3 convolution kernel and use the target pixel position (x,y) as the center of the convolution kernel;
[0082] Collect the grayscale values of neighboring pixels, i.e., the image location:
[0083] Gray values at (4,4),(4,5),(4,6),(5,4),(5,5),(5,6),(6,4),(6,5),(6,6);
[0084] Assuming the grayscale values of these pixels are 120, 130, 125, 110, 115, 120, 135, 140, 145; calculate the mean of these grayscale values:
[0085]
[0086] The smoothed target pixel grayscale value is 108.89;
[0087] The results show that after calculating the gray-level average of neighboring pixels, the gray-level value at the target location (5,5) was adjusted from the original value (assumed to be 115) to 108.89. This process reduces the impact of image details or noise by averaging the gray-level values of the area surrounding the target pixel, resulting in a smoothed image.
[0088] The specific steps for S3 are as follows:
[0089] S301: Based on the image frame with artifact interference suppression, extract the start and end pixels of all edge curves, calculate the ratio of the length of the curve to the straight-line distance between the endpoints, filter curves that are close to a closed state by the ratio, and generate closed curve features.
[0090] The formula for calculating the ratio of the curve's length to the straight-line distance between its endpoints is as follows:
[0091]
[0092] Among them, R i L represents the ratio of the length of the i-th edge curve to the straight-line distance between its endpoints. i D represents the total path length of the i-th edge curve along all pixels. i γ represents the Euclidean linear distance between the starting and ending pixels of the i-th edge curve. i n represents the local curvature adjustment coefficient of the i-th curve. i This represents the total number of pixels on the i-th curve, (x j ,y j () represents the coordinates of the j-th pixel on the i-th curve;
[0093] Assuming the above γ i =0.5, now calculate R i :
[0094] First, calculate the path length L. i :
[0095] (x1,y1)=(1,1);
[0096] (x2,y2)=(2,2);
[0097] (x3,y3)=(4,4);
[0098]
[0099] Then calculate the distance D between the endpoints. i :
[0100]
[0101] Next, calculate the local curvature term:
[0102]
[0103] Finally, calculate R. i :
[0104]
[0105] The results show that the curve under investigation has a relatively high degree of approximation to closure compared to a fully closed curve. This means that the curve visually approximates forming a closed loop, which is crucial for image processing steps such as shape analysis and object recognition. This ratio R... i It can be used to filter and identify nearly closed edge curves, thereby enabling more complex image processing operations.
[0106] S302: Based on the closed curve feature, extract the average gray value of the region enclosed by the closed curve and the gradient difference of gray value change at the curve boundary. By calculating and comparing the threshold standard, filter the regions that meet the standard and generate candidate regions for calcification boundaries.
[0107] First, extract the average grayscale value within the closed region enclosed by each closed curve. This is done by summing the grayscale values of all pixels within the closed region and dividing by the number of pixels in that region. For example, if a region contains 100 pixels and the sum of its grayscale values is 13500, then the average grayscale value is 135. Simultaneously, extract the boundary pixels of the closed curve and calculate the gradient difference in grayscale changes among these boundary pixels. This gradient difference is obtained by performing grayscale difference calculations on each boundary pixel and its adjacent pixels, then finding the difference between the maximum and minimum differences. For example... If the boundary grayscale difference is [10, 15, 12, 8], then the maximum value is 15, the minimum value is 8, and the gradient difference is 7. Then, the average grayscale value and the gradient difference are combined and compared with the set threshold standard. The threshold standard is set as an average grayscale value of not less than 120 and a gradient difference of not less than 5. If the average grayscale value of a certain area is 135 and the gradient difference is 7, then both of the above judgment conditions are met at the same time, and the area is selected as a standard area. Finally, all areas that meet the set standards of average grayscale value and boundary grayscale gradient difference are marked as calcification boundary candidate areas.
[0108] S303: Based on the candidate regions of calcification boundaries, analyze the outer boundary of calcification and generate closed regions of calcification boundaries;
[0109] First, extract the coordinates of all pixels along the outer boundary of the region and determine whether there are continuous gaps between the pixels. If there are discontinuous edges, fill in the missing pixels. For example, if the interval between adjacent pixels exceeds one pixel unit, it is considered a break. If the coordinates of two boundary points are 20 horizontally and 30 vertically and 23 horizontally and 30 vertically, and the horizontal distance is 3 units, then pixels with horizontal coordinates of 21 and 22 need to be inserted in the middle to fill in the continuous boundary. Continue to check whether the boundary is in a closed state. By judging whether the distance between the first and last pixels is less than or equal to two pixel units, if it is, it is considered closed; otherwise, it is filled in and connected. Finally, complete the continuous closed boundary of all boundary contours that meet the conditions, and after summarizing, form a calcified boundary closed region.
[0110] The specific steps of S4 are as follows:
[0111] S401: Based on the set of closed regions with calcified boundaries, collect the gray values of all pixels within the closed contour range, calculate the gray concentration of units inside the window, and generate gray concentration values by calculating the concentration of each window.
[0112] First, the grayscale values of all pixels within the region are collected. During the collection process, the grayscale value of each pixel is recorded, and these grayscale values are categorized according to their respective windows. The size of each window can be set to, for example, a 10x10 pixel area. The concentration of the pixel grayscale values within the window is then calculated. Concentration is defined as the degree of variation in pixel grayscale values within the window. Lower concentration indicates small grayscale differences and a more uniform image; higher concentration indicates large grayscale differences and distinct boundaries within the image. For example, in a certain window, if all pixel grayscale values are 130, the concentration is 0; if the grayscale values vary between 120 and 140, the concentration is higher. Concentration can be calculated by taking the difference between each pixel value within the window and the average grayscale value within the window, then summing the squares of these differences, and calculating the standard deviation to obtain the concentration value. For example, if the grayscale values within a window are [120, 125, 130, 135, 140], the average is 130, the differences are [10, 5, 0, 5, 10], and the standard deviation is 4.47, then the concentration of that window is 4.47. This method is used to calculate the concentration of each window and generate a concentration value for each window for subsequent processing.
[0113] S402: Based on the grayscale concentration value, determine the window block whose concentration reaches the uniform difference threshold and identify it as a structural target unit. Mark the position of each target unit and its belonging relationship in the contour structure, and generate a target unit label set.
[0114] First, a uniform difference threshold is set, for example, a threshold of 5. Windows with a concentration value below 5 are considered uniform regions, while windows with a concentration value above 5 are considered regions with significant differences. By comparing the concentration value of each window with the set threshold, if the concentration value of a window reaches or exceeds the threshold, the window is identified as a structural target unit. For example, if the concentration value of a window is 6, this window meets the threshold criterion and is marked as a target unit; while if the concentration value of another window is 4, it does not meet the threshold requirement and is not identified as a target unit. Subsequently, the position of each target unit and its belonging relationship in the overall contour are marked, that is, determining which closed contour part the target unit belongs to. In this way, all windows that meet the concentration threshold are identified as target units, and a target unit label set is generated. This label set contains the specific position and belonging information of all windows identified as structural target units for subsequent structural analysis.
[0115] S403: Based on the target unit tag set, list the location and affiliation of each structural target unit to obtain a list of calcification structure identification units;
[0116] First, based on the labeling information of each target unit, the location information and its association with each structural target unit are listed. This means recording the location coordinates of each target unit and associating it with the calcified region to which it belongs. For example, if the target unit's coordinates in the image are (50, 60), and it belongs to a specific region within the calcified boundary, then it is labeled as part of that region. In this way, a list of calcified structure identification units can be generated, which details the location, association with, and related information of all target units with the calcified region, providing useful data support for further analysis of the calcified structure.
[0117] The specific steps of S5 are as follows:
[0118] S501: Based on the list of calcification structure recognition units, the units are combined and labeled according to their position index in the image frame. By merging units within the labeled interval, a combined labeled area is generated.
[0119] First, each structural target unit is indexed based on its position in the image frame, and these target units are sorted by position. Then, the target units are grouped and labeled according to the sorting result. This process requires reading the position coordinates of each target unit one by one and determining its corresponding interval in the image frame. For example, if the coordinates of target units in a certain region are (50,60), (55,60), and (60,60), these units form a combined interval. Then, all target units within this interval are merged into a combined labeled region. The selection of the labeled interval is based on the spatial relationship of the target units. If the distance between two target units is less than a set threshold (e.g., 10 pixels), they can be considered to belong to the same combined region. In practical scenarios, setting an appropriate distance threshold is crucial. For example, if the distance threshold is set to 10 pixels, the distance between target units (50,60) and (55,60) is 5 pixels, which meets the threshold condition, and the two are merged into one region to form a combined labeled region. In this way, multiple target units can be accurately classified into a single combined labeled region.
[0120] S502: Based on the combined labeled area, perform area ratio judgment, compare the area ratio of the area within the area with the boundary ratio, filter the areas that meet the conditions, and generate the area judgment area;
[0121] First, the area of each combined annotation region is calculated. This area can be obtained by counting the number of pixels within the region. For example, if a combined annotation region has 150 pixels, its area is 150 pixel units. Next, the boundary length of the region is calculated by measuring the number of pixels at the region's edges. For example, if the boundary of a region consists of 20 pixels, its boundary length is 20 pixels. Then, a standard is set by comparing the ratio of the region's area to its boundary length. For example, if the threshold for the area-to-boundary ratio is set to 5, and a region has an area of 150 and a boundary length of 20, its area-to-boundary ratio is 150 ÷ 20 = 7.5, which meets the ratio standard. Therefore, if the ratio is greater than the set threshold, the region is selected as a qualified region. For example, if a region has an area of 120 and a boundary length of 30 pixels, the ratio is 120 ÷ 30 = 4, which does not meet the set ratio standard and cannot be selected as a qualified region. Finally, through this selection process, regions that meet the area-to-boundary ratio condition can be accurately identified, generating area determination regions.
[0122] S503: Based on the area determination region, combined with the integrity of the contour closure and the stability of gray-level concentration, the fragments that meet the calcification imaging conditions are selected to obtain the calcification detection results;
[0123] First, the outline of each area is checked for closure. The closure integrity is determined by checking if the boundary pixels within the area can be seamlessly connected. If the distance between the start and end points of a boundary pixel is less than a set threshold (e.g., 5 pixels), the area is considered closed. Second, the grayscale stability within the area is analyzed. Grayscale stability is evaluated by calculating the range of grayscale value changes for all pixels within the area. If the grayscale difference within the area is small, the area is considered grayscale stable; if the grayscale value changes significantly, the area is considered grayscale unstable. For example, if the grayscale value range of an area is [120, 125, 130, 135], the grayscale variation range is 15. If this value exceeds a set threshold (e.g., 10), the area is considered grayscale unstable. Combining these two criteria—closure integrity and grayscale stability—fragments that meet the calcification imaging conditions are selected, ultimately yielding the calcification detection result. For example, if the closure of an area meets the criteria and the grayscale stability is good, the area is determined to meet the calcification imaging conditions, and the calcification detection result is output.
[0124] Please see Figure 2 A thyroid calcification detection system based on image processing, comprising:
[0125] The image partitioning module divides thyroid ultrasound images based on a fixed pixel grid, calculates the gray-level difference of continuous pixels in the horizontal and vertical directions within each grid, obtains the local contrast intensity and edge tendency values, filters out grid regions where gray-level variation exceeds the median difference range, records edge pixel groups, and generates a set of image boundary response regions.
[0126] The artifact suppression module calculates the angle fluctuation value based on the image boundary response region set, filters regions whose fluctuation exceeds the set range, identifies artifact interference areas by gray-level frequency changes and neighborhood gray-level differences, performs gray-level mean alignment and smoothing operation, and generates artifact-suppressed image frames.
[0127] The calcification region identification module is based on artifact-suppressed image frames. It extracts the start and end pixels of the edge curves, calculates the ratio of the length to the straight-line distance between the start and end points, filters closed curves and compares gray-level changes, determines the region that meets the calcification standard as the outer boundary of calcification, and generates the calcification region boundary.
[0128] The target unit identification module calculates the grayscale concentration based on the pixel grayscale values within the boundary of the calcified region using a sliding window, filters out windows that exceed the difference threshold as structural target units, marks the unit location and attribution relationship, and generates a list of calcified structural target units.
[0129] The calcification imaging determination module uses a list of target units of calcified structures to mark regions by location index, calculates the area ratio, and combines contour closure and grayscale stability to screen segments that meet the imaging conditions, thus obtaining the calcification detection results.
[0130] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting thyroid calcification based on image processing, characterized in that, Includes the following steps: S1: Divide the ultrasound image of the thyroid region into equal regions according to a fixed pixel grid, calculate the local contrast intensity and edge tendency based on the gray difference, screen the gray variation region, record the gradient continuity edge pixel group as the feature point set, and generate the image boundary response region set. S2: Based on the image boundary response region set, extract the edge gradient direction, calculate the angle fluctuation value, filter segments and detect frequency differences, perform edge smoothing operation to align pixel grayscale mean, and generate artifact interference suppressed image frames. S3: Based on the artifact interference suppressed image frame, extract the start and end points of the edge curve, calculate the length ratio and filter closed curves, compare the gray level difference, and obtain the calcified boundary closed region. S4: Based on the closed region of the calcification boundary, collect the gray value within the contour, evaluate the gray concentration through a sliding window, select window blocks that exceed the tolerance threshold as target units, and mark their positions and affiliations to generate a list of calcification structure recognition units.
2. The image processing-based thyroid calcification detection method according to claim 1, characterized in that: The image boundary response region set includes a grid region, a gradient continuity edge pixel group, and a feature point set. The artifact interference suppression image frame includes the edge smoothing processing result and the artifact interference suppression effect. The calcification boundary closed region includes the calcification outer boundary, the gray level difference of the closed region, and the calcification boundary standard. The calcification structure recognition unit list includes the structural target unit, gray level concentration, unit position, and attribution relationship.
3. The image processing-based thyroid calcification detection method according to claim 1, characterized in that: The specific steps for dividing the ultrasound image of the thyroid region into equal areas using a fixed pixel grid, calculating local contrast intensity and edge tendency based on gray-level difference, screening areas of gray-level variation, recording gradient continuity edge pixel groups as feature point sets, and generating the image boundary response region set are as follows: S101: Divide the ultrasound image of the thyroid region into grid regions according to a set pixel spacing, calculate the gray level difference between adjacent pixels in the horizontal and vertical directions within each grid, and generate local contrast intensity values based on the gray level difference sequence. S102: Based on the comparison between the local contrast intensity value and the overall gray median difference of the image, filter out grid areas where the gray change amplitude exceeds the median difference, extract and record the edge pixel groups in the area, and generate edge tendency pixel distribution values. S103: Based on the sequence of pixels with consistent direction and connected edges in the edge tendency pixel distribution value, record the position of the points, merge the edge pixels, and generate an image boundary response region set.
4. The image processing-based thyroid calcification detection method according to claim 1, characterized in that, Based on the image boundary response region set, the specific steps for extracting edge gradient directions, calculating angle fluctuation values, filtering segments and detecting frequency differences, performing edge smoothing operations to align pixel grayscale averages, and generating artifact interference suppressed image frames are as follows: S201: Based on the image boundary response region set, extract the gradient direction of the edge pixels in each region, obtain the gradient value of each edge pixel, and calculate the gradient direction angle fluctuation value between adjacent pixels. By comparing the fluctuation value with the set angle change range threshold, filter out segments that exceed the threshold and generate edge direction fluctuation value segments. S202: Based on the edge direction fluctuation value segment, detect the degree of difference between the gray frequency change value in the segment area and the gray distribution stability of the neighborhood; based on the calculation of the difference between the gray frequency value and the stability, determine the boundary of the gradient stability interval of the difference value, and generate the difference value judgment segment. S203: Based on the difference value determination segment, perform edge smoothing operation with pixel grayscale mean alignment. Adjust the grayscale value of each pixel by calculating the grayscale mean, perform edge alignment smoothing operation, and generate an image frame with artifact interference suppression.
5. The image processing-based method for detecting thyroid calcification according to claim 1, characterized in that, The specific formula for calculating the grayscale mean is as follows: Among them, I new (x,y) represents the gray value at position (x,y) in the smoothed image, I(x+i,y+j) represents the gray value at position (x+i,y+j) in the image, N is the size of the convolution kernel, and k represents the radius of the convolution kernel. This represents the summation of all pixel values within the convolution kernel region.
6. The image processing-based method for detecting thyroid calcification according to claim 1, characterized in that, Based on the artifact-suppressed image frame, the specific steps for extracting the start and end points of edge curves, calculating the length ratio and filtering closed curves, and comparing grayscale differences to obtain the closed region of calcification boundary are as follows: S301: Based on the artifact interference suppression image frame, extract the start and end pixels of all edge curves, calculate the ratio of the length of the curve to the straight-line distance between the endpoints, filter curves that are close to a closed state by the ratio, and generate closed curve features. S302: Based on the closed curve features, extract the average gray value of the region enclosed by the closed curve and the gradient difference of gray value change at the curve boundary. By calculating and comparing the threshold standard, filter out regions that meet the standard and generate candidate regions for calcification boundaries. S303: Based on the candidate regions of calcification boundary, analyze the outer boundary of calcification and generate a closed region of calcification boundary.
7. The image processing-based method for detecting thyroid calcification according to claim 1, characterized in that, The formula for calculating the ratio of the curve length to the straight-line distance between its endpoints is as follows: Among them, R i L represents the ratio of the length of the i-th edge curve to the straight-line distance between its endpoints. i D represents the total path length of the i-th edge curve along all pixels. i γ represents the Euclidean linear distance between the starting and ending pixels of the i-th edge curve. i n represents the local curvature adjustment coefficient of the i-th curve. i This represents the total number of pixels on the i-th curve, (x j ,y j ) represents the coordinates of the j-th pixel on the i-th curve.
8. The image processing-based method for detecting thyroid calcification according to claim 1, characterized in that, Based on the closed region of the calcification boundary, gray values within the contour are collected, gray concentration is evaluated through a sliding window, window blocks exceeding the tolerance threshold are selected as target units, and their positions and affiliations are marked to generate a list of calcification structure recognition units. S401: Based on the set of closed regions of the calcified boundary, collect the gray values of all pixels within the closed contour range, calculate the gray concentration of the units inside the window, and generate the gray concentration value by calculating the concentration of each window. S402: Based on the grayscale concentration value, determine the window block whose concentration reaches the unified difference threshold, identify it as a structural target unit, mark the position of each target unit and its belonging relationship in the contour structure, and generate a target unit label set; S403: Based on the target unit tag set, list the location and affiliation of each structural target unit to obtain a list of calcification structure identification units.
9. The image processing-based method for detecting thyroid calcification according to claim 1, characterized in that, The method also Including, S5: Based on the list of calcification structure recognition units, the units are combined and labeled according to their position index in the image frame. The area ratio of the continuously labeled areas is determined. The region is judged to meet the calcification imaging conditions by combining the two standards of contour closure integrity and grayscale concentration stability. Index segments that meet the standards are selected to obtain the calcification detection results. The calcification detection results are segments that meet the calcification imaging conditions, closure integrity, and grayscale concentration stability standards. S501: Based on the list of calcification structure recognition units, the units are combined and labeled according to their position index in the image frame. By merging the units within the labeled interval, a combined labeled area is generated. S502: Based on the combined labeled area, perform area ratio determination, compare the area ratio within the area with the boundary ratio, filter areas that meet the conditions, and generate area determination areas; S503: Based on the area determination region, combined with the contour closure integrity and grayscale concentration stability, segments that meet the calcification imaging conditions are selected to obtain calcification detection results.
10. A thyroid calcification detection system based on image processing, characterized in that, The method for detecting thyroid calcification according to any one of claims 1-9 comprises the following modules: The image partitioning module divides thyroid ultrasound images based on a fixed pixel grid, calculates the gray-level difference of continuous pixels in the horizontal and vertical directions within each grid, obtains the local contrast intensity and edge tendency values, filters out grid regions where gray-level variation exceeds the median difference range, records edge pixel groups, and generates a set of image boundary response regions. The artifact suppression module calculates the angle fluctuation value based on the image boundary response region set, filters regions where the fluctuation exceeds the set range, identifies artifact interference areas by gray-level frequency changes and neighborhood gray-level differences, performs gray-level mean alignment and smoothing operation, and generates artifact-suppressed image frames. The calcification region identification module extracts the start and end pixels of the edge curve based on the artifact-suppressed image frame, calculates the ratio of the length to the straight-line distance between the start and end points, filters closed curves and compares gray-level changes, determines the region that meets the calcification standard as the outer boundary of calcification, and generates the calcification region boundary. The target unit identification module calculates the grayscale concentration by sliding window based on the pixel grayscale values within the boundary of the calcified region, filters out windows that exceed the difference threshold as structural target units, marks the unit position and belonging relationship, and generates a list of calcified structural target units. The calcification imaging determination module, based on the list of target units of calcified structures, marks the regions by location index, calculates the area ratio, and combines contour closure and grayscale stability to screen segments that meet the imaging conditions, thereby obtaining the calcification detection results.
Citation Information
Patent Citations
Medical image auxiliary labeling method and system based on image processing
CN119480023A
Intelligent optimization method for ultrasonic image quality enhancement
CN119599896A