Thyroid nodule grading identification method and system
Through a comprehensive method of Gaussian filtering, brightness distribution analysis, sharpening processing, edge detection and texture feature extraction, the problems of insufficient retention of image processing details and edge recognition deviation in the prior art are solved, and image quality improvement and diagnostic accuracy are improved.
Patent Information
- Application Number
- CN202510134206.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-02-06
AI Technical Summary
The prior art has problems in the noise processing, such as insufficient details reserve, poor edge protection, uneven contrast improvement, lack of targeted sharpening treatment, large edge detection deviation, and low texture feature extraction depth and accuracy, resulting in limited image quality and diagnostic accuracy.
A comprehensive method of Gaussian filtering processing noise reduction, brightness distribution analysis and contrast enhancement, Laplace operator sharpening processing, Canny algorithm edge detection and grayscale symbiosis matrix texture feature extraction is used to optimize the nodule area morphology and generate nodule feature vectors through multi-step image processing and analysis.
Significantly improve image detail performance and edge definition, improve edge recognition accuracy, enhance the stability and discrimination of feature vectors, and provide a more reliable medical diagnosis basis.
Smart Images

Figure CN120047418A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image analysis, and in particular to a thyroid nodule grading and identification method and system. Background Art
[0002] The field of image analysis technology includes the acquisition, processing, analysis and application of image information. The core content of this field includes image acquisition, image processing algorithms, feature extraction, pattern recognition and other technologies. Image analysis technology is widely used in many fields such as medicine, industry, and autonomous driving. Especially in the medical field, medical images are interpreted through image analysis to help diagnose diseases and evaluate lesions. In medical image analysis, accurate processing and analysis of images are crucial for early diagnosis of diseases and formulation of treatment plans. Image analysis technology includes but is not limited to lesion detection, segmentation, classification and other processing methods based on computer vision, and plays an important role in the identification and evaluation of tumors, nodules, etc.
[0003] Among them, the thyroid nodule grading and identification method refers to a technical method for grading and evaluating thyroid nodules. The patent subject provides a grading and identification solution based on image analysis for the diagnosis of thyroid nodules. Specifically, the method obtains medical imaging data of thyroid nodules, preprocesses and extracts features from the imaging data, and automatically grades the nodules in combination with machine learning or deep learning algorithms. The patent solution involves feature extraction of imaging data, construction of a grading model, and classification criteria for nodules, and provides an effective solution for the grading of thyroid nodules through image analysis technology.
[0004] The existing technology has the problem of insufficient detail retention in noise processing. Due to the weak combination of noise suppression and edge protection, the image details after filtering are not well expressed. The failure to fully respond to regional differences in grayscale distribution during local brightness adjustment often leads to uneven contrast enhancement and unclear local detail contrast. The sharpening process lacks targeted enhancement strategies, the edge details are not sufficiently expressed, and there are certain artifact problems, which affect the image quality and diagnostic accuracy. In edge detection technology, due to the single gradient calculation method, there are deviations in edge position identification, and it is easy to ignore subtle boundaries, resulting in blurred contours. Texture feature extraction methods are insufficient in analyzing regional grayscale spatial relationships, and the feature extraction depth and accuracy are low. It is difficult to accurately reflect the texture characteristics of the nodule area, affecting the stability and accuracy of the grading assessment. These problems may increase the uncertainty of the diagnostic results and make it difficult to meet the needs of high-precision processing of medical images. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a thyroid nodule grading and identification method and system.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: a method for grading and identifying thyroid nodules, comprising the following steps:
[0007] S1: Perform Gaussian filtering on the ultrasound image, construct a two-dimensional Gaussian kernel of the same size as the image, calculate the weight of each element in the kernel, and perform weighted operations based on the relative position of each pixel and its neighboring pixels and the pixel value. Update each pixel value in the original image by weighted average to obtain a denoised image.
[0008] S2: performing brightness distribution analysis based on the denoised image, calculating the grayscale value distribution of pixels in the local area, adjusting the histogram of the image according to the contrast change of each local area, optimizing the brightness of the local area in the image, and generating a contrast enhanced image;
[0009] S3: sharpening the contrast enhanced image by using a Laplace operator, calculating the second-order gradient value of each pixel, updating the pixel value in combination with the differentiated weighting coefficient, strengthening the rapidly changing part of the image, and obtaining a sharpened image;
[0010] S4: Based on the sharpened image, the horizontal and vertical gradient values of each pixel are calculated, the preliminary edge position is determined according to the gradient amplitude, the edge points are screened by threshold judgment, the preliminary edge image is smoothed using the Canny algorithm, the gradient amplitude and direction are calculated, non-maximum suppression is performed, and an accurate edge image is obtained after double threshold processing;
[0011] S5: Based on the precise edge image, the grayscale co-occurrence matrix is calculated, the spatial relationship of the grayscale of regional pixels in the image is analyzed, texture features such as contrast, uniformity and entropy are extracted, the nodule region morphology is optimized through morphological operations, unnecessary noise is removed, and the nodule feature vector is obtained.
[0012] As a further solution of the present invention, the denoised image includes weight distribution, pixel values after weighted averaging, and image pixel distribution after denoising; the contrast enhanced image includes local grayscale distribution, optimized histogram, and enhanced brightness distribution; the sharpened image includes second-order gradient distribution, weighted gradient map, and sharpened pixel distribution; the precise edge image includes gradient amplitude map, non-maximum suppression map, dual threshold processing map, and final edge position map; the nodule feature vector includes grayscale co-occurrence matrix features, contrast features, uniformity features, entropy features, and morphological optimization features.
[0013] As a further solution of the present invention, Gaussian filtering is performed based on the ultrasound image, a two-dimensional Gaussian kernel of the same size as the image is constructed, and the weight of each element in the kernel is calculated. The weight value is weighted according to the relative position of each pixel and the neighboring pixel and the pixel value. Each pixel value in the original image is updated by weighted average, and the specific steps of obtaining the denoised image are as follows:
[0014] S101: Based on the ultrasound image, construct a two-dimensional Gaussian kernel of the same size as the image, calculate the size of the core matrix to establish a data matrix model, select a standard deviation parameter to adjust the spatial range of the kernel, assign a value to each element in the matrix to initialize the weight, and generate a Gaussian kernel;
[0015] S102: Based on the Gaussian kernel, a weight value of each element in the kernel is calculated, a position weight matrix is established through the distance between the pixel and the neighboring position, a value weight matrix is established through the difference between the pixel and the neighboring pixel value, and the position weight and the value weight are normalized by matrix operation to generate a weight matrix to obtain a weighted pixel map;
[0016] S103: Based on the weighted pixel mapping, a product operation is performed on each pixel point in the image and the corresponding value of the weight matrix, and a cumulative operation is performed on the product values of all neighborhood pixels to complete local weighting, and the local weighted result and the weight sum are normalized to update the image pixel value to obtain a denoised image.
[0017] As a further solution of the present invention, the specific steps of performing brightness distribution analysis based on the denoised image, calculating the grayscale value distribution of pixels in the local area, adjusting the image histogram according to the contrast change of each local area, optimizing the brightness of the local area in the image, and generating a contrast enhanced image are as follows:
[0018] S201: Based on the denoised image, divide the image into multiple local areas, analyze the grayscale values of all pixels in the area, generate a distribution histogram by counting the occurrence frequency of the grayscale values, establish a grayscale distribution model by summarizing the grayscale ranges of different areas, and generate grayscale distribution data;
[0019] S202: Based on the grayscale distribution data, for the grayscale distribution range of each local area, calculate the grayscale extreme value difference in the area, screen the adjustment area by setting a contrast change threshold, establish a grayscale mapping relationship to optimize the local grayscale distribution, and redistribute the grayscale value to generate an optimized grayscale mapping;
[0020] S203: Based on the optimized grayscale mapping, the grayscale values of all pixels in the local area of the denoised image are adjusted, the grayscale values after remapping are calculated through the grayscale mapping model, the pixel value adjustment is completed by updating the image data matrix, and a contrast enhanced image is obtained.
[0021] As a further solution of the present invention, the grayscale extreme value difference calculation formula is specifically:
[0022]
[0023] Among them, ΔG represents the grayscale extreme value difference, G max Represents the maximum gray value in the area, G min Represents the minimum gray value in the area, C r Represents the grayscale contrast adjustment value in the area, and ∈ represents a small positive number to prevent zero.
[0024] As a further solution of the present invention, the contrast enhanced image is sharpened by a Laplace operator, the second-order gradient value of each pixel is calculated, and the pixel value is updated in combination with the differentiated weighting coefficient to strengthen the rapidly changing part of the image. The specific steps of obtaining the sharpened image are as follows:
[0025] S301: extracting neighborhood pixel values of each pixel based on the contrast enhanced image, calculating the second-order gradient of the gray value change of each pixel in the neighborhood, integrating the gradient value of each pixel through matrix operation, analyzing the gradient distribution data of the image, and generating a gradient matrix;
[0026] S302: Based on the gradient matrix, for the difference between the gradient value of each pixel and the gradient value of the neighborhood, the weight coefficient is adjusted by setting the gradient difference range, and the weighted value is calculated by combining the gradient difference and the weight coefficient to obtain a weighted update matrix;
[0027] S303: Based on the weighted update matrix, for all pixels of the contrast enhanced image, the superposition result of the original pixel value and the weighted update value is calculated, the gray value of each pixel in the image is gradually updated, and the updated image matrix data is regenerated to obtain a sharpened image.
[0028] As a further solution of the present invention, based on the sharpened image, the horizontal and vertical gradient values of each pixel are calculated, the preliminary edge position is determined according to the gradient amplitude, the edge points are screened by threshold judgment, the preliminary edge image is smoothed using the Canny algorithm, the gradient amplitude and direction are calculated, non-maximum suppression is performed, and after double threshold processing, the specific steps of obtaining an accurate edge image are as follows:
[0029] S401: Based on the sharpened image, extract each pixel point and its neighboring pixel values, obtain the horizontal grayscale gradient value through differential operation, obtain the vertical grayscale gradient value through vertical differential operation, establish a gradient amplitude data matrix by synthesizing the horizontal and vertical gradient values, and generate a gradient amplitude map;
[0030] S402: Based on the gradient amplitude map, for each pixel point, the gradient amplitude value is compared with the set upper and lower thresholds to screen valid edge points, and the connection relationship of the edge points is analyzed based on the gradient direction to perform positioning correction, and the valid edge points are integrated to establish edge distribution data to obtain an edge positioning map;
[0031] S403: Based on the edge positioning map, for the gradient direction and gradient amplitude value of the edge point, non-maximum points are analyzed by gradient direction and zeroed, the boundary is screened and the edge area is constructed by setting a double threshold, and an accurate edge image is obtained by pixel-by-pixel correction.
[0032] As a further solution of the present invention, based on the precise edge image, the gray level co-occurrence matrix is calculated, the spatial relationship of the gray levels of regional pixels in the image is analyzed, texture features such as contrast, uniformity and entropy are extracted, the nodule regional morphology is optimized through morphological operations, and unnecessary noise is removed. The specific steps of obtaining the nodule feature vector are as follows:
[0033] S501: Based on the precise edge image, for all pixels and neighborhoods in the image, data distribution is established by counting the co-occurrence frequencies of pixel grayscale values and neighborhood grayscale values, and a two-dimensional grayscale matrix data is generated by constructing a spatial correlation relationship between pixel grayscales through a matrix to generate a grayscale co-occurrence matrix;
[0034] S502: Based on the gray level co-occurrence matrix, normalize the distribution range of each group of data in the matrix, calculate the contrast value of each gray level combination, evaluate the regional difference, judge the gray level distribution law through the uniformity value, and obtain the texture eigenvalue matrix;
[0035] S503: Based on the texture eigenvalue matrix, the region boundary of the nodule region is adjusted through morphological operations, isolated pixel regions are identified and removed through connectivity analysis, and a unified data vector is generated by optimizing the region shape and texture consistency to obtain a nodule feature vector.
[0036] As a further solution of the present invention, the contrast value calculation formula is specifically:
[0037] C=∑ i,j (ij) 2 ·P norm (i,j);
[0038] Among them, i and j represent gray levels, P norm (i, j) represents the normalized frequency value, and C represents the contrast value.
[0039] A thyroid nodule grading and identification system, comprising:
[0040] The Gaussian filter module performs Gaussian filtering based on the ultrasound image, constructs a two-dimensional Gaussian kernel of the same size as the image, calculates the weight of each element in the kernel, and performs weighted operations based on the relative position of each pixel and the neighboring pixels and the pixel value to obtain a denoised image;
[0041] The brightness distribution analysis module performs brightness distribution analysis based on the denoised image, calculates the grayscale value distribution of pixels in the local area, adjusts the image histogram according to the contrast change of each local area, and generates a contrast enhanced image;
[0042] The sharpening processing module performs sharpening processing on the contrast enhanced image by using a Laplace operator, calculates the second-order gradient value of each pixel point, and combines the differentiated weighting coefficient to strengthen the fast-changing part of the image to obtain a sharpened image;
[0043] The edge detection module calculates the horizontal and vertical gradient values of each pixel based on the sharpened image, determines the preliminary edge position according to the gradient amplitude, screens the edge points through threshold judgment, uses the Canny algorithm to smooth the preliminary edge image, calculates the gradient amplitude and direction, and obtains an accurate edge image after double threshold processing;
[0044] The feature extraction module calculates the grayscale co-occurrence matrix based on the precise edge image, analyzes the spatial relationship of regional pixel grayscale in the image, extracts texture features such as contrast, uniformity and entropy, optimizes the nodule region morphology through morphological operations, and obtains the nodule feature vector.
[0045] Compared with the prior art, the advantages and positive effects of the present invention are:
[0046] In the present invention, the local brightness is optimized by dynamically adjusting the histogram to enhance the contrast and significantly improve the detail performance. The sharpening processing of the second-order gradient strengthens the edge definition of the rapidly changing area and reduces artifacts. The edge detection uses the composite gradient and double threshold strategy to improve the accuracy of edge recognition. The texture feature extraction is comprehensively analyzed through the gray-level co-occurrence matrix to enhance the stability and discrimination of the feature vector, providing a more reliable basis for medical diagnosis. 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 is a flow chart of the steps of S1 of the present invention;
[0050] Figure 3 is a flow chart of the steps of S2 of the present invention;
[0051] Figure 4 is a flow chart of the steps of S3 of the present invention;
[0052] Figure 5 is a flow chart of the steps of S4 of the present invention;
[0053] Figure 6 is a flow chart of the steps of S5 of the present invention;
[0054] Figure 7 It is a system module diagram of the present invention. DETAILED DESCRIPTION
[0055] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0056] 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.
[0057] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0058] In the embodiments of the present invention, sometimes the subscripts such as W 1 It may be written in non-subscript form such as W1. When the difference is not emphasized, the meaning is the same.
[0059] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0060] See also Figure 1 , a thyroid nodule grading and identification method, comprising the following steps:
[0061] S1: Perform Gaussian filtering on the ultrasound image, construct a two-dimensional Gaussian kernel of the same size as the image, calculate the weight of each element in the kernel, and perform weighted operations based on the relative position of each pixel and its neighboring pixels and the pixel value. Update each pixel value in the original image by weighted average to obtain a denoised image.
[0062] S2: Perform brightness distribution analysis based on the denoised image, calculate the grayscale value distribution of pixels in the local area, adjust the image histogram according to the contrast change of each local area, optimize the brightness of the local area in the image, and generate a contrast enhanced image;
[0063] S3: sharpen the contrast-enhanced image through the Laplace operator, calculate the second-order gradient value of each pixel, and update the pixel value in combination with the differentiated weighting coefficient to enhance the rapidly changing parts of the image and obtain a sharpened image;
[0064] S4: Based on the sharpened image, the horizontal and vertical gradient values of each pixel are calculated, the preliminary edge position is determined according to the gradient amplitude, the edge points are screened by threshold judgment, the preliminary edge image is smoothed using the Canny algorithm, the gradient amplitude and direction are calculated, non-maximum suppression is performed, and the accurate edge image is obtained after double threshold processing;
[0065] S5: Based on the precise edge image, the gray-level co-occurrence matrix is calculated, the spatial relationship of the grayscale of regional pixels in the image is analyzed, and texture features such as contrast, uniformity, and entropy are extracted. The nodule regional morphology is optimized through morphological operations, unnecessary noise is removed, and the nodule feature vector is obtained.
[0066] The denoised image includes weight distribution, pixel value after weighted average, and pixel distribution of the denoised image. The contrast enhanced image includes local grayscale distribution, optimized histogram, and enhanced brightness distribution. The sharpened image includes second-order gradient distribution, weighted gradient map, and pixel distribution after sharpening. The precise edge image includes gradient amplitude map, non-maximum suppression map, double threshold processing map, and final edge position map. The nodule feature vector includes grayscale co-occurrence matrix feature, contrast feature, uniformity feature, entropy feature, and morphological optimization feature.
[0067] See also Figure 2 , the specific steps of S1 are:
[0068] S101: Based on the ultrasound image, construct a two-dimensional Gaussian kernel of the same size as the image, calculate the size of the core matrix to establish a data matrix model, select a standard deviation parameter to adjust the spatial range of the kernel, assign a value to each element in the matrix to initialize the weight, and generate a Gaussian kernel;
[0069] By selecting the standard deviation parameter and adjusting it according to the pixel distribution and spatial characteristics in the image, the spatial range of the kernel will have an important impact on the feature extraction in the ultrasound image. The size of the Gaussian kernel is proportional to the degree of retention of image details. The standard deviation of the kernel affects the shape and range of the kernel, and affects the convolution effect between the kernel and the image. This process involves complex matrix operations and image processing theory. The two-dimensional kernel formed by the Gaussian function is not only related to the position of each pixel, but also to the grayscale values of the surrounding pixels. Such weight initialization can reduce noise interference while retaining edge information of the image. The generated Gaussian kernel is used for the next step of weight calculation.
[0070] S102: Based on the Gaussian kernel, the weight value of each element in the kernel is calculated, a position weight matrix is established through the distance between the pixel and the neighboring position, a value weight matrix is established through the difference between the pixel and the neighboring pixel value, and the position weight and the value weight are normalized by matrix operation to generate a weight matrix to obtain a weighted pixel map;
[0071] Based on the Gaussian kernel, calculate the weight value of each element in the kernel according to the formula
[0072]
[0073] Calculate the position weight and value weight. In the formula, d represents the Euclidean distance between pixel positions, σ represents the spatial standard deviation, and I i and I j Represents the neighborhood pixel value, and σ′ represents the standard deviation of the pixel value difference. Considering the characteristics of ultrasound images, the spatial standard deviation σ is set as a function of the image resolution, while the standard deviation σ′ of the pixel value difference is set based on the grayscale range of the image. Through experimental data, for example, the resolution of ultrasound images is 0.5 mm / pixel, and the grayscale range is 0 to 255, σ=1.5 and σ′=50 can be set. Further calculation of W ij :
[0074]
[0075] This result shows that after the position and value weights are combined, the neighboring pixels with similar pixel values have a greater influence on the central pixel.
[0076] S103: Based on weighted pixel mapping, a product operation is performed on each pixel point in the image and the corresponding value of the weight matrix, and a cumulative operation is performed on the product values of all neighboring pixels to complete local weighting, and the local weighted result and the weight sum are normalized to update the image pixel value to obtain a denoised image;
[0077] This neighborhood-based weighting strategy allows pixels to be affected not only by a single pixel, but by the entire neighborhood. This method can effectively smooth the image while maintaining important structural features in the image. The local weighted result is normalized with the sum of weights to ensure that the weighted pixel value does not exceed the range of the original data. This step is crucial to maintaining the overall dynamic range of the image. After updating the image pixel value, normalization is used to ensure that the image remains within a reasonable brightness range. The denoised image obtained shows clearer structural details than before, reducing noise without introducing additional artifacts.
[0078] See also Figure 3 , the specific steps of S2 are:
[0079] S201: Based on the denoised image, the image is divided into multiple local areas, the grayscale values of all pixels in the area are analyzed, a distribution histogram is generated by counting the occurrence frequency of the grayscale values, a grayscale distribution model is established by summarizing the grayscale ranges of different areas, and grayscale distribution data is generated;
[0080] This process involves a spatial division algorithm for the image, in which the size and shape of each local area are determined based on the heterogeneity of the image content to ensure that the pixels in the area have similar grayscale characteristics. In the process of analyzing the grayscale values of all pixels in the area, a statistical method is used to calculate the frequency of occurrence of grayscale values and generate a distribution histogram. This histogram helps to identify the grayscale distribution pattern in the area. By summarizing the grayscale ranges of different areas, a grayscale distribution model is established, which involves the construction of a mathematical model. This model can describe the frequency distribution characteristics of different grayscale values. The generated grayscale distribution data provides the necessary statistical information for subsequent processing.
[0081] S202: Based on the grayscale distribution data, for the grayscale distribution range of each local area, calculate the grayscale extreme value difference in the area, screen the adjustment area by setting the contrast change threshold, establish a grayscale mapping relationship to optimize the local grayscale distribution, and redistribute the grayscale value to generate an optimized grayscale mapping;
[0082] The grayscale extreme value difference calculation formula is as follows:
[0083]
[0084] Among them, ΔG represents the grayscale extreme value difference, G max Represents the maximum gray value in the area, G min Represents the minimum gray value in the area, C r Represents the grayscale contrast adjustment value in the area, and ∈ represents a small positive number to prevent zero.
[0085] Considering the actual image processing scenario, set the grayscale value samples in a local area to G = {120, 85, 90, 110, 95}. According to the formula, first calculate the grayscale extreme value difference of the area:
[0086] Maximum gray value G max =120
[0087] Minimum gray value G min =85
[0088] Grayscale extreme value difference ΔG=G max -G min =120-85=35
[0089] To prevent the denominator from being zero, set a small positive number ∈ = 0.1. Now, plug these values into the contrast adjustment formula:
[0090]
[0091] This calculation result C r ≈0.1706 represents the grayscale contrast adjustment value in this area. This value is small, indicating that the contrast in the area is low and may not require significant adjustment, but this depends on the set contrast change threshold T. If T is set to 0.15, then C r >T, indicating that the contrast of this area should be adjusted.
[0092] The results show that the contrast adjustment formula can effectively reflect the contrast changes in local areas and help determine which areas need to be adjusted to optimize the local grayscale distribution of the image.
[0093] S203: Based on the optimized grayscale mapping, the grayscale values of all pixels in the local area of the denoised image are adjusted, the grayscale values after remapping are calculated through the grayscale mapping model, and the pixel value adjustment is completed by updating the image data matrix to obtain a contrast enhanced image;
[0094] It includes calculating the grayscale value after remapping through a grayscale mapping model, wherein the grayscale mapping model is defined based on the grayscale extreme value difference of the previous step and the set contrast change threshold. Through this model, the grayscale value of each pixel can be adjusted according to the specific grayscale distribution of the local area, and the pixel value adjustment is completed by updating the image data matrix. This updating process involves matrix operations and data structure updates in image processing technology. The final result of obtaining a contrast enhanced image shows a clearer and more detailed image visual effect, making the image visually closer to the real scene under natural observation conditions.
[0095] See also Figure 4 , the specific steps of S3 are:
[0096] S301: extracting the neighborhood pixel value of each pixel based on the contrast enhanced image, calculating the second-order gradient of the gray value change of each pixel in the neighborhood, integrating the gradient value of each pixel through matrix operation, analyzing the gradient distribution data of the image, and generating a gradient matrix;
[0097] It involves using image processing algorithms to identify and analyze the pixel area around each pixel, calculating the second-order gradient of the grayscale value change of each pixel in the neighborhood, integrating the gradient value of each pixel through matrix operations, and analyzing the gradient distribution data of the image. It involves mathematical modeling of the image. The step of generating the gradient matrix is critical because it determines the effect and quality of subsequent image sharpening. The gradient matrix shows the rate of change of each pixel in the image in the spatial dimension. This data is crucial for understanding the structural characteristics of the image content.
[0098] S302: Based on the gradient matrix, for the difference between the gradient value of each pixel and the gradient value of the neighborhood, the weight coefficient is adjusted by setting the gradient difference range, and the weighted value is calculated by combining the gradient difference and the weight coefficient to obtain a weighted update matrix;
[0099] Based on the gradient matrix, the difference between the gradient value of each pixel and the gradient value of the neighborhood is calculated according to the formula Calculate the weighted value. In the formula, G i and G j represents the gradient value in the neighborhood, α and β are adjustment coefficients. Assume that the gradient values of two points in the neighborhood are G i =30 and G j =20, adjustment coefficients α = 0.5 and β = 0.1, calculate W ij :
[0100]
[0101] This result shows that pixels with larger gradient differences will receive higher weight values, which helps to enhance the edges and details in the image.
[0102] S303: Based on the weighted update matrix, for all pixels of the contrast enhanced image, the superposition result of the original pixel value and the weighted update value is calculated, the gray value of each pixel in the image is gradually updated, and the updated image matrix data is regenerated to obtain a sharpened image;
[0103] This process is achieved through mathematical formulas and image processing technology, which gradually updates the grayscale value of each pixel in the image and regenerates the updated image matrix data. These steps are the core of image sharpening. This method can significantly improve the visual clarity of the image. The process of obtaining a sharpened image not only improves the detail contrast of the image, but also enhances the overall visual effect, making the image visually closer to the natural state of human eye observation.
[0104] See also Figure 5 , the specific steps of S4 are:
[0105] S401: extracting each pixel point and its neighboring pixel values based on the sharpened image, obtaining a horizontal grayscale gradient value through a differential operation, obtaining a vertical grayscale gradient value through a vertical differential operation, establishing a gradient amplitude data matrix by synthesizing the horizontal and vertical gradient values, and generating a gradient amplitude map;
[0106] This process involves the design of spatial filters in image processing technology. The horizontal grayscale gradient value is obtained through differential operation. This calculation method uses the difference between pixel values to evaluate the spatial changes in the image. The vertical grayscale gradient value is obtained through vertical differential operation. The horizontal and vertical gradient values are synthesized to establish a gradient amplitude data matrix. This matrix describes the edge strength of each point in the image in the horizontal and vertical directions. The step of generating the gradient amplitude map is critical because it determines the visualization effect of the edge in the image, which is very critical for subsequent image analysis and processing.
[0107] S402: Based on the gradient amplitude map, for each pixel point, the gradient amplitude value is compared with the set upper and lower thresholds to screen valid edge points, and the connection relationship of the edge points is analyzed based on the gradient direction to perform positioning correction, and the valid edge points are integrated to establish edge distribution data to obtain an edge positioning map;
[0108] Based on the gradient amplitude map, for the gradient amplitude value of each pixel, according to the formula G′=max(GT low ,0)·min(GT high ,0), and perform threshold screening. In the formula, G represents the gradient amplitude value, T low and T high Represents the upper and lower thresholds. Set the gradient amplitude value G = 50, the upper threshold T high =40, lower threshold T low =20, calculate G′:
[0109] G′=max(50-20,0)·min(50-40,0)=30·10=300;
[0110] The results show that when the gradient amplitude value is within the set threshold range, the pixel point is regarded as a valid edge point. This process helps to reduce the impact of noise and improve the accuracy of edge detection.
[0111] S403: Based on the edge positioning map, for the gradient direction and gradient amplitude value of the edge point, non-maximum points are analyzed by gradient direction and zeroed, the boundary is screened and the edge area is constructed by setting a double threshold, and an accurate edge image is obtained by pixel-by-pixel correction;
[0112] By setting double thresholds to screen boundaries and construct edge areas, this process utilizes the directional information of the gradient to ensure the continuity and directionality of the edge. Through pixel-by-pixel correction, the accuracy and clarity of the edge can be significantly improved. The process of obtaining accurate edge images not only enhances the visual effect of the image, but also provides important edge information for further analysis of the image.
[0113] See also Figure 6 , the specific steps of S5 are:
[0114] S501: Based on the precise edge image, for all pixels and neighborhoods in the image, data distribution is established by counting the co-occurrence frequency of pixel grayscale values and neighborhood grayscale values, and a two-dimensional grayscale matrix data is generated by constructing a spatial correlation relationship between pixel grayscales through a matrix to generate a grayscale co-occurrence matrix;
[0115] This process involves pixel association analysis in image processing technology. Data distribution is established by counting the co-occurrence frequency of pixel grayscale values and neighborhood grayscale values. This statistical method reveals the spatial relationship between pixels. The spatial association relationship between pixel grayscales is constructed through matrices to generate two-dimensional grayscale matrix data. This process not only considers the grayscale value of the pixel, but also the positional relationship between the pixels. The step of generating the grayscale co-occurrence matrix is critical because it provides basic data for image texture analysis. These data have important application value in the fields of image analysis and machine vision.
[0116] S502: Based on the gray level co-occurrence matrix, normalize the distribution range of each group of data in the matrix, calculate the contrast value of each gray level combination, evaluate the regional difference, judge the gray level distribution law through the uniformity value, and obtain the texture eigenvalue matrix;
[0117] The contrast value calculation formula is as follows:
[0118] C=∑ i,j (ij) 2 ·P norm (i,j);
[0119] Among them, i and j represent gray levels, P norm (i, j) represents the normalized frequency value, and C represents the contrast value.
[0120] Then calculate P norm (i, j) process, assume that we have a simplified gray level co-occurrence matrix P (i, j) from a local image region, the specific values are as follows:
[0121]
[0122] Where i and j represent gray levels, ranging from 0 to 1. Calculate the normalization coefficient K, which is the sum of all elements of the matrix:
[0123] K = 0.1 + 0.2 + 0.3 + 0.4 = 1.0;
[0124] Then, calculate the normalized co-occurrence matrix P norm , in this case, since K is equal to 1, P norm Same as P. The next step is to calculate the contrast C using the formula:
[0125] C=(0-0) 2 0.1+(0-1) 2 0.2+(1-0) 2 0.3+(1-1) 2 0.4;
[0126] C=0·0.1+1·0.2+1·0.3+0·0.4=0.2+0.3=0.5;
[0127] The calculation shows that the contrast value C = 0.5 reflects the intensity of grayscale changes in the area. A larger value indicates a more drastic grayscale change in the image area, which helps to distinguish the texture features of the image.
[0128] Parameter explanation: P(i,j) is the original frequency value of position (i,j) in the gray level co-occurrence matrix, which represents the probability of gray levels i and j appearing at the same time. K is the normalization coefficient, which ensures that the sum of all normalized frequency values is 1, which is necessary for comparing gray level co-occurrence matrices of different sizes or under different conditions. norm (i, j) is the normalized frequency value, which is used for all further calculations such as texture descriptors such as contrast, energy, homogeneity, etc. C is the contrast value, which indicates the degree of grayscale variation within the image area. A high contrast indicates that the texture of the image has obvious changes, which helps to identify patterns or features.
[0129] This result shows that contrast values provide a means to quantify the clarity of image texture, help understand local variations in image content, and can be used in image analysis, texture recognition, and further image processing tasks.
[0130] S503: Based on the texture eigenvalue matrix, the region boundary of the nodule region is adjusted by morphological operation, isolated pixel regions are identified and removed by connectivity analysis, and a unified data vector is generated by optimizing the region shape and texture consistency to obtain a nodule feature vector;
[0131] It includes using morphological dilation and erosion techniques to refine and smooth boundaries, identifying isolated pixel areas through connectivity analysis for removal. This step is the post-processing stage in image processing, which aims to optimize the final visual effect of the image. It generates a unified data vector by optimizing the regional shape and texture consistency. The process of obtaining the nodule feature vector involves advanced image analysis techniques. These techniques help improve the accuracy and reliability of image analysis. Especially in the fields of medical image processing and biometrics, the acquisition of nodule feature vectors is an important step in diagnosis and research.
[0132] See also Figure 7 , a thyroid nodule grading and identification system, comprising:
[0133] The Gaussian filter module performs Gaussian filtering based on the ultrasound image, constructs a two-dimensional Gaussian kernel of the same size as the image, calculates the weight of each element in the kernel, and performs weighted operations based on the relative position of each pixel and the neighboring pixels and the pixel value to obtain a denoised image;
[0134] The brightness distribution analysis module performs brightness distribution analysis based on the denoised image, calculates the grayscale value distribution of pixels in the local area, adjusts the image histogram according to the contrast change of each local area, and generates a contrast-enhanced image;
[0135] The sharpening processing module sharpens the contrast-enhanced image through the Laplace operator, calculates the second-order gradient value of each pixel, and combines the differentiated weighting coefficient to strengthen the fast-changing part of the image to obtain a sharpened image;
[0136] The edge detection module calculates the horizontal and vertical gradient values of each pixel based on the sharpened image, determines the preliminary edge position according to the gradient amplitude, selects the edge points through threshold judgment, uses the Canny algorithm to smooth the preliminary edge image, calculates the gradient amplitude and direction, and obtains the accurate edge image after double threshold processing;
[0137] The feature extraction module is based on the precise edge image, calculates the grayscale co-occurrence matrix, analyzes the spatial relationship of regional pixel grayscale in the image, extracts texture features such as contrast, uniformity and entropy, optimizes the nodule region morphology through morphological operations, and obtains the nodule feature vector.
[0138] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for grading and identifying thyroid nodules, characterized in that: The following steps are involved: S1: Perform Gaussian filtering on the ultrasound image, construct a two-dimensional Gaussian kernel of the same size as the image, calculate the weight of each element in the kernel, and perform weighted operations based on the relative position of each pixel and its neighboring pixels and the pixel value. Update each pixel value in the original image by weighted average to obtain a denoised image. S2: performing brightness distribution analysis based on the denoised image, calculating the grayscale value distribution of pixels in the local area, adjusting the histogram of the image according to the contrast change of each local area, optimizing the brightness of the local area in the image, and generating a contrast enhanced image; S3: sharpening the contrast enhanced image by using a Laplace operator, calculating the second-order gradient value of each pixel, updating the pixel value in combination with the differentiated weighting coefficient, strengthening the rapidly changing part of the image, and obtaining a sharpened image; S4: Based on the sharpened image, the horizontal and vertical gradient values of each pixel are calculated, the preliminary edge position is determined according to the gradient amplitude, the edge points are screened by threshold judgment, the preliminary edge image is smoothed using the Canny algorithm, the gradient amplitude and direction are calculated, non-maximum suppression is performed, and an accurate edge image is obtained after double threshold processing; S5: Based on the precise edge image, the grayscale co-occurrence matrix is calculated, the spatial relationship of the grayscale of regional pixels in the image is analyzed, texture features such as contrast, uniformity and entropy are extracted, the nodule region morphology is optimized through morphological operations, and the nodule feature vector is obtained.
2. The method for grading and identifying thyroid nodules according to claim 1, characterized in that: The denoised image includes weight distribution, pixel values after weighted averaging, and pixel distribution of the denoised image; the contrast enhanced image includes local grayscale distribution, optimized histogram, and enhanced brightness distribution; the sharpened image includes second-order gradient distribution, weighted gradient map, and sharpened pixel distribution; the precise edge image includes gradient amplitude map, non-maximum suppression map, dual threshold processing map, and final edge position map; the nodule feature vector includes grayscale co-occurrence matrix features, contrast features, uniformity features, entropy features, and morphological optimization features.
3. The method for grading and identifying thyroid nodules according to claim 1, characterized in that: Based on the ultrasound image, Gaussian filtering is performed to construct a two-dimensional Gaussian kernel of the same size as the image. The weight of each element in the kernel is calculated. The weight value is weighted according to the relative position of each pixel and the neighboring pixel and the pixel value. Each pixel value in the original image is updated by weighted average. The specific steps to obtain the denoised image are as follows: S101: Based on the ultrasound image, construct a two-dimensional Gaussian kernel of the same size as the image, calculate the size of the core matrix to establish a data matrix model, select a standard deviation parameter to adjust the spatial range of the kernel, assign a value to each element in the matrix to initialize the weight, and generate a Gaussian kernel; S102: Based on the Gaussian kernel, a weight value of each element in the kernel is calculated, a position weight matrix is established through the distance between the pixel and the neighboring position, a value weight matrix is established through the difference between the pixel and the neighboring pixel value, and the position weight and the value weight are normalized by matrix operation to generate a weight matrix to obtain a weighted pixel map; S103: Based on the weighted pixel mapping, a product operation is performed on each pixel point in the image and the corresponding value of the weight matrix, and a cumulative operation is performed on the product values of all neighborhood pixels to complete local weighting, and the local weighted result and the weight sum are normalized to update the image pixel value to obtain a denoised image.
4. The method for grading and identifying thyroid nodules according to claim 1, characterized in that: The specific steps of performing brightness distribution analysis based on the denoised image, calculating the grayscale value distribution of pixels in the local area, adjusting the image histogram according to the contrast change of each local area, optimizing the brightness of the local area in the image, and generating a contrast enhanced image are as follows: S201: Based on the denoised image, divide the image into multiple local areas, analyze the grayscale values of all pixels in the area, generate a distribution histogram by counting the occurrence frequency of the grayscale values, establish a grayscale distribution model by summarizing the grayscale ranges of different areas, and generate grayscale distribution data; S202: Based on the grayscale distribution data, for the grayscale distribution range of each local area, calculate the grayscale extreme value difference in the area, screen the adjustment area by setting a contrast change threshold, establish a grayscale mapping relationship to optimize the local grayscale distribution, and redistribute the grayscale value to generate an optimized grayscale mapping; S203: Based on the optimized grayscale mapping, the grayscale values of all pixels in the local area of the denoised image are adjusted, the grayscale values after remapping are calculated through the grayscale mapping model, the pixel value adjustment is completed by updating the image data matrix, and a contrast enhanced image is obtained.
5. The method for grading and identifying thyroid nodules according to claim 4, characterized in that: The grayscale extreme value difference calculation formula is specifically: Among them, ΔG represents the grayscale extreme value difference, G max Represents the maximum gray value in the area, G min Represents the minimum gray value in the area, C r Represents the grayscale contrast adjustment value in the area, and ∈ represents a small positive number to prevent zero.
6. The method for grading and identifying thyroid nodules according to claim 1, characterized in that: The contrast enhanced image is sharpened by the Laplace operator, the second-order gradient value of each pixel is calculated, and the pixel value is updated in combination with the differentiated weighted coefficient to strengthen the fast-changing part of the image. The specific steps of obtaining the sharpened image are as follows: S301: extracting neighborhood pixel values of each pixel based on the contrast enhanced image, calculating the second-order gradient of the gray value change of each pixel in the neighborhood, integrating the gradient value of each pixel through matrix operation, analyzing the gradient distribution data of the image, and generating a gradient matrix; S302: Based on the gradient matrix, for the difference between the gradient value of each pixel and the gradient value of the neighborhood, the weight coefficient is adjusted by setting the gradient difference range, and the weighted value is calculated by combining the gradient difference and the weight coefficient to obtain a weighted update matrix; S303: Based on the weighted update matrix, for all pixels of the contrast enhanced image, the superposition result of the original pixel value and the weighted update value is calculated, the gray value of each pixel in the image is gradually updated, and the updated image matrix data is regenerated to obtain a sharpened image.
7. The method for grading and identifying thyroid nodules according to claim 1, characterized in that: Based on the sharpened image, the horizontal and vertical gradient values of each pixel are calculated, the preliminary edge position is determined according to the gradient amplitude, the edge points are screened by threshold judgment, the preliminary edge image is smoothed using the Canny algorithm, the gradient amplitude and direction are calculated, non-maximum suppression is performed, and after double threshold processing, the specific steps of obtaining an accurate edge image are as follows: S401: Based on the sharpened image, extract each pixel point and its neighboring pixel values, obtain the horizontal grayscale gradient value through differential operation, obtain the vertical grayscale gradient value through vertical differential operation, establish a gradient amplitude data matrix by synthesizing the horizontal and vertical gradient values, and generate a gradient amplitude map; S402: Based on the gradient amplitude map, for each pixel point, the gradient amplitude value is compared with the set upper and lower thresholds to screen valid edge points, and the connection relationship of the edge points is analyzed based on the gradient direction to perform positioning correction, and the valid edge points are integrated to establish edge distribution data to obtain an edge positioning map; S403: Based on the edge positioning map, for the gradient direction and gradient amplitude value of the edge point, non-maximum points are analyzed by gradient direction and zeroed, the boundary is screened and the edge area is constructed by setting a double threshold, and an accurate edge image is obtained by pixel-by-pixel correction.
8. The method for grading and identifying thyroid nodules according to claim 1, characterized in that: Based on the precise edge image, the gray level co-occurrence matrix is calculated, the spatial relationship of the gray levels of regional pixels in the image is analyzed, texture features such as contrast, uniformity and entropy are extracted, the nodule regional morphology is optimized through morphological operations, unnecessary noise is removed, and the specific steps of obtaining the nodule feature vector are as follows: S501: Based on the precise edge image, for all pixels and neighborhoods in the image, data distribution is established by counting the co-occurrence frequencies of pixel grayscale values and neighborhood grayscale values, and a two-dimensional grayscale matrix data is generated by constructing a spatial correlation relationship between pixel grayscales through a matrix to generate a grayscale co-occurrence matrix; S502: Based on the gray level co-occurrence matrix, normalize the distribution range of each group of data in the matrix, calculate the contrast value of each gray level combination, evaluate the regional difference, judge the gray level distribution law through the uniformity value, and obtain the texture eigenvalue matrix; S503: Based on the texture eigenvalue matrix, the region boundary of the nodule region is adjusted through morphological operations, isolated pixel regions are identified and removed through connectivity analysis, and a unified data vector is generated by optimizing the region shape and texture consistency to obtain a nodule feature vector.
9. The method for grading and identifying thyroid nodules according to claim 8, characterized in that: The contrast value calculation formula is specifically: C=∑ i,j (i-j) 2 ·P norm (i,j); Among them, i and j represent gray levels, P norm (i, j) represents the normalized frequency value, and C represents the contrast value.
10. A thyroid nodule grading and identification system, characterized in that: According to a method for grading and identifying thyroid nodules according to any one of claims 1 to 9, the system comprises: The Gaussian filter module performs Gaussian filtering based on the ultrasound image, constructs a two-dimensional Gaussian kernel of the same size as the image, calculates the weight of each element in the kernel, and performs weighted operations based on the relative position of each pixel and the neighboring pixels and the pixel value to obtain a denoised image; The brightness distribution analysis module performs brightness distribution analysis based on the denoised image, calculates the grayscale value distribution of pixels in the local area, adjusts the image histogram according to the contrast change of each local area, and generates a contrast enhanced image; The sharpening processing module performs sharpening processing on the contrast enhanced image by using a Laplace operator, calculates the second-order gradient value of each pixel point, and combines the differentiated weighting coefficient to strengthen the fast-changing part of the image to obtain a sharpened image; The edge detection module calculates the horizontal and vertical gradient values of each pixel based on the sharpened image, determines the preliminary edge position according to the gradient amplitude, screens the edge points through threshold judgment, uses the Canny algorithm to smooth the preliminary edge image, calculates the gradient amplitude and direction, and obtains an accurate edge image after double threshold processing; The feature extraction module calculates the grayscale co-occurrence matrix based on the precise edge image, analyzes the spatial relationship of regional pixel grayscale in the image, extracts texture features such as contrast, uniformity and entropy, optimizes the nodule region morphology through morphological operations, and obtains the nodule feature vector.
Citation Information
Patent Citations
Thyroid nodule contour feature analysis method, system and device based on edge gradient direction and medium
CN117522844A
Thyroid ultrasound region feature analysis method, system and device based on echo intensity and texture information and medium
CN117830656A
Image analysis method and system based on deep learning
CN118429242A
Part surface quality detection method and system based on machine vision
CN118608504A
Medical image processing method and system, computer equipment and storage medium
CN118710546A
Cited By
Laminating flatness detection method for plastic floor
CN120852361A