Thyroid calcification detection method and system based on image processing
Through grid processing and grayscale difference analysis, combined with artifact inhibition and edge smoothing technology, the problem of inaccurate segmentation of calcified regions in thyroid ultrasound images is solved, and higher-precision calcification detection is achieved, adapting to different image quality and disease types, and enhancing clinical diagnostic support.
Patent Information
- Application Number
- CN202510465883.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-10
AI Technical Summary
The prior art has insufficient accuracy in segmentation of calcified areas in thyroid ultrasound images and is susceptible to noise and artifact interference, resulting in inaccurate detection results. Especially in the case of poor image quality or complex disease characteristics, reliable calcification detection cannot be provided.
Using an image processing-based method, the ultrasound image of the thyroid region is divided into fixed pixel grids, local contrast intensity and edge tendency are calculated, and the image boundary response area set is generated. Through artifact interference suppression and edge smoothing, the closed curve is extracted, and a list of calcification structure recognition units is generated based on grayscale concentration and stability analysis, and finally the calcification detection results are obtained.
It improves the detection accuracy of the calcified area in thyroid ultrasound imaging, inhibits artifact interference, ensures the accuracy of the boundaries of the calcified area, enhances the stability and adaptability of the detection, and improves the clinical diagnostic support capabilities.
Smart Images

Figure CN120374562A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and particularly to a thyroid calcification detection method and system based on image processing. Background Art
[0002] The technical field of medical image processing includes technologies for analyzing, processing, and interpreting image data obtained by medical imaging devices. The core content of this field involves analyzing and processing different types of medical image data, such as CT scans, MRI, ultrasound images, X-ray images, etc. The main task of medical image processing is to assist medical staff in early disease diagnosis, condition assessment, and treatment planning. By extracting and analyzing the detailed information in medical images, medical image processing technology can provide scientific basis and support for clinical medicine. This field involves technologies such as image preprocessing, feature extraction, image segmentation, and image fusion, and is widely applied in multiple medical fields such as cancer detection, lesion analysis, and organ function assessment.
[0003] Among them, the thyroid calcification detection method based on image processing refers to processing thyroid ultrasound images to automatically detect and identify calcified areas in the thyroid. The subject of this patent mainly aims at the automatic recognition of calcifications in thyroid ultrasound images, and uses image segmentation and feature extraction technologies to calibrate the calcified areas in the images. By preprocessing the image data, removing noise, and enhancing the contrast of the region of interest, a specific algorithm is then used to segment the image, accurately extract the calcified area, and distinguish it from normal tissues. This method further uses feature analysis to evaluate the morphological characteristics of the calcified area and provide auxiliary diagnostic information for clinical practice.
[0004] The existing technologies have certain limitations in processing thyroid ultrasound images, mainly reflected in image preprocessing and the accuracy of calcified area segmentation. Traditional methods usually rely on simple image denoising algorithms and fail to make personalized adjustments according to the specific characteristics of different images, resulting in ineffective suppression of background noise and affecting the clear extraction of calcified areas. The calculation of gray-scale differences relies too much on basic threshold settings, which makes the ability to recognize subtle changes in complex images insufficient, easily ignoring edge details or generating errors in the definition of calcified areas. During the segmentation process, the existing technologies do not accurately identify the boundaries, often resulting in missed detections or incorrect segmentations. Due to the failure to fully consider gray-scale changes and gradient information between pixels, the boundaries of calcified areas often appear blurred or discontinuous. In addition, the existing technologies have limited effects in dealing with artifact interference, lacking accurate identification of artifact areas in the image and being unable to effectively avoid the influence of artifacts on the final detection results. These problems lead to the fact that in practical applications, especially in cases with poor image quality or complex disease characteristics, the existing technologies often cannot provide sufficiently accurate calcification detection results, limiting their wide application and reliability in clinical practice. Summary of the Invention
[0005] The object of the present invention is to solve the drawbacks existing in the prior art, and to propose a thyroid calcification detection method and system based on image processing.
[0006] To achieve the above object, the present invention adopts the following technical solutions: A thyroid calcification detection method based on image processing, comprising the following steps:
[0007] S1: Divide the ultrasonic 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 regions, record the gradient continuous edge pixel groups 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, screen the segments and detect the frequency difference, and perform edge smoothing operation for pixel gray mean alignment to generate an artifact interference suppression image frame;
[0009] S3: Based on the artifact interference suppression image frame, extract the starting and ending points of the edge curve, calculate the length ratio and screen the closed curves, and compare the gray difference values to obtain the calcification boundary closed region;
[0010] S4: Based on the calcification boundary closed region, collect the gray values inside the contour, evaluate the gray concentration degree through a sliding window, screen the window blocks exceeding the difference threshold as the target units, and mark the positions and attributions to generate a calcification structure recognition unit list;
[0011] S5: Based on the calcification structure recognition unit list, perform combined annotation according to the image frame position index, and combine the area ratio and gray concentration stability to screen the segments meeting the calcification imaging conditions to obtain the calcification detection result.
[0012] As a further solution of the present invention, the image boundary response region set is a grid region, a gradient continuous 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 closed region gray difference, and the calcification boundary standard. The calcification structure recognition unit list includes the structure target unit, the gray concentration degree, and the unit position and attribution relationship. The calcification detection result is the segment meeting the calcification imaging conditions, the closed integrity, and the gray concentration stability standard segment.
[0013] As a further solution of the present invention, the specific steps of dividing the ultrasonic image of the thyroid region into equal regions according to a fixed pixel grid, calculating the local contrast intensity and edge tendency based on the gray difference, screening the gray variation regions, recording the gradient continuous edge pixel groups as the feature point set, and generating the image boundary response region set are:
[0014] S101: Divide the ultrasonic image of the thyroid region into grid regions according to a set pixel spacing, calculate the gray - level differences between adjacent pixels in the horizontal and vertical directions within each grid, and generate local contrast intensity values based on the gray - level difference sequences.
[0015] S102: Compare based on the local contrast intensity values and the median gray - level difference of the whole image, screen the grid regions where the gray - level change amplitude exceeds the median difference, extract and record the edge pixel groups within the regions, and generate edge - tendency pixel distribution values.
[0016] S103: Based on the pixel - point sequences with consistent directions and edge - connected in the edge - tendency pixel distribution values, record the positions of the points, merge the edge pixels, and generate a set of image boundary response regions.
[0017] As a further solution of the present invention, based on the set of image boundary response regions, the specific steps for extracting the edge gradient direction, calculating the angle fluctuation value, screening segments and detecting frequency differences, and performing edge smoothing operations for pixel gray - level mean alignment to generate an artifact - interference - suppressed image frame are as follows:
[0018] S201: Based on the set of image boundary response regions, extract the gradient directions of the edge pixel points in each region, obtain the gradient values of each edge pixel point, and calculate the gradient - direction angle fluctuation values between adjacent pixel points. By comparing the fluctuation values with the set threshold of the angle - change range, screen the segments that exceed the threshold to generate edge - direction fluctuation - value segments.
[0019] S202: Based on the edge - direction fluctuation - value segments, detect the difference degree between the gray - level frequency change value within the segment region and the stability of the neighborhood gray - level distribution. Based on the calculation of the difference between the gray - level frequency value and the stability, judge the boundary of the gradient - stable interval of the difference value to generate a difference - value determination segment.
[0020] S203: Based on the difference - value determination segment, perform an edge - smoothing operation for pixel gray - level mean alignment, adjust the gray - level value of each pixel by calculating the gray - level mean, and perform edge - alignment smoothing operations to generate an artifact - interference - suppressed image frame.
[0021] As a further solution of the present invention, the specific formula for the gray - level mean is as follows:
[0022]
[0023] where I new (x, y) represents the gray - level value at the position (x, y) in the smoothed image, I(x + i, y + j) represents the gray - level value at the 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. Represents the sum of all pixel values within the convolutional 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 starting and ending points of the edge curve, calculating the length ratio and screening for closed curves, and comparing the gray difference to obtain the calcification boundary closed region are as follows:
[0025] S301: Based on the artifact interference suppressed image frame, extract the starting and ending pixels of all edge curves, calculate the ratio of the length of the curve to the straight-line distance between the endpoints, and screen for curves approaching a closed state through the ratio to 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 the gray change at the curve boundary, screen for regions meeting the criteria through calculation and comparison with the threshold standard to generate candidate regions for the calcification boundary;
[0027] S303: Based on the candidate regions for the calcification boundary, analyze the outer boundary of the calcification to generate the calcification boundary closed region;
[0028] As a further aspect of the present invention, the specific formula for the ratio of the length of the curve to the straight-line distance between the endpoints is as follows:
[0029]
[0030] Where R i represents the ratio of the length of the i-th edge curve to the straight-line distance between the endpoints, L i represents the total path length of the i-th edge curve along all pixel points, D i represents the Euclidean straight-line distance between the starting pixel and the ending pixel of the i-th edge curve, γ i represents the local curvature adjustment coefficient of the i-th curve, n i represents the total number of pixel points of the i-th curve, (x j , y j ) represents the coordinates of the j-th pixel point on the i-th curve.
[0031] As a further aspect of the present invention, based on the calcification boundary closed region, collect the gray values within the contour, evaluate the gray concentration through a sliding window, screen for window blocks exceeding the difference threshold as target units, and mark the positions and affiliations to generate a list of calcification structure recognition units. The specific steps are as follows:
[0032] S401: Based on the set of calcification boundary closed regions, collect the gray values of all pixels within the closed contour range, calculate the gray concentration of the internal units of the window, and generate gray concentration values by calculating the concentration of each window;
[0033] S402: Based on the gray concentration value, determine the window blocks whose concentration reaches the unified difference threshold, and determine them as structural target units. Mark the position of each target unit and its belonging relationship in the contour structure to generate a target unit marking set;
[0034] S403: Based on the target unit marking set, list the positions and belonging relationships of each structural target unit to obtain a calcified structure recognition unit list.
[0035] As a further solution of the present invention, based on the calcified structure recognition unit list, perform combined annotation according to the image frame position index, and combine the area ratio and gray concentration stability to screen out the segments that meet the calcification imaging conditions. The specific steps for obtaining the calcification detection result are as follows:
[0036] S501: Based on the calcified structure recognition unit list, perform combined annotation according to the position index of the unit in the image frame. Through the combination of units within the annotation interval, generate a combined annotation area;
[0037] S502: Based on the combined annotation area, perform area ratio determination, compare the area and boundary ratio within the area, screen out the areas that meet the conditions, and generate an area determination area;
[0038] S503: Based on the area determination area, combine the contour closure integrity and gray concentration stability to screen out the segments that meet the calcification imaging conditions to obtain the calcification detection result.
[0039] A thyroid calcification detection system based on image processing, comprising:
[0040] The image partitioning module divides the thyroid ultrasound image based on a fixed pixel grid, calculates the continuous pixel gray differences in the horizontal and vertical directions within each grid to obtain the local contrast intensity and edge tendency value, screens out the grid areas where the gray variation exceeds the median difference range, records the edge pixel groups, and generates an image boundary response area set;
[0041] The artifact suppression module calculates the angle fluctuation value based on the image boundary response area set, screens out the areas where the fluctuation exceeds the set range, identifies the artifact interference areas through the gray frequency change and the gray difference in the neighborhood, and performs gray mean alignment and smoothing operations to generate an artifact suppression image frame;
[0042] The calcified area recognition module extracts the starting and ending pixel points of the edge curve based on the artifact suppression image frame, calculates the ratio of the length to the straight-line distance between the starting and ending points, screens out the closed curves and compares the gray changes, determines the areas that meet the calcification criteria as the outer boundaries of the calcification, and generates the calcified area boundary;
[0043] The target unit identification module calculates the grayscale concentration according to the sliding window based on the grayscale value of the pixels within the boundary of the calcified area, selects the windows exceeding the difference threshold as the structural target units, marks the unit positions and attribution relationships, and generates a list of calcified structural target units;
[0044] The calcification imaging determination module marks the region with the position index based on the calcification structure target unit list, calculates the area ratio, and selects the segments meeting the imaging conditions in combination with the contour closure and grayscale stability to obtain the calcification detection result.
[0045] Compared with the prior art, the advantages and positive effects of the present invention are:
[0046] In the present invention, the detection accuracy of calcified areas in thyroid ultrasound images is improved through grid processing and grayscale difference analysis. The gradient direction and angle change analysis of edge pixels can effectively suppress artifact interference and ensure the accuracy of the calcified area boundary. The recognition of closed curves strengthens boundary extraction and avoids the problem of curve blur. The grayscale concentration and stability analysis makes the recognition of calcified structures more stable and reliable, improves detection accuracy, adapts to different image qualities and disease types, and enhances clinical diagnosis support capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 It is a schematic diagram of the steps of the present invention;
[0049] Figure 2 It is a system module diagram of the present invention. DETAILED DESCRIPTION
[0050] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0051] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0052] In the embodiments of the present invention, the terms "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, their intended meanings are the same. The terms "of", "corresponding", and "corresponding to" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, their intended meanings are the same.
[0053] In the embodiments of the present invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference between them is not emphasized, their intended meanings are the same.
[0054] To make the technical problems, technical solutions, and advantages to be solved by the present invention clearer, the following will be described in detail with reference to the accompanying drawings and specific embodiments.
[0055] The embodiments of the present invention provide a thyroid calcification detection method based on image processing, including the following steps:
[0056] S1: Divide the ultrasound image of the thyroid region into equal-area regions according to a fixed pixel grid. Based on the continuous pixel gray-scale differences in the horizontal and vertical directions in each grid, calculate the local contrast intensity and edge tendency value, and compare the median gray-scale difference of the overall image. Screen the grid regions whose gray-scale variation degree exceeds the median difference level, record the edge pixel groups 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 directions of the edge pixel points in each region, and calculate the angle fluctuation value between adjacent pixel points. According to the edge direction continuity, screen the segments whose fluctuation values exceed the angle change range, detect the difference degree between the gray-scale frequency change value in the segment region and the neighborhood gray-scale distribution stability, and determine the segments whose difference values cross the gradient stable interval boundary as the artifact interference regions. Perform the edge smoothing operation of pixel gray-scale mean alignment to generate the artifact interference suppression image frame.
[0058] S3: Based on the artifact interference suppression image frame, extract the starting pixels and ending pixels of all edge curves, calculate the ratio of the curve length to the straight-line distance between the endpoints, screen the curves whose ratio approaches the closed-state characteristic interval, call the average gray-scale value of the region enclosed by the closed curve and the gradient difference of the curve boundary gray-scale change, and compare the region that meets the threshold standard as the outer boundary of calcification to generate the calcification boundary closed region.
[0059] S4: Based on the set of calcification boundary enclosed regions, collect the gray values of all pixels within the enclosed contour range, calculate the gray concentration degree of the internal cells with a sliding window of a fixed size, determine the window blocks with the concentration degree above the unified difference threshold as structural target cells, mark the relationship between the cell positions and their belonging in the contour structure, and generate a list of calcification structure recognition cells;
[0060] S5: Based on the list of calcification structure recognition cells, perform combined annotation according to the position index of the cells in the image frame, perform area ratio determination on the continuously annotated regions, and combine the two criteria of contour closure integrity and gray concentration stability to determine whether the region meets the calcification imaging conditions, screen the index segments that meet the criteria, and obtain the calcification detection results.
[0061] The image boundary response region set is a grid region, a group of gradient continuous edge pixels, and a set of feature points. The artifact interference suppressed image frame includes the edge smoothing processing result and the artifact interference suppression effect. The calcification boundary enclosed region is the calcification outer boundary, the gray difference in the enclosed region, and the calcification boundary standard. The list of calcification structure recognition cells includes structural target cells, gray concentration degree, cell positions and their belonging relationships. The calcification detection results are segments that meet the calcification imaging conditions, segments that meet the closure integrity and gray concentration stability criteria.
[0062] The specific steps of S1 are as follows:
[0063] S101: Divide the ultrasonic image of the thyroid region into grid regions according to the set pixel spacing, calculate the gray differences between adjacent pixels in the horizontal and vertical directions within each grid, and generate local contrast intensity values based on the gray difference value sequence;
[0064] First, process the ultrasonic image of the thyroid region to make the image noise-free, which can be achieved through basic image processing steps to remove background noise and enhance image contrast. Next, divide the image into grid regions according to the set pixel spacing, select a 10x10 pixel grid, and each grid will include multiple adjacent pixels. For the pixels within each grid, calculate the gray differences between adjacent pixels in the horizontal and vertical directions. For example, if the gray value of a pixel within a certain grid is 150 and the gray value of the adjacent pixel on the right is 145, then the gray difference in the horizontal direction is 5. Similarly, calculate the gray differences between adjacent pixels in the vertical direction. These gray difference values form a sequence, and then by calculating the standard deviation or average value of these differences, the local contrast intensity value of the grid is obtained. If the gray difference sequence of a certain grid is [5, 3, 4, 6], then the local contrast intensity value may be 1.41, which can identify the regions with higher contrast in the image and help detect abnormal lesions in the thyroid region.
[0065] S102: Compare based on the local contrast intensity value and the median difference of the overall image grayscale, filter the grid regions where the grayscale change amplitude exceeds the median difference, extract and record the edge pixel groups within the regions, and generate the edge tendency pixel distribution value;
[0066] First, calculate the median difference of the entire image. The median difference of the grayscale refers to the difference between the grayscale values of all pixels in the entire image and its median. For example, assume the grayscale values of the image are [120, 130, 140, 150, 160] in sequence, and its median is 140. Then the median difference is the difference value between 140 and other pixel values. Then, compare the local contrast intensity value of each grid region with the median difference of the overall image grayscale, and filter the grid regions where the local contrast intensity value exceeds a certain threshold of the overall grayscale median difference. For example, if the median difference of the image is 15, and the local contrast intensity of a certain grid is 20, then the contrast intensity of this grid is greater than the median difference threshold and is thus filtered out. Through this filtering method, regions with large grayscale changes can be identified. These regions may contain more information and details, which are particularly important for the identification of thyroid lesions. In practical applications, the setting of the threshold is based on the overall grayscale difference of the image, and an appropriate median difference threshold can be set through the overall statistical data of the image.
[0067] S103: Based on the sequence of pixel points with consistent directions and edge connections in the edge tendency pixel distribution value, record the positions of the points, merge the edge pixels, and generate the set of image boundary response regions;
[0068] First, determine whether the pixel points with large grayscale changes in the detection region belong to the edge. Assume that in a certain grid, if the grayscale difference of a certain pixel point exceeds the set threshold, then this pixel point is considered an edge pixel. Then, by analyzing the relative positions and directions between these edge pixels, if these pixel points show consistent directions and their connections are uninterrupted, these edge pixel points can be merged into a continuous edge line. For example, if several consecutive pixel points in the grid show similar grayscale differences and these points have the same direction, then these points will be classified as the same edge line, and the positions of these points 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 boundary of the thyroid region and identify possible abnormal tissues or lesion regions.
[0069] The specific steps of S2 are as follows:
[0070] S201: Based on the image boundary response region set, extract the gradient directions of the edge pixel points in each region, obtain the gradient values of each edge pixel point, and calculate the fluctuation value of the included angle of the gradient directions between adjacent pixel points. By comparing the fluctuation value with the set threshold of the angle change range, filter out the segments exceeding the threshold, and generate the edge direction fluctuation value segments;
[0071] First, extract the edge pixel points in each region one by one. For each edge pixel point, calculate the grayscale difference between this point in the horizontal and vertical directions. For example, if the grayscale value on the left side of a pixel point is 110 and on the right side is 140, then the grayscale difference in the horizontal direction is 30. Similarly, if the grayscale value on the upper side is 120 and on the lower side is 135, then the grayscale difference in the vertical direction is 15. Then, according to the grayscale differences in the horizontal and vertical directions, determine the grayscale change direction, that is, the gradient direction, by calculating the ratio of the two. Subsequently, calculate the gradient intensity value of this pixel point, 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 differences are 30 and 15, the corresponding gradient intensity is approximately 33.54. Then, record the gradient directions of all edge pixel points in the same region. Next, calculate the angle difference between the gradient directions of two adjacent edge pixel points to obtain the fluctuation value of the included angle of the gradient directions. For example, if the gradient directions of two pixel points are 45 degrees and 60 degrees respectively, then the included angle fluctuation value is 15 degrees. Compare these fluctuation values with the set threshold of the angle change range. If the fluctuation value is greater than the set threshold, then this segment is filtered out. The way to set the threshold can refer to the law of edge changes in the actual image. In thyroid ultrasound images, the angle fluctuation threshold is often set between 10 degrees and 20 degrees. If the difference in the gradient directions between a pixel point and its adjacent point exceeds 15 degrees, it is considered that its fluctuation is significant, and this fluctuation segment is marked, thereby generating the edge direction fluctuation value segments.
[0072] S202: Based on the edge direction fluctuation value segments, detect the degree of difference between the grayscale frequency change value and the neighborhood grayscale distribution stability within the segment region. Based on the calculation of the grayscale frequency value and the stability difference, judge the boundary of the gradient stable interval of the difference value, and generate the difference value determination segment;
[0073] First, extract the gray - scale frequency distribution within the fragment area, that is, count the number of occurrences of different gray - scale values in this area. For example, in a 10 - by - 10 area, the pixel with a gray - scale value of 130 appears 20 times, and the pixel with a gray - scale value of 135 appears 25 times. Record the complete gray - scale frequency distribution in this way. Then, calculate the gray - scale distribution stability in the adjacent grid area of this area. The judgment method of stability is to calculate the degree of change of the gray - scale frequency distribution in the adjacent grid. For example, if the frequency change of the gray - scale value from 130 to 135 in the adjacent area fluctuates less than 5 times, it can be regarded as a stable area. If the frequency difference in the current fragment area is 20 times, it means the degree of difference is large. By calculating the absolute difference between the gray - scale frequency difference and the neighborhood stability difference, and then judging this difference value with the set gradient stability interval boundary. If this difference value exceeds the set range, it indicates that there is an abnormal change in this area. This range can be obtained through a large number of sample statistics. For example, if the set gradient stability difference boundary value is 15, and the difference value of a certain area is 18, then it is determined as an abnormal fragment and marked as a difference - value - determined fragment.
[0074] S203: Based on the difference - value - determined fragment, perform an edge - smoothing operation for pixel gray - scale mean alignment. Adjust the gray - scale value of each pixel by calculating the gray - scale mean, and perform an edge - alignment smoothing operation to generate an artifact - interference - suppressed image frame;
[0075] The specific formula for the gray - scale mean is:
[0076]
[0077] where, I new (x,y) represents the gray - scale value at the position (x,y) in the smoothed image, I(x + i,y + j) represents the gray - scale value at the position (x + i,y + j) in the image, N is the size of the convolution kernel, k represents the radius of the convolution kernel, represents the sum of all pixel values within the convolution - kernel area;
[0078] Assume that a 3x3 convolution kernel is selected and k = 1, then N = 9, indicating that 9 pixels around each pixel will participate in the calculation of the gray - scale mean. At a certain position (x,y) in the image, the mean of the gray - scale values of 9 pixels around this position will be calculated;
[0079] The calculation process of the formula is as follows:
[0080] Select a target pixel position (x,y), for example, this position is (5,5);
[0081] Select a 3x3 convolution kernel and take the target pixel position (x,y) as the center of the convolution kernel;
[0082] Collect the gray - scale values of the neighborhood pixels, that is, the image positions are:
[0083] The gray values at (4,4), (4,5), (4,6), (5,4), (5,5), (5,6), (6,4), (6,5), (6,6);
[0084] Assume that the gray values of these pixels are respectively: 120, 130, 125, 110, 115, 120, 135, 140, 145; Calculate the mean of these gray values:
[0085]
[0086] The gray value of the target pixel after smoothing is obtained as 108.89;
[0087] This result indicates that after calculating the mean gray value of the neighboring pixels, the gray value at the target position (5,5) is adjusted from the original value (assumed to be 115) to 108.89. This process reduces the influence of image details or noise by performing mean gray value processing on the area around the target pixel, generating a smoothed image.
[0088] The specific steps of S3 are as follows:
[0089] S301: Based on the artifact interference suppression image frame, extract the starting and ending pixels of all edge curves, calculate the ratio of the length of the curve to the straight-line distance between the endpoints, and screen the curves approaching the closed state through the ratio to generate closed curve features;
[0090] The specific calculation formula for the ratio of the length of the curve to the straight-line distance between the endpoints is:
[0091]
[0092] Among them, R i represents the ratio of the length of the i-th edge curve to the straight-line distance between the endpoints, L i represents the total path length of the i-th edge curve along all pixel points, D i represents the Euclidean straight-line distance between the starting pixel and the ending pixel of the i-th edge curve, γ i represents the local curvature adjustment coefficient of the i-th curve, n i represents the total number of pixel points of the i-th curve, (x j , y j ) represents the coordinates of the j-th pixel point on the i-th curve;
[0093] Assume that 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 result shows that the curve under investigation has a relatively high degree of approaching closure compared to a completely closed curve. This means that this curve is visually close to forming a closed loop, which is very important for image processing steps such as shape analysis and object recognition. This ratio R i can be used to screen and identify approximately closed edge curves, and then perform more complex image processing operations.
[0106] S302: Based on the characteristics of the closed curve, extract the average gray value of the region enclosed by the closed curve and the gradient difference of the gray change at the curve boundary. By calculating and comparing the threshold criteria, screen the regions that meet the criteria and generate candidate regions for the calcification boundary;
[0107] First, extract the average gray value within the enclosed area surrounded by each closed curve. The mean value is obtained by counting the sum of the gray values of all pixels within the enclosed area and dividing it by the number of pixels in that area. For example, if an area contains 100 pixels and the sum of the gray values is 13500, the average gray value is 135. At the same time, extract the boundary pixels of the closed curve and calculate the gradient difference of the gray value changes of these boundary pixels. The way to obtain the gradient difference is to perform a gray difference operation between each boundary pixel point and its adjacent outer pixel, and then find the difference between the maximum difference and the minimum difference. For example, if the boundary gray differences are [10, 15, 12, 8], the maximum value is 15, the minimum value is 8, and the gradient difference is 7. Then, compare the combined average gray value and the gradient difference with the set threshold criteria. The set threshold criteria are that the average gray value is not less than 120 and the gradient difference is not less than 5. If the average gray value of a certain area is 135 and the gradient difference is 7, and both of the above two judgment conditions are met, then this area is screened as a conforming standard area. Finally, all areas that meet the set criteria of the average gray value and the boundary gray gradient difference are marked as calcification boundary candidate areas.
[0108] S303: Based on the calcification boundary candidate areas, analyze the outer calcification boundary and generate a closed area of the calcification boundary;
[0109] First, extract the coordinates of all pixel points on the outer boundary of the area and determine whether there are continuous gaps between the pixel points. If there are discontinuous edge segments, fill in the missing pixels. For example, if the interval between adjacent pixel points 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 complete the continuous boundary. Then, continue to check whether the boundary is in a closed state by judging whether the distance between the start and end pixel points is less than or equal to two pixel units. If so, it is considered closed; otherwise, fill in the connection. Finally, complete the continuous closed boundary filling for all boundary contours that meet the conditions, and form a closed area of the calcification boundary after summarization.
[0110] The specific steps of S4 are as follows:
[0111] S401: Based on the set of closed areas of the calcification boundary, collect the gray values of all pixels within the enclosed contour range, calculate the gray concentration degree of the internal units of the window, and generate a gray concentration degree value by calculating the concentration degree of each window;
[0112] First, collect the grayscale values of all pixels in this area. During the collection process, record the grayscale value of each pixel, and classify these grayscale values according to the window where they are located. The size of each window can be set to an area of, for example, 10x10 pixels, and calculate the concentration degree of the pixel grayscale values within the window. The definition of the concentration degree is the degree of change of the pixel grayscale values within the window. A lower concentration degree indicates a small grayscale difference and a more uniform image; a higher concentration degree indicates a large grayscale value difference within the image and obvious boundaries. For example, in a certain window, the grayscale value of all pixels is 130, and the concentration degree is 0; if the grayscale value varies between 120 and 140, the concentration degree is higher. The calculation method of the concentration degree can be obtained by calculating the difference between each pixel value within the window and the average grayscale value within the window, then finding the sum of the squares of these difference values, and calculating the standard deviation to obtain the concentration degree value. For example, if the grayscale values within a certain window are [120, 125, 130, 135, 140], the average value is 130, the differences are [10, 5, 0, 5, 10], and the standard deviation is 4.47, then the concentration degree of this window is 4.47. Through this method, calculate the concentration degree of each window and generate the concentration degree value of each window for subsequent processing.
[0113] S402: Based on the grayscale concentration degree value, determine the window blocks whose concentration degree reaches the unified difference threshold, and determine them as structural target units. Mark the attribution relationship between the position and contour structure of each target unit to generate a target unit marking set;
[0114] First, set a unified difference threshold. For example, set the threshold to 5. Windows with a concentration degree lower than 5 will be considered as uniform areas, while windows with a concentration degree higher than 5 will be regarded as areas with larger differences. By comparing the concentration degree value of each window with the set threshold, if the concentration degree value of a certain window reaches or exceeds the threshold value, then this window is determined as a structural target unit. For example, if the concentration degree of a certain window is 6, then this window meets the threshold standard and is marked as a target unit; while if the concentration degree of another window is 4, it does not meet the threshold requirement and will not be determined as a target unit. Subsequently, mark the position of each target unit and its attribution relationship in the overall contour, that is, determine which contour part of the closed area this target unit belongs to. Through this method, identify all windows that meet the concentration degree threshold as target units and generate a target unit marking set. This marking set contains the specific positions and attribution information of all windows identified as structural target units for subsequent structural analysis.
[0115] S403: Based on the target unit marking set, list the position and attribution relationship of each structural target unit to obtain a list of calcification structure recognition units;
[0116] First, based on the marking information of each target unit, list the position information and its attribution relationship of each structural target unit, which means recording the position coordinates of each target unit and associating it with the calcified region to which it belongs. For example, if the coordinate of the target unit in the image is (50, 60) and it belongs to a specific region within the calcified boundary, it is marked as a part of that region. In this way, a list of calcified structure recognition units can be generated, which details the positions, attribution relationships, and association information with the calcified regions of all target units, providing useful data support for the further analysis of the calcified structure.
[0117] The specific steps of S5 are as follows:
[0118] S501: Based on the list of calcified structure recognition units, perform combined annotation according to the position index of the units in the image frame. By merging the units within the annotation interval, generate a combined annotation region;
[0119] First, index according to the positions of each structural target unit in the image frame, sort these target units by position, and then perform combined annotation on the target units 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 the target units in a certain region are (50, 60), (55, 60), (60, 60) in sequence, then these units form a combined interval, and then all the target units within this interval are merged into a combined annotation region. The selection of the annotation interval is delimited based on the spatial relationship of the target units. If the distance between two target units is less than the set threshold (for example, 10 pixels), it can be considered that they belong to the same combined region. In the actual scenario, setting an appropriate distance threshold is crucial. For example, if the set distance threshold is 10 pixels, the distance between the 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 annotation region. By this method, multiple target units can be accurately classified into a combined annotation region.
[0120] S502: Based on the combined annotation region, perform an area ratio determination, compare the area within the region with the boundary ratio, screen the regions that meet the conditions, and generate an area determination region;
[0121] First, calculate the area of each combined labeled region. The area calculation can be obtained by counting the number of pixels within the region. For example, if there are 150 pixels in a certain combined labeled region, then its area is 150 pixel units. Then, calculate the boundary length of the region, and obtain the boundary length by measuring the number of pixels on the edge of the region. For example, if the boundary of the region consists of 20 pixels, then the boundary length is 20 pixels. Next, by comparing the ratio between the area and the boundary length of the region, set a standard. For example, if the area-to-boundary ratio threshold is set to 5, and the area of a certain region is 150 and the boundary length is 20, then 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 screened as a qualified region. For example, if the area of a certain region is 120 and the boundary is 30 pixels, then the ratio is 120÷30 = 4, which does not reach the set ratio standard and cannot be screened as a qualified region. Finally, through this screening process, regions that meet the area-to-boundary ratio conditions can be accurately identified, and an area determination region is generated.
[0122] S503: Based on the area determination region, combined with the contour closure integrity and the gray-scale concentration stability, screen out the segments that meet the calcification imaging conditions to obtain the calcification detection result;
[0123] First, check whether the contour of each area determination region is closed. The determination method of closure integrity is to check whether the boundary pixels within the region can be seamlessly connected. If the distance between the starting point and the ending point of the boundary pixel points is less than the set threshold (for example, 5 pixels), then the region is considered to be closed completely. Second, analyze the gray-scale concentration stability within the region. The gray-scale stability can be evaluated by calculating the change range of the gray-scale values of all pixels within the region. If the gray-scale difference within the region is small, then the region is considered to have stable gray-scale. If the change of the gray-scale value is large, then the region is considered to have unstable gray-scale. For example, if the gray-scale value range of a certain region is [120, 125, 130, 135], then the gray-scale change range is 15. If this value exceeds the set threshold (for example, 10), then the region is considered to have unstable gray-scale. Combining these two criteria, that is, closure integrity and gray-scale stability, screen out the segments that meet the calcification imaging conditions, and finally obtain the calcification detection result. For example, if the closure of a certain region meets the standard and the gray-scale stability is good, then it is determined that the region is a region that meets the calcification imaging conditions, and the calcification detection result is output.
[0124] Please refer to Figure 2 , an image processing-based thyroid calcification detection system, including:
[0125] The image partitioning module divides the thyroid ultrasound image based on a fixed pixel grid, calculates the continuous pixel gray-scale differences in the horizontal and vertical directions within each grid, obtains the local contrast intensity and edge tendency values, filters out the grid regions where the gray-scale variation exceeds the median difference range, records the edge pixel groups, and generates an image boundary response region set;
[0126] The artifact suppression module calculates the angle fluctuation value based on the image boundary response region set, filters out the regions where the fluctuation exceeds the set range, identifies the artifact interference regions through the gray-scale frequency change and the gray-scale difference in the neighborhood, performs the gray-scale mean alignment and smoothing operation, and generates an artifact-suppressed image frame;
[0127] The calcification region recognition module extracts the starting and ending pixel points of the edge curve based on the artifact-suppressed image frame, calculates the ratio of the length to the straight-line distance between the starting and ending points, filters out the closed curves and compares the gray-scale changes, determines the regions that meet the calcification criteria as the outer boundaries of calcification, and generates the calcification region boundaries;
[0128] The target unit recognition module calculates the gray-scale concentration degree according to the sliding window based on the pixel gray-scale values within the calcification region boundaries, filters out the windows that exceed the difference threshold as the structural target units, marks the unit positions and attribution relationships, and generates a list of calcification structure target units;
[0129] The calcification imaging determination module marks the regions of the position index pairs based on the list of calcification structure target units, calculates the area ratio, and combines the contour closure and gray-scale stability to filter out the segments that meet the imaging conditions, and obtains the calcification detection results.
[0130] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for detecting thyroid calcification based on image processing, characterized in that, It includes the following steps: S1: Divide the ultrasonic image of the thyroid region into equal-area regions according to a fixed pixel grid, calculate the local contrast intensity and edge tendency based on the gray difference, screen the gray-variant regions, record the gradient-continuous edge pixel groups 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, screen the segments and detect the frequency difference, and perform edge smoothing operation with pixel gray mean alignment to generate the artifact interference suppression image frame; S3: Based on the artifact interference suppression image frame, extract the starting and ending points of the edge curve, calculate the length ratio and screen the closed curve, and compare the gray difference value to obtain the calcification boundary closed region; S4: Based on the calcification boundary closed region, collect the gray values inside the contour, evaluate the gray concentration through a sliding window, screen the window blocks exceeding the difference threshold as the target units, and mark the positions and attributions to generate the calcification structure recognition unit list.
2. The method for detecting thyroid calcification based on image processing according to claim 1, wherein: The image boundary response region set is the grid region, the gradient-continuous edge pixel group, and the 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 closed region gray difference, and the calcification boundary standard. The calcification structure recognition unit list includes the structure target unit, the gray concentration, the unit position, and the attribution relationship.
3. The method for detecting thyroid calcification based on image processing according to claim 1, wherein: The specific steps of dividing the ultrasonic image of the thyroid region into equal-area regions according to a fixed pixel grid, calculating the local contrast intensity and edge tendency based on the gray difference, screening the gray-variant regions, recording the gradient-continuous edge pixel groups as the feature point set, and generating the image boundary response region set are as follows: S101: Divide the ultrasonic image of the thyroid region into grid regions according to the set pixel spacing, calculate the gray difference between adjacent pixels in the horizontal and vertical directions within each grid, and generate the local contrast intensity value according to the gray difference sequence; S102: Compare the local contrast intensity value with the overall gray median difference of the image, screen the grid regions with the gray change amplitude exceeding the median difference, extract and record the edge pixel groups within the regions, and generate the edge tendency pixel distribution value; S103: Based on the pixel point sequence with the same direction and edge connection in the edge tendency pixel distribution value, record the positions of the points, merge the edge pixels, and generate the image boundary response region set.
4. The thyroid calcification detection method based on image processing according to claim 1, characterized in that, The specific steps of extracting the edge gradient direction, calculating the angle fluctuation value, screening the segments and detecting the frequency difference, and performing edge smoothing operation with pixel gray mean alignment based on the image boundary response region set to generate the artifact interference suppression image frame are as follows: S201: Based on the image boundary response region set, extract the gradient direction of the edge pixel points in each region, obtain the gradient value of each edge pixel point, and calculate the gradient direction angle fluctuation value between adjacent pixel points. By comparing the fluctuation value with the set angle change range threshold, screen the segments exceeding the threshold to generate the edge direction fluctuation value segments; S202: Based on the edge direction fluctuation value segments, detect the degree of difference between the gray - scale frequency change value and the neighborhood gray - scale distribution stability within the segment area. Based on the calculation of the gray - scale frequency value and the stability difference, determine the boundary of the stable interval of the difference value gradient, and generate a difference value determination segment; S203: Based on the difference value determination segment, perform an edge smoothing operation of pixel gray - scale mean alignment. Adjust the gray - scale value of each pixel by calculating the gray - scale mean, and perform an edge alignment smoothing operation to generate an artifact interference suppression image frame.
5. The method for detecting thyroid calcification based on image processing according to claim 1, wherein, The specific formula for the gray - scale mean is: Among them, I new (x, y) represents the gray value at the position (x, y) in the smoothed image, I(x + i, y + j) represents the gray value at the 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. denotes the summation of all pixel values within the convolution kernel region.
6. The method for detecting thyroid calcification based on image processing according to claim 1, wherein, Based on the artifact interference suppression image frame, the specific steps for extracting the starting and ending points of the edge curve, calculating the length ratio, screening the closed curve, and comparing the gray - scale difference to obtain the calcification boundary closed area are as follows: S301: Based on the artifact interference suppression image frame, extract the starting and ending pixels of all edge curves, calculate the ratio of the length of the curve to the straight - line distance between the endpoints, and screen the curves approaching the closed state through the ratio to generate a closed - curve feature; S302: Based on the closed - curve feature, extract the average gray - scale value of the area enclosed by the closed curve and the gradient difference of the gray - scale change at the curve boundary. By calculating and comparing the threshold criteria, screen the areas that meet the criteria to generate a calcification boundary candidate area; S303: Based on the calcification boundary candidate area, analyze the outer boundary of the calcification to generate a calcification boundary closed area.
7. The method for detecting thyroid calcification based on image processing according to claim 1, wherein The specific formula for the ratio of the length of the curve to the straight - line distance between the endpoints is: Among them, R i represents the ratio of the length of the i-th edge curve to the straight-line distance between the endpoints, L i represents the total path length of the i-th edge curve along all pixel points, D i represents the Euclidean straight-line distance between the starting pixel and the ending pixel of the i-th edge curve, γ i represents the local curvature adjustment coefficient of the i-th curve, n i represents the total number of pixel points of the i-th curve, (x j , y j ) represents the coordinates of the j-th pixel point on the i-th curve.
8. The method for detecting thyroid calcification based on image processing according to claim 1, characterized in that, Based on the calcification boundary closed area, collect the gray - scale values inside the contour, evaluate the gray - scale concentration through a sliding window, screen the window blocks exceeding the difference threshold as target units, and mark the positions and affiliations to generate a calcification structure recognition unit list; S401: Based on the set of calcification boundary closed areas, collect the gray - scale values of all pixels within the closed contour range, calculate the gray - scale concentration of the internal units of the window, and generate a gray - scale concentration value by calculating the concentration of each window; S402: Based on the gray - scale concentration value, judge the window blocks whose concentration reaches a unified difference threshold as structural target units, mark the position of each target unit and its affiliation in the contour structure to generate a target unit marking set; S403: Based on the target unit marking set, list the positions and affiliations of each structural target unit to obtain a calcification structure recognition unit list.
9. The method for detecting thyroid calcification based on image processing according to claim 1, wherein The method also includes S5: Based on the calcification structure recognition unit list, perform combined annotation according to the position index of the units in the image frame, perform an area ratio determination on the continuously annotated areas, and combine the two criteria of contour closure integrity and gray - scale concentration stability to judge whether the area meets the calcification imaging conditions, screen the index segments that meet the criteria to obtain the calcification detection result; The calcification detection result is a segment that meets the calcification imaging conditions, a segment of closure integrity, and a segment of gray - scale concentration stability criteria; S501: Based on the calcification structure recognition unit list, perform combined annotation according to the position index of the units in the image frame. Through the merging of units within the annotation interval, generate a combined annotation area; S502: Based on the combined annotation area, perform area ratio determination, compare the area within the area with the boundary ratio, screen the areas that meet the conditions, and generate an area determination area; S503: Based on the area determination area, combine the contour closure integrity and gray scale concentration stability, screen the segments that meet the calcification imaging conditions, and obtain the calcification detection result.
10. A thyroid calcification detection system based on image processing, characterized in that, According to any one of claims 1-9, it includes the following steps: The image partitioning module divides the thyroid ultrasound image based on a fixed pixel grid, calculates the continuous pixel gray scale differences in the horizontal and vertical directions within each grid, obtains the local contrast intensity and edge tendency value, screens out the grid areas where the gray scale variation exceeds the median difference range, records the edge pixel groups, and generates an image boundary response area set; The artifact suppression module calculates the included angle fluctuation value based on the image boundary response area set, screens out the areas where the fluctuation exceeds the set range, identifies the artifact interference areas through the gray scale frequency change and the neighborhood gray scale difference, and performs gray scale mean alignment and smoothing operations to generate an artifact suppression image frame; The calcification area recognition module extracts the starting and ending pixel points of the edge curve based on the artifact suppression image frame, calculates the ratio of the length to the straight-line distance between the starting and ending points, screens the closed curves and compares the gray scale changes, determines the area that meets the calcification standard as the outer boundary of the calcification, and generates the calcification area boundary; The target unit recognition module calculates the gray scale concentration degree according to the sliding window based on the pixel gray scale values within the calcification area boundary, screens out the windows that exceed the difference threshold as the structural target units, marks the unit positions and attribution relationships, and generates a list of calcification structure target units; The calcification imaging determination module annotates the area of the position index pair based on the list of calcification structure target units, calculates the area ratio, and combines the contour closure and gray scale stability to screen the segments that meet the imaging conditions, and obtains the calcification detection result.
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
Intelligent thyroid ultrasound image analysis system
CN119722543A
Quantification method of the feature of a tumor and an imaging method of the same
US20110181614A1
Cited By
Knee joint gout crystallization area intelligent identification system based on CT image
CN121304651A
Intelligent Recognition System for Gout Crystal Areas in the Knee Joint Based on CT Images
CN121304651B
Automatic Calculation Method and System for Standard Take-up Values of DR Images
CN122574006A
Automatic calculation method and system for standard uptake value of DR image
CN122574006B