A method for determining the lesion area of colorectal polyps, an electronic device and a storage medium
By performing brightness and noise preprocessing and color difference parameter analysis on colorectal polyp detection images, combined with multi-dimensional feature discrimination, the problems of insufficient accuracy and high false positive rate in traditional detection are solved, and efficient and accurate polyp lesion area identification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING SHANGYE MEDICAL EQUIP CO LTD
- Filing Date
- 2026-04-30
- Publication Date
- 2026-07-17
AI Technical Summary
Traditional colorectal polyp detection methods rely on a single feature to screen for lesion areas, resulting in insufficient accuracy, coarse area definition, and blurred edge segmentation. This makes it difficult to distinguish polyps from physiological interference, leading to frequent false positives and high false negatives, and failing to meet the needs of efficient and accurate screening.
By preprocessing the original image for brightness and noise, the color difference parameters of the pixels are obtained. The membership degree is calculated using a clustering model. The lesion area is determined by combining the multi-dimensional features of contour, gray level and color difference, eliminating the interference of light and accurately locating the suspected polyp area.
It effectively reduces the risk of missed diagnoses, improves the accuracy and stability of detection, reduces false positives, and is suitable for precise clinical screening of colorectal polyps.
Smart Images

Figure CN122115485B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a method for determining the lesion area of colorectal polyps, an electronic device, and a storage medium. Background Technology
[0002] Currently, in clinical screening and traditional machine vision-assisted detection scenarios, conventional visual detection methods for colorectal polyps generally rely solely on raw intestinal images acquired in real-time by electronic anoscopes or proctoscopes as the only data source for analysis. In the screening of suspected lesions and the preliminary determination of lesion areas, traditional methods rely solely on image grayscale information or basic contour features for simple calculations, using coarse processing logic such as fixed threshold segmentation and basic edge extraction to roughly select suspected target areas. This coarse screening mode based on a single feature easily leads to insufficient precision in extracting polyp lesion areas, coarse definition of area ranges, and unclear lesion edge segmentation, failing to accurately match the true morphological boundaries of the polyp. Meanwhile, the intestinal physiological environment is complex. The physiological mucosal folds, scattered pigmented patches, mucus-attached areas, and mucosal reddening tissue caused by local inflammation widely distributed in the intestinal wall are highly similar to the visual appearance of flat polyps, micropolyps, and early proliferative polyps in terms of single dimensions such as grayscale values and basic contour morphology. Traditional detection methods lack the ability to integrate and distinguish multiple dimensions such as color, texture, and spatial morphology. They rely on a single feature to identify lesions and cannot effectively eliminate the false positive effects caused by various physiological interferences and imaging noise. They are difficult to accurately distinguish between real polyp lesion areas and normal mucosal interference areas, which ultimately leads to frequent misjudgments and a high rate of missed detection of small and hidden polyps during the detection process. The overall detection stability and accuracy are poor, making it difficult to meet the actual needs of efficient and accurate screening of colorectal polyps in clinical practice. Summary of the Invention
[0003] In view of this, the purpose of the embodiments of this application is to provide a method for determining the lesion area of colorectal polyps, an electronic device and a storage medium, which can improve at least one of the technical problems mentioned in the background art.
[0004] To achieve the above technical objectives, the technical solution adopted in this application is as follows:
[0005] In a first aspect, embodiments of this application provide a method for determining the lesion area of colorectal polyps, the method comprising:
[0006] Acquire the original image of the area to be detected based on the visual terminal;
[0007] The original image is preprocessed to obtain a processed image, wherein the preprocessing is used to remove brightness noise from the original image;
[0008] Based on a preset extraction tool, the first color difference parameter of each first pixel in the processed image is obtained;
[0009] Based on each of the first color difference parameters, the membership degree of each first pixel as a suspected polyp is obtained according to the clustering model;
[0010] Based on the membership of all the first pixels, the initial lesion area of the suspected polyp is determined;
[0011] Based on the contour of the initial lesion region, the gray level of each second pixel in the initial lesion region, and the second color difference parameter of each second pixel, the determination result of whether the initial lesion region is a colorectal polyp lesion region is obtained.
[0012] According to the first aspect, the preprocessing of the original image to obtain the processed image includes:
[0013] Obtain the original brightness of each third pixel in the original image, and the brightness variance of the first neighborhood centered on each third pixel;
[0014] Based on the brightness variance, a suitable Gaussian kernel is matched for each of the first neighborhoods, wherein the brightness variance is negatively correlated with the window size and standard deviation of the Gaussian kernel.
[0015] Based on the Gaussian kernel, a convolution operation is performed with all third pixels in the first neighborhood that match to obtain the luminance noise component of each third pixel, wherein the luminance noise is obtained from the luminance noise components of all the third pixels;
[0016] The processed image is obtained based on the original luminance and luminance noise component of the third pixel.
[0017] According to the first aspect, obtaining the first color difference parameter of each first pixel in the processed image based on a preset extraction tool includes:
[0018] The processed image is mapped to the Lab color space;
[0019] Based on the extraction tool, the first color difference component of the a channel and the second color difference component of the b channel of each first pixel in the processed image after mapping to the Lab color space are extracted.
[0020] By splicing the first color difference component and the second color difference component, the first color difference parameter is obtained.
[0021] According to the first aspect, obtaining the membership degree of each first pixel as a suspected polyp based on each first color difference parameter and according to a clustering model includes:
[0022] A1: Input all the first color difference parameters into the clustering model, and according to the clustering model, obtain the membership degree of each first pixel with several cluster centers of the clustering model. One of the several cluster centers is used to characterize suspected polyps.
[0023] A2: Input the membership degree of each first pixel and the membership degrees of all other second pixels in the second neighborhood centered on the first pixel into the objective function to obtain the objective value;
[0024] A3: Update the cluster center based on the membership degree of each first pixel and the membership degrees of all other first pixels in the second neighborhood centered on each first pixel, wherein the initial cluster center is obtained by a preset;
[0025] A4: Repeat A1-A3 until the difference between the target values obtained from two consecutive executions of A2 is less than or equal to a preset threshold.
[0026] A5: Input each of the first color difference parameters into the clustering model obtained after executing A4 to obtain the membership degree of each first pixel as a suspected polyp;
[0027] The objective function is:
[0028]
[0029] This represents the first color difference parameter of the first pixel;
[0030] Characteristic parameters representing cluster centers;
[0031] This represents the membership degree of the first pixel i to cluster j;
[0032] m represents the fuzzy coefficient;
[0033] N represents the total number of pixels, and C represents the number of cluster categories;
[0034] Indicates the spatial weight constraint coefficient;
[0035] This represents the constraint value of the second neighborhood of the first pixel i. , Let represent the set of all first pixels within the second neighborhood. This indicates the membership degree of other first pixels o within the second neighborhood to cluster j;
[0036] This represents the penalty weighting coefficient;
[0037] This represents the color difference distance penalty value of the first pixel i. , These represent the pixel mean values of normal mucosa in channel a and channel b, respectively. Indicates the penalty factor. These represent the first color difference component and the second color difference component of the first pixel i, respectively.
[0038] According to the first aspect, determining the initial lesion region of a suspected polyp based on all of the membership degrees includes:
[0039] Obtain the first pixel in the processed image whose membership degree is greater than the membership threshold;
[0040] Based on the first pixel whose membership degree is greater than the membership degree threshold, a connected component is obtained, wherein the number of pixels in the connected component whose membership degree is greater than the membership degree threshold is at least a specified number;
[0041] Calculate the total pixel area, contour compactness, and edge smoothness of the connected region, wherein the contour compactness is obtained based on the total pixel area of the connected region and the edge contour length of the connected region, and the edge smoothness is obtained based on the curvature between every two adjacent contour points in the edge contour of the connected region.
[0042] Delete connected components that meet the rejection criteria, and the remaining connected components are the initial lesion regions. The rejection criteria are used to characterize connected components whose total pixel area is less than a preset area threshold, whose contour compactness is less than a first auxiliary threshold, or whose edge smoothness is less than a second auxiliary threshold.
[0043] According to the first aspect, determining whether the initial lesion region is a colorectal polyp lesion region based on the contour of the initial lesion region and the gray level and second color difference parameter of each second pixel in the initial lesion region includes:
[0044] Based on the contour of the initial lesion region, and the gray level and second color difference parameter of each second pixel in the initial lesion region, the overall gray level fluctuation coefficient, overall contour roughness, and overall pixel uniformity of the initial lesion region are obtained. The overall gray level fluctuation coefficient is calculated based on the gray level of each second pixel, the overall contour roughness is calculated based on the contour of the initial lesion region, and the overall pixel uniformity is calculated based on the color difference parameter of each second pixel.
[0045] The determination of whether the initial lesion area is a colorectal polyp lesion area is based on the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity.
[0046] According to the first aspect, obtaining the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity of the initial lesion region based on the contour of the initial lesion region and the grayscale and second color difference parameters of each second pixel in the initial lesion region includes:
[0047] Obtain the sub-contour of the portion of the initial lesion area corresponding to the sliding window, as well as the grayscale of all second pixels in each sliding window and the second color difference parameter of each second pixel, wherein the number of sliding windows is several, the size of the several sliding windows is different, and the sliding window slides along a preset direction on the initial lesion area;
[0048] Based on the sub-contour, and the grayscale of all second pixels in each sliding window and each second color difference parameter, the local grayscale fluctuation coefficient, local contour roughness and local pixel uniformity of each sliding window are calculated.
[0049] Calculate the weighted average of the local grayscale fluctuation coefficient, the weighted average of the local contour roughness, and the weighted average of the local pixel uniformity of all sliding windows corresponding to each size, to obtain the grayscale fluctuation coefficient before fusion, the contour roughness before fusion, and the pixel uniformity before fusion corresponding to each size.
[0050] The overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity are obtained by fusing the grayscale fluctuation coefficients before fusion, the front contour roughness, and the pixel uniformity before fusion corresponding to sliding windows of all sizes.
[0051] According to the first aspect, determining whether the initial lesion region is a colorectal polyp lesion region based on the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity includes:
[0052] The initial lesion region that satisfies at least two of the following conditions: the overall grayscale fluctuation coefficient is greater than the first fluctuation threshold, the overall contour roughness is greater than the first roughness threshold, and the overall pixel uniformity is greater than the first uniformity threshold, is taken as the region to be optimized.
[0053] The initial lesion region that satisfies one of the following conditions is: the overall grayscale fluctuation coefficient is greater than the first fluctuation threshold, the overall contour roughness is between the first roughness threshold and the second roughness threshold, and the overall pixel uniformity is between the first uniformity threshold and the second uniformity threshold. The second roughness threshold is less than the first roughness threshold, and the second uniformity threshold is less than the first uniformity threshold.
[0054] The initial lesion region that satisfies one of the following conditions is: the overall contour roughness is greater than the first roughness threshold, the overall gray level fluctuation coefficient is between the first fluctuation threshold and the second fluctuation threshold, and the overall pixel uniformity is between the first uniformity threshold and the second uniformity threshold. The first fluctuation threshold is greater than the second fluctuation threshold.
[0055] The initial lesion region that satisfies one of the following conditions is: the overall pixel uniformity is greater than the first uniformity threshold, the overall gray level fluctuation coefficient is between the first fluctuation threshold and the second fluctuation threshold, and the overall contour roughness is between the first roughness threshold and the second roughness threshold. The first roughness threshold is greater than the second roughness threshold.
[0056] Extract the position coordinates of the fourth pixel of the edge of the region to be optimized;
[0057] Calculate the gradient magnitude of all fourth pixels at the edges of the region to be optimized;
[0058] Substitute all the aforementioned location coordinates and gradient magnitudes into the energy function, so that after the iteration termination condition is met based on the energy function, the edge of the region to be optimized is corrected to obtain the colorectal polyp lesion region, wherein the energy function is:
[0059]
[0060] This represents the total energy of the energy function;
[0061] For the contour length constraint,
[0062] This refers to the Heaviside function. gradient operator
[0063] The coordinate position at time t is... The level set function, when When located at the outline of the region to be optimized, ,when When located within the region to be optimized, ,when When located outside the region to be optimized, ;
[0064] These are the x-coordinate components and y-coordinate components of the fourth pixel in the original image coordinate system, respectively.
[0065] This represents the entire region to be optimized.
[0066] This indicates the contour length constraint.
[0067]
[0068] This represents the total pixel area of the region to be optimized;
[0069]
[0070] This represents the gradient boundary penalty term;
[0071] The grayscale image matrix represents the region to be optimized, and the grayscale image matrix includes the grayscale values of all fourth pixels;
[0072] This represents the gradient magnitude;
[0073]
[0074] This represents the a priori constraint term for polyp morphology;
[0075] This represents the second-order differential operator of Laplace;
[0076] This represents the baseline threshold for the standard physiological curvature of polyps.
[0077] Secondly, embodiments of this application provide an electronic device, which includes a processor and a memory coupled to each other. The memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the method described in the first aspect.
[0078] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method described in the first aspect.
[0079] The invention employing the above technical solution has the following advantages:
[0080] In the technical solution provided in this application, original endoscopic images of the anorectal area to be examined are acquired through a visual terminal. Addressing inherent imaging problems such as light attenuation in the closed cavity of the electronic anoscope, direct lens reflection, and uneven brightness distribution, preprocessing is performed on the original images to remove various brightness noises and lighting interferences, thus avoiding the negative impact of imaging defects on subsequent feature analysis. A preset extraction tool comprehensively acquires the color difference parameters of each pixel in the processed image, adding key color dimension features to compensate for the limitation of grayscale features in distinguishing color-altering tissues. The pixel color difference parameters are input into a clustering model, and the membership degree of each pixel belonging to a suspected polyp is calculated based on the color features. Fuzzy clustering quantification is used to distinguish pixels with discolored lesions from normal mucosa. Interfering pixels such as pigmentation and mucus spots are precisely located in the initial lesion area of suspected polyps based on the global pixel membership distribution, overcoming the problems of coarse segmentation, rough lesion area extraction, and inaccurate boundary fitting of traditional fixed thresholds. Finally, it no longer relies on a single discrimination criterion, but integrates the contour morphology features of the initial lesion area, the pixel grayscale distribution features within the area, and pixel color difference parameters for comprehensive judgment. It makes full use of the differences between real polyps and physiological mucosal folds, local inflammatory redness, and abnormal pigmentation areas in terms of contour structure, grayscale fluctuation, and color uniformity, to achieve multi-feature joint identification. This solves the problems of traditional technology having single feature dimensions, weak anti-interference ability, and difficulty in distinguishing between real and false lesions, and completes the identification and judgment of colorectal polyp lesion areas.
[0081] This solution effectively overcomes the technical drawbacks of traditional visual detection methods for colorectal polyps, such as limited features, crude screening logic, and sensitivity to imaging interference. Through pre-processing of brightness and noise, it adapts to the special enclosed imaging environment of a proctoscopy, eliminating detection errors caused by uneven lighting and high-level reflections, thus improving the basic image quality and the reliability of subsequent feature extraction. By introducing color difference parameters combined with clustering membership analysis, it captures the typical pathological color features of polyp congestion and discoloration, enabling the identification of flat polyps with slight grayscale differences and small early-stage polyps, significantly reducing the risk of missed detection of occult polyps. Based on pixel... Membership clustering is used to delineate the initial lesion area, replacing the traditional coarse threshold segmentation mode and improving the defects of vague lesion area definition and inaccurate edge segmentation. Combined with a multi-dimensional fusion discrimination mechanism of contour, gray level and color difference, it can efficiently distinguish various false positive interference areas such as intestinal physiological folds, mucus adhesion, pigmentation, and local inflammation redness, greatly reducing misjudgment and comprehensively improving the accuracy, stability and anti-interference ability of polyp detection. It can efficiently and accurately output reliable polyp judgment results and meet the actual application needs of large-scale and accurate screening of colorectal polyps in clinical practice. Attached Figure Description
[0082] This application can be further illustrated by the non-limiting embodiments given in the accompanying drawings. It should be understood that the following drawings only illustrate some embodiments of this application and should not be considered as limiting the scope. For those skilled in the art, other related drawings can be obtained from these drawings without any inventive effort.
[0083] Figure 1 This is a flowchart illustrating a method for determining the lesion area of colorectal polyps provided in an embodiment of this application.
[0084] Figure 2 This is a sub-flowchart of S120 provided in an embodiment of this application.
[0085] Figure 3 This is a sub-flowchart of S140 provided in an embodiment of this application.
[0086] Figure 4 This is a sub-flowchart of S150 provided in an embodiment of this application. Detailed Implementation
[0087] The present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that similar or identical parts are referred to by the same reference numerals in the drawings or description. Implementations not shown or described in the drawings are forms known to those skilled in the art. In the description of this application, terms such as "first" and "second" are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0088] Please refer to Figure 1 This application provides a method for determining the lesion area of colorectal polyps, which can be applied to an electronic device and can be executed or implemented by the electronic device. The electronic device can be, but is not limited to, a personal computer, a smartphone, or other electronic devices. The method for determining the lesion area of colorectal polyps may include the following steps:
[0089] S110, acquire the original image of the area to be detected based on the visual terminal;
[0090] S120, preprocess the original image to obtain a processed image, wherein the preprocessing is used to remove brightness noise from the original image;
[0091] S130, based on a preset extraction tool, obtain the first color difference parameter of each first pixel in the processed image;
[0092] S140, based on each of the first color difference parameters, according to the clustering model, obtain the membership degree of each of the first pixels as suspected polyps;
[0093] S150, based on the membership of all the first pixels, determine the initial lesion area of the suspected polyp;
[0094] S160, based on the contour of the initial lesion region, the gray level of each second pixel in the initial lesion region, and the second color difference parameter of each second pixel, determine whether the initial lesion region is a colorectal polyp lesion region.
[0095] In this embodiment, the original image is first preprocessed to remove brightness noise and avoid noise interference with subsequent feature extraction. Pixel-level color difference parameters are extracted, and the polyp membership degree of each pixel is quantified by a clustering algorithm to achieve initial region localization. Then, by combining multi-dimensional features such as pixel grayscale, region contour, and color difference parameters, the lesion region is comprehensively determined. This not only solves the problem of noise interference in the original image but also overcomes the shortcomings of traditional detection methods, such as single features, coarse region localization, and vague judgment criteria. Ultimately, the identification and determination of colorectal polyps are achieved, ensuring the accuracy and reliability of the detection results.
[0096] The following is a detailed explanation of each step in the method for determining the lesion area of colorectal polyps:
[0097] In S110, the visual terminal can be an electronic anoscope, the area to be detected can be the mucosal tissue of the human colorectal and anal canal wall, and the original image can be the original intestinal mucosal endoscopic image acquired in real time by the electronic anoscope.
[0098] In S120, preprocessing of the original image is used to eliminate lighting noise such as uneven illumination, local reflections, and shadow interference in the electronic anoscope's captured image. This weakens image quality interference caused by complex endoscopic imaging environments, corrects differences in image brightness distribution, optimizes overall image quality, and ensures the accuracy and effectiveness of subsequent pixel color difference parameter and grayscale feature extraction. Therefore, as... Figure 2 As shown, S120 specifically includes the following steps:
[0099] S121: Obtain the original brightness of each third pixel in the original image, and the brightness variance of the first neighborhood centered on each third pixel;
[0100] S122: Based on the brightness variance, match a suitable Gaussian kernel for each of the first neighborhoods, wherein the brightness variance is negatively correlated with the window size and standard deviation of the Gaussian kernel;
[0101] S123: Based on the Gaussian kernel, perform a convolution operation with all third pixels in the first neighborhood that match it to obtain the luminance noise component of each third pixel, wherein the luminance noise is obtained from the luminance noise components of all the third pixels;
[0102] S124: Obtain the processed image based on the original luminance and luminance noise component of the third pixel.
[0103] In this embodiment, the original image is an RGB image. To obtain the original brightness of the original image, the RGB image is converted to the HSV color space, and the brightness (V) channel, hue (H) channel, and saturation (S) channel are separated. The original image acquired by the electronic anoscope is color space converted, and the brightness channel data in the HSV color space is extracted to obtain the original brightness value corresponding to each third pixel in the image. This value reflects the original illumination intensity state of the intestinal mucosa region. Simultaneously, a first neighborhood is defined with any third pixel in the image as the center, and the brightness information of all third pixels within this neighborhood is collected. The degree of discrete fluctuation of the brightness data within the neighborhood is statistically analyzed using variance calculation, and the brightness variance of the first neighborhood corresponding to each central third pixel is obtained. Local brightness variance can accurately quantify the illumination complexity of different regions, effectively distinguishing areas of abrupt changes in highlight reflection, areas of transitional light and shadow in wrinkles, and areas of uniform dark light in the deep intestine in anoscopy imaging. This third-pixel-level local feature quantification provides a reliable quantitative judgment index for subsequent Gaussian kernel adaptive matching and differential brightness noise estimation.
[0104] S122 uses the brightness variance of each first neighborhood output by S121 as the matching basis. According to the mapping rule that brightness variance is negatively correlated with Gaussian kernel window size and Gaussian standard deviation, it adaptively matches the corresponding Gaussian kernel parameters for each first neighborhood. The larger the brightness variance of the first neighborhood, the more severe the local illumination fluctuations and the more serious the specular reflection and light and shadow interference, corresponding to matching a Gaussian kernel with a larger window size and a larger standard deviation; the smaller the brightness variance of the region, the more gentle the illumination distribution on the mucosa surface and the less obvious strong light interference, corresponding to matching a Gaussian kernel with a small size and a low standard deviation.
[0105] In this embodiment, the luminance variance of each first neighborhood is calculated based on the following formula:
[0106]
[0107] Indicates the third pixel The luminance variance of the first neighborhood centered at the center;
[0108] This indicates the number of third pixels within the first neighborhood;
[0109] The set of the third pixels of the first neighborhood is represented. In this embodiment, the first neighborhood is an 8×8 neighborhood window.
[0110] express The average brightness value of all third pixels within the range;
[0111] Represents all third pixels within the first neighborhood. The brightness.
[0112] For example, the way to match a Gaussian kernel can be:
[0113] This embodiment includes small-scale Gaussian kernels, medium-scale Gaussian kernels, and large-scale Gaussian kernels, wherein:
[0114] The convolution window size of the small-scale Gaussian kernel is 3×3, and the Gaussian standard deviation is 1.2. It is used for local small-range illumination estimation, covering only tiny reflective spots, correcting only local strong light, without blurring the fine texture of mucous membranes and polyps, thus avoiding loss of detail.
[0115] The convolution window size of the mesoscale Gaussian kernel is 7×7, and the Gaussian standard deviation is 4.5. It is used to match the light and shadow changes of the regular folds of the intestine, balance the slight local light and dark differences, and serve as the basic correction scale for the whole image to ensure a natural transition.
[0116] The large-scale Gaussian kernel has a convolution window size of 15×15 and a Gaussian standard deviation of 12.0. Its function is to smooth the illumination components over a very large range, fit the large-scale illumination attenuation and overall dark background deep in the intestine, and achieve overall brightness compensation in the dark area.
[0117] In this embodiment, when the brightness variance is less than the first variance threshold, a large-scale Gaussian kernel is matched for the corresponding first neighborhood to smooth the illumination over a large area and improve the brightness of dark areas; when the brightness variance is greater than or equal to the first variance threshold but less than the second variance threshold, a medium-scale Gaussian kernel is matched for the corresponding first neighborhood to ensure a natural transition; when the brightness variance is greater than or equal to the second variance threshold, a small-scale Gaussian kernel is matched for the corresponding first neighborhood to accurately eliminate reflections locally.
[0118] In S123, the first neighborhood corresponding to each central third pixel is used as the operation range. The Gaussian kernel matched in S122 is retrieved, and the Gaussian kernel weight matrix is convolved with the original brightness of all third pixels in the first neighborhood. By utilizing the local smoothing characteristics of Gaussian filtering, the interference information formed by the superposition of local ambient lighting, direct lens reflection, cavity shadow attenuation, etc. is fitted, and the brightness noise component of each central pixel is calculated. After completing the convolution operation pixel by pixel, the brightness noise components of all pixels in the entire image are integrated to form the complete global brightness noise of the original image.
[0119] In this embodiment, since illumination interference such as uneven illumination, lens highlight reflection, and cavity shadow attenuation are slow-changing low-frequency components in the image, while the texture and detail features of the intestinal mucosa and polyps are high-frequency effective information, Gaussian convolution has the inherent characteristics of local weighted smoothing and low-frequency signal fitting. By performing brightness convolution weighted operation in the first neighborhood of a pixel through adaptive matching Gaussian kernel, the original brightness of the neighborhood can be smoothed and filtered to remove high-frequency effective features such as inherent details of the mucosa, and the composite interference components such as slowly fluctuating ambient light, local reflection, and shadow deviation can be fitted and extracted. The fitted brightness output by this convolution operation only reflects the additional brightness shift caused by the imaging environment and strips away the inherent brightness attributes of the tissue itself. Therefore, it can be directly used as the brightness noise component of each central pixel. After integrating the convolution fitting results of all pixels, the global illumination noise of the original image can be completely constructed.
[0120] In S124, luminance noise removal is achieved based on the following formula:
[0121]
[0122] Indicates the third pixel The weighting coefficient, in this embodiment, when the third pixel When the brightness of the V channel is greater than the first brightness threshold, =0.2, when the third pixel When the brightness of the V channel is less than or equal to the first brightness threshold and greater than the second brightness threshold, =1.6, when the third pixel When the brightness of the V channel is less than or equal to the second brightness threshold, =1.
[0123] Represents the third pixel in the HSV color space after removing illumination noise. The brightness, or pure reflectance component, preserves key information such as the texture and color of the lesion.
[0124] K is the total number of preset Gaussian kernel scales (in this scheme, K=3, corresponding to small, medium and large Gaussian kernel scales).
[0125] k is the scale index (k=1 corresponds to small scale, k=2 corresponds to medium scale, k=3 corresponds to large scale), and its function is to linearly fuse the correction results at different scales to complement the limitations of single-scale correction.
[0126] This indicates that the third pixel is at the k-th order Gaussian kernel scale. The estimated luminance noise components.
[0127] Based on the above formula, the following is proposed for each pixel: The interference components are used to obtain the pixel. of This process yields the processed image.
[0128] In S130, the first color difference parameter of each first pixel in the processed image can be obtained as follows:
[0129] The processed image is mapped to the second Lab color space; based on the extraction tool, the first color difference component of the second a channel and the second color difference component of the second b channel of each first pixel in the processed image mapped to the second Lab color space are extracted; the first color difference component and the second color difference component are concatenated to obtain the first color difference parameter.
[0130] In this embodiment, the processed image is used as input. A preset color space conversion algorithm maps the processed image from the RGB color space to the second Lab color space. The converted image is divided into three independent channels: L (luminance), a (red-green difference), and b (yellow-blue difference). The mechanism lies in the fact that the Lab color space is constructed based on human visual perception. The three channels are decoupled from each other, and the luminance component L is completely separated from the color difference components a and b, unaffected by the coupling interference of illumination changes. This allows for the independent expression of the image's luminance and color information. The reason is that the processed image has already undergone illumination equalization. Mapping it to the Lab space further separates residual luminance fluctuations from the color changes of the mucosa's natural color, avoiding interference from luminance changes on color difference characteristics and providing a stable color space foundation for the subsequent extraction of pure lesion-related color difference components.
[0131] Then, for the image mapped to the second Lab space, a preset extraction tool is invoked to traverse the image pixel by pixel, reading the values of the second a-channel and the second b-channel corresponding to each first pixel. The pixel value of the second a-channel is defined as the first color difference component, and the pixel value of the second b-channel is defined as the second color difference component, thus completing the extraction and storage of color difference information from the two channels. The mechanism is that the a-channel is a red-green antagonistic channel, with a positive value representing a red tint and a negative value representing a green tint; the b-channel is a yellow-blue antagonistic channel, with a positive value representing a yellow tint and a negative value representing a blue tint. Changes in the values of these two channels directly reflect the direction and degree of color shift in the pixel. The rationale for this operation is that lesions of the intestinal mucosa (such as polyp congestion, inflammatory redness, and pigmentation) mainly manifest as abnormal color shifts in the mucosa, and these changes are primarily reflected in the a and b channels. Extracting the components of these two channels can accurately capture the color differences between the mucosa and normal tissue, avoiding interference from brightness information and providing reliable color features for subsequent clustering analysis of suspected lesion areas.
[0132] Finally, taking a single pixel as the unit, the first color difference component and the second color difference component corresponding to each first pixel are concatenated and combined to construct feature data in the form of a two-dimensional vector. This two-dimensional vector is the first color difference parameter corresponding to the first pixel, realizing a complete quantitative expression of the color features of each pixel. The mechanism is that the color information of a single pixel is determined by its values in the a and b channels. By concatenating the two components into a two-dimensional vector, the color position of the pixel can be uniquely determined in the Lab color space, completely representing the direction and magnitude of its color shift, forming a pixel-level color feature description. The reason for this operation is that the concatenated first color difference parameter integrates the dual color difference information of the a and b channels, which is more robust than single-channel features, can reflect subtle changes in mucosal color, distinguish the physiological color difference of normal mucosa from the pathological color difference of polyps, and provide a unified and standardized feature input for subsequent pixel membership calculation based on clustering models.
[0133] In this embodiment, channel a is specifically used to characterize the red-green color difference. Due to congestion and proliferation, the pixel value of polyps in channel a is significantly higher than that of normal mucosa (polyps are reddish → channel a value is larger), which can capture the "congested red feature" of polyps. Channel b is specifically used to characterize the yellow-blue color difference. Some proliferative polyps and inflammatory polyps will show a slight yellowish feature, and the value of channel b is different from that of normal mucosa, which can help capture non-red polyp lesions.
[0134] In this embodiment, the extraction tool can be OpenCV or the MATLAB image processing toolbox, etc.
[0135] like Figure 3 As shown, S140 may specifically include the following steps:
[0136] A1: Input all the first color difference parameters into the clustering model, and according to the clustering model, obtain the membership degree of each first pixel with several cluster centers of the clustering model. One of the several cluster centers is used to characterize suspected polyps.
[0137] A2: Input the membership degree of each first pixel and the membership degrees of all other second pixels in the second neighborhood centered on the first pixel into the objective function to obtain the objective value;
[0138] A3: Update the cluster center based on the membership degree of each first pixel and the membership degrees of all other first pixels in the second neighborhood centered on each first pixel, wherein the initial cluster center is obtained by a preset;
[0139] A4: Repeat A1-A3 until the difference between the target values obtained in two consecutive executions of 2 is less than or equal to a preset threshold.
[0140] A5: Input each of the first color difference parameters into the clustering model obtained after executing A4 to obtain the membership degree of each first pixel as a suspected polyp.
[0141] The objective function is:
[0142]
[0143] Indicates the first color difference parameter;
[0144] The characteristic parameters representing the cluster centers correspond to three clusters: normal mucosa, interference, and suspected polyps.
[0145] Represents the first pixel Belongs to clustering Membership degree, used to represent pixels Belonging to the The blur probability of class (normal mucosa / interference / suspected polyp) takes the value [0,1]. The sum of the membership degrees of all classes of the same pixel is 1. It cannot be directly replaced by Euclidean distance.
[0146] m represents the fuzzy coefficient;
[0147] N represents the total number of pixels, and C represents the number of cluster categories;
[0148] Indicates the spatial weight constraint coefficient;
[0149] Represents the first pixel The constraint value of the second neighborhood, , It represents the set of all pixels in the second neighborhood. Represents the pixels in the second neighborhood. Belongs to clustering Membership degree;
[0150] This represents the penalty weighting coefficient;
[0151] This represents the color difference distance penalty value for pixel i2. , and These represent the pixel average values of the third a channel and the third b channel of a normal mucosa in the third Lab color space, respectively. Indicates the penalty factor. and These represent the first color difference component and the second color difference component of the first pixel i2, respectively.
[0152] Understandably, after S130, the processed images are standardized to 512×512 pixels, and the pixel grayscale value range is normalized to [0,255] to eliminate the influence of differences in shooting parameters from different devices and ensure the stability of subsequent clustering algorithms.
[0153] The objective function in this embodiment, based on the traditional fuzzy C-means (FCM) clustering algorithm, predefines and introduces two major constraints to suppress interference and improve clustering accuracy, as follows:
[0154] (1) 8-neighborhood spatial constraints (for isolated noise interference)
[0155] Constraint definition: Centered on the current first pixel (x2, y2), define a second neighborhood window (i.e., the 8 pixels adjacent to this pixel in the top, bottom, left, right, and diagonal directions), and incorporate the color distribution features of the a and b channels of the pixels in this second neighborhood window into the clustering calculation of the current pixel;
[0156] Constraint purpose: To prevent pixel clustering from being isolated, but rather associated with the features of surrounding pixels. If the current pixel is an isolated mucus noise point, its neighboring pixels are all normal mucosal colors. Spatial constraints can prevent this pixel from being classified as a lesion cluster alone.
[0157] (2) Custom color difference distance penalty constraints (for feature confusion issues)
[0158] Constraint definition: Pre-calculate the pixel mean values of normal intestinal mucosa in channels 3a and 3b (denoted as ). ), calculate the color difference distance between the current pixel and the normal mucosa mean, and introduce a custom penalty factor. Weighted amplification of color difference distance;
[0159] Constraint objective: To increase the clustering interval between "abnormal chromatic lesions (polyps)" and "normal mucosa"—the color difference distance between polyp regions and normal mucosa is amplified by the penalty factor, making them easier to classify into independent categories during clustering and reducing feature confusion.
[0160] This represents the similarity between a pixel and its cluster center.
[0161] This is used to force the membership degree of the current pixel to be consistent with that of its neighboring pixels. If the current pixel is isolated noise, the membership degrees of its neighboring pixels are all biased towards "normal mucus". Increase the target value of the objective function If the value is increased, the algorithm will automatically adjust the membership degree of the pixel to prevent it from being clustered as a lesion area.
[0162] This is a color difference distance penalty term, applied to pixels with a large color difference from normal mucosa (polyp areas). Increase the size of the polyp cluster by penalizing it to widen the distance between it and the normal mucosa cluster, making the polyp area more likely to be classified into an independent "suspected lesion cluster"; for normal mucosa and mucus with small color difference, it interferes with the mucus. Smaller size to avoid misjudgment.
[0163] In this embodiment, the color difference parameters corresponding to each first pixel are input into the clustering model to calculate the membership degree of each first pixel in the processed image corresponding to multiple cluster centers. The three types of cluster centers correspond to normal mucosa, interference areas, and suspected polyp areas, respectively. Then, the membership degree of a single first pixel and the membership degrees of all first pixels in the second neighborhood centered on that first pixel are substituted into a preset improvement objective function to calculate the target value of the current iteration. Subsequently, the pre-initialized cluster centers are iteratively updated by combining the current membership degree of the first pixel and the membership degree information of the other first pixels in the second neighborhood. The above membership degree calculation is continuously repeated in a loop. The process involves several steps: solving for the objective value and updating the cluster centers. The clustering results are continuously optimized until the difference between two consecutive calculated objective function values is less than or equal to a preset threshold, completing the iterative convergence of the clustering model. Finally, the first color difference parameters of all first pixels are input into the converged and optimized clustering model. Based on the objective function that integrates color difference similarity, second neighborhood spatial constraints, and color difference distance penalty constraints, the exclusive membership degree of each first pixel belonging to the suspected polyp region is quantitatively obtained. Spatial constraints suppress isolated noise mis-clustering, and the color difference penalty term enhances the distinguishability of lesion color features, providing a quantitative basis for the subsequent determination of the initial lesion region of suspected polyps. It is understandable that in the initial iteration, the three cluster centers representing normal mucosa, interference, and suspected polyps are obtained through a preset method.
[0164] In S150, such as Figure 4 As shown, S150 specifically includes the following steps:
[0165] S151: Obtain the first pixel in the processed image whose membership degree is greater than the membership threshold;
[0166] S152: Based on the first pixel whose membership degree is greater than the membership degree threshold, obtain a connected component, wherein the number of pixels in the connected component whose membership degree is greater than the membership degree threshold is at least a specified number;
[0167] S153: Calculate the total pixel area, contour compactness, and edge smoothness of the connected region, wherein the contour compactness is obtained based on the total pixel area of the connected region and the edge contour length of the connected region, and the edge smoothness is obtained based on the curvature between every two adjacent contour points in the edge contour of the connected region.
[0168] S154: Delete connected components that meet the rejection criteria, and the remaining connected components are the initial lesion regions. The rejection criteria are used to characterize connected components whose total pixel area is less than a preset area threshold, whose contour compactness is less than a first auxiliary threshold, or whose edge smoothness is less than a second auxiliary threshold.
[0169] In S151, after the clustering model has converged iteratively, a two-dimensional matrix of suspected polyp membership degrees at the pixel level, which is completely corresponding to the size of the processed image, is first obtained (each element value in the matrix corresponds to the membership degree of the same coordinate pixel in the image belonging to the suspected polyp). The preset membership degree threshold is used as the judgment criterion. By traversing pixel by pixel or performing batch matrix operations, the membership degree value of each pixel in the membership degree matrix is compared with the membership degree threshold. All pixels with membership degree values that are strictly greater than the threshold are filtered and marked. The horizontal and vertical coordinate positions of these pixels that meet the conditions are recorded simultaneously.
[0170] In S152, firstly, all valid target pixels in the processed image with a membership degree greater than a preset membership degree threshold are selected. Based on the eight-connected domain detection rule, a global connectivity traversal search is performed on all valid target pixels. Pixels that are spatially connected are aggregated and divided into the same independent connected region. At the same time, the total number of valid pixels in each connected region is counted one by one. Connected regions with a number of pixels not less than a specified number are strictly selected and retained. Fragmented micro-regions composed of a small number of scattered pixels are removed. Finally, multiple independent connected regions that meet the pixel number constraint are output, providing the basic region objects for subsequent morphological parameter calculation and pseudo-region removal.
[0171] In this embodiment, the total number of valid pixels within the current connected domain is directly counted, which is the total pixel area.
[0172]
[0173] C indicates profile compactness;
[0174] L represents the total length (perimeter) of the edge contour of the connected region. In this embodiment, the boundary of a single connected region is first extracted, and all edge contour pixels on the outermost side of the connected region are selected and sorted clockwise or counterclockwise to form a continuous closed contour point sequence. The connection form of adjacent contour points is distinguished according to the pixel neighborhood position relationship. The single segment length of horizontally adjacent and vertically adjacent pixels is recorded as 1, and the single segment length of diagonally adjacent pixels is recorded as... The distances between all adjacent contour points are accumulated segment by segment, and the total length of the edge contour of the connected region is obtained by summing all the points.
[0175]
[0176] This represents the curvature of the t1th edge contour point;
[0177] This represents the average curvature of all contour points in a connected region.
[0178] M represents the total number of pixels in the edge contour;
[0179] Indicates edge smoothness;
[0180] The x-coordinate parameter represents the (t1+1)th pixel in the edge contour;
[0181] This represents the y-coordinate parameter of the (t1+1)th pixel in the edge contour;
[0182] The x-coordinate parameter represents the t1-th pixel in the edge contour;
[0183] The x-coordinate parameter represents the (t1-1)th pixel in the edge contour;
[0184] This represents the y-coordinate parameter of the t1-th pixel in the edge contour;
[0185] This represents the y-coordinate parameter of the (t1-1)th pixel in the edge contour. Both the x and y coordinates are in the corresponding image coordinate system.
[0186] In S154, elimination conditions are constructed by combining multi-dimensional morphological constraints such as the total area of connected region pixels, contour compactness, and edge smoothness. This allows for precise filtering of pseudo-targets based on the inherent morphological differences between intestinal interference regions and real polyp lesion regions. Invalid regions such as mucus spots, scattered pigment deposits, and noise fragments generally have few pixels and extremely small overall areas; fragmented micro-connected regions can be directly screened out using area thresholds. Pseudo-lesion regions with intestinal physiological folds and broken edges have irregular contours, numerous inflection points and burrs, and relatively longer contour perimeters, resulting in lower contour compactness values. In contrast, real polyp regions… The morphological features are clustered and regular, with harmonious contour proportions and higher compactness. At the same time, the curvature of various non-lesion interference areas changes frequently and fluctuates violently, resulting in poor edge smoothness. In contrast, the edges of polyp lesions are continuous and the curvature changes gently, exhibiting higher edge smoothness. Based on the above differences in morphological characteristics, unqualified connected regions with insufficient area, loose and non-compact contours, and messy edges are simultaneously removed. Only connected regions with complete morphology, regular contours, and continuous and stable edges are retained as the initial lesion areas. This compensates for the shortcomings of single color difference clustering at the morphological level and effectively reduces false positive interference in the coarse localization stage.
[0187] In S160, S160 specifically includes the following steps:
[0188] S161: Based on the contour of the initial lesion region, and the gray level and second color difference parameter of each second pixel in the initial lesion region, obtain the overall gray level fluctuation coefficient, overall contour roughness, and overall pixel uniformity of the initial lesion region, wherein the overall gray level fluctuation coefficient is calculated based on the gray level of each second pixel, the overall contour roughness is calculated based on the contour of the initial lesion region, and the overall pixel uniformity is calculated based on the color difference parameter of each second pixel;
[0189] S162: Determine whether the initial lesion area is a colorectal polyp lesion area based on the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity.
[0190] Specifically, S161 is:
[0191] The process involves obtaining the sub-contour of the initial lesion region corresponding to the sliding window, the grayscale of all second pixels in each sliding window, and the second color difference parameter of each second pixel. The sliding windows are of various sizes and slide along a preset direction on the initial lesion region. Based on the sub-contour and the grayscale of all second pixels in each sliding window, the local grayscale fluctuation coefficient, local contour roughness, and local pixel uniformity of each sliding window are calculated. The weighted average of the local grayscale fluctuation coefficient, the weighted average of the local contour roughness, and the weighted average of the local pixel uniformity of all sliding windows corresponding to each size are calculated to obtain the pre-fusion grayscale fluctuation coefficient, the pre-fusion contour roughness, and the pre-fusion pixel uniformity corresponding to each size. Finally, the pre-fusion grayscale fluctuation coefficient, the pre-fusion contour roughness, and the pre-fusion pixel uniformity corresponding to all sizes of sliding windows are fused to obtain the overall grayscale fluctuation coefficient, the overall contour roughness, and the overall pixel uniformity. The second color difference parameter is calculated from the first a-channel color difference component and the first b-channel color difference component of the first Lab color space corresponding to the second pixel.
[0192] In this embodiment, three types of windows—small, medium, and large—are configured. Combined with 512×512 pixel electronic anoscope images, the quantitative configuration is as follows (verified by clinical images, suitable for detecting various polyp textures):
[0193] Small window size: 3×3 pixels, window step size of 1 pixel, sampling overlap rate of 50%;
[0194] Core function: Focus on microscopic texture details, capture the subtle bumpy growth texture on the surface of tiny polyps and flat polyps, and adapt to scenarios with small lesion areas and weak texture features.
[0195] Medium-sized window: 7×7 pixels, window step size of 1 pixel, sampling overlap rate of 50%;
[0196] Core function: Adapts to polyps of normal size, takes into account both local micro-texture and medium-range texture in the region, captures the overall texture distribution pattern of the polyp surface, and serves as the core window for texture quantification.
[0197] Large window size: 15×15 pixels, window step size of 2 pixels, sampling overlap rate of 40%;
[0198] Core function: Covers the overall texture range of large-area, broad-based polyps, captures texture changes in the transition area between the polyp and the surrounding mucosa, and avoids incomplete texture sampling due to an excessively small window.
[0199] In this embodiment, the sliding detection method based on all types of windows is as follows:
[0200] ① Window initialization and traversal range limitation
[0201] Determine the boundary coordinates of each initial lesion area (top left x1, y1, bottom right x2, y2) to limit the range of window sliding, ensuring that the window only slides within the initial lesion area and does not exceed the area boundary to avoid interference with normal mucosal texture.
[0202] Following the progressive order of "small window → medium window → large window", initialize each level of window in turn, set the starting position of the window to the upper left corner (x1, y1) of the suspected area, and prepare to start sliding sampling.
[0203] ②Sampling of micro-texture in small-sized windows (first progressive level)
[0204] Using a 3×3 small window as the sampling unit, starting from the top left corner of the suspected area, slide through in the order of "row by row → column by column": first slide along the horizontal direction second by second, after completing a row of sampling, move down 1 pixel (step 1), and continue to the next row of sampling until the entire suspected area is covered;
[0205] Each time the slider moves to a position, the grayscale and second color difference parameters of all second pixels within the current window are recorded and stored as micro-texture sampling data, focusing on capturing micro-texture features such as tiny bumps and fine wrinkles. It can be understood that the second color difference parameters are obtained by filtering through all the first color difference parameters stored after executing S130.
[0206] After sampling is completed, all sampled data in the small window are summarized to form a micro-texture dataset of the suspected area, which provides support for subsequent micro-calculations of "local gray-scale fluctuation coefficient" and "edge contour roughness".
[0207] ③ Overall texture sampling for medium-sized windows (second progressive level)
[0208] After completing the small window sampling, initialize a 7×7 medium-sized window, starting from the top left corner of the suspected area, and slide through it according to the rule of "row by row → column by column" with a step size of 1 pixel;
[0209] At each window location, the grayscale distribution and edge direction information of the pixels within the window are recorded, focusing on capturing the overall texture arrangement pattern of the polyp surface and the texture uniformity of local areas, making up for the medium-range texture features that cannot be covered by small windows.
[0210] After sampling is completed, the sampled data in the middle window are summarized to form a mesoscale texture dataset of the suspected area, which serves as the core data for 3D texture quantization (taking into account both microscopic and overall dimensions, and adapting to most polyps of normal size).
[0211] ④ Large-size window, large-area texture sampling (third progressive level)
[0212] Initialize a 15×15 large window, starting at the top left corner of the suspected area, and slide through it according to the rule of "row by row → column by column" with a step size of 2 pixels to reduce redundant calculations;
[0213] At each window location, the overall distribution trend of texture within the window and the texture difference between the polyp and the surrounding normal mucosa are recorded to cover the large-scale texture features of broad-based polyps and avoid the loss of texture features due to insufficient sampling range. After sampling, the large window sampling data are summarized to form a macro-texture dataset of suspected areas to supplement the large-scale texture information that cannot be covered by medium and small windows.
[0214] In this embodiment, the most subtle lesion textures (such as the micro-growth of flat polyps) are first captured through a small window to avoid the macro window from obscuring the details; then, the local and overall textures are integrated through a medium window to establish the core feature framework of the texture; finally, a large window is used to supplement a large range of texture information to ensure that the textures of polyps of all sizes can be fully captured without omission or deviation.
[0215] In this embodiment, the local grayscale fluctuation coefficient G is calculated as follows:
[0216]
[0217] W represents the total number of second pixels within the current sliding window;
[0218] This represents the grayscale value of the second pixel at the i3rd position within the current sliding window;
[0219] This represents the average grayscale value of all second-order pixels within the current sliding window.
[0220] The standard deviation of grayscale within the window is used as the grayscale fluctuation coefficient to quantify the degree of brightness and darkness fluctuation in the local area; the larger the value, the more obvious the unevenness and light and shadow changes of the mucosal surface, which can distinguish the rough surface of polyp hyperplasia from the smooth and normal mucosa.
[0221] The local profile roughness R is calculated as follows:
[0222]
[0223] This indicates the total number of sampling points for the sub-contours in the current sliding window;
[0224] This represents the discrete curvature of the t2th contour point in the current sliding window;
[0225] This represents the average curvature of all curves in the current sliding window.
[0226] Roughness is characterized by the mean absolute deviation of the curvature of the sub-contour. When there are many burrs, wrinkles, bends, and irregular edges in the contour, the curvature fluctuates greatly, and the roughness value of the contour increases significantly. In polyp areas with smooth and regular edges, the curvature changes gently, and the roughness is lower.
[0227] The local pixel uniformity E is calculated as follows:
[0228]
[0229] These represent the a-channel component and the b-channel component of the i2th pixel within the sliding window, respectively.
[0230] These represent the mean values of the color difference components in the a channel and the b channel of all second pixels within the sliding window, respectively.
[0231] W represents the total number of the second pixel within the sliding window.
[0232] In this embodiment, after calculating the local grayscale fluctuation coefficient, local contour roughness, and local pixel uniformity of each sliding window, the local grayscale fluctuation coefficient, local contour roughness, and local pixel uniformity of all small windows are averaged to obtain the pre-fusion contour roughness corresponding to the small window, the pre-fusion contour roughness corresponding to the medium window, and the pre-fusion contour roughness corresponding to the large window; the pre-fusion grayscale fluctuation coefficient corresponding to the small window, the pre-fusion grayscale fluctuation coefficient corresponding to the medium window, and the pre-fusion grayscale fluctuation coefficient corresponding to the large window; and the pre-fusion pixel uniformity corresponding to the small window, the pre-fusion pixel uniformity corresponding to the medium window, and the pre-fusion pixel uniformity corresponding to the large window.
[0233] Then, with a weight of 0.2 for the small window, 0.6 for the medium window, and 0.2 for the large window, the pre-fusion contour roughness, pre-fusion grayscale fluctuation coefficient, and pre-fusion pixel uniformity of each window are fused, along with the pre-fusion pixel uniformity of the large window, to obtain the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity.
[0234] S162 specifically refers to:
[0235] Initial lesion regions that satisfy at least two of the following criteria—overall grayscale fluctuation coefficient greater than the first fluctuation threshold, overall contour roughness greater than the first roughness threshold, and overall pixel uniformity greater than the first uniformity threshold—are designated as regions to be optimized. This is because the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity quantify the lesion region's characteristics from three dimensions: surface texture unevenness, edge morphology regularity, and color distribution consistency. True suspicious polyps, compared to ordinary mucosal interference, are more likely to exhibit significant abnormalities across multiple feature dimensions simultaneously, while pseudo-interferences such as mucus and slight wrinkles typically only show abnormal fluctuations in a single indicator. Therefore, setting a condition that at least two of the three indicators exceed high thresholds allows for the rapid screening of initial lesion regions with synchronously abnormal multi-dimensional features and a higher degree of lesion suspicion. These regions are then designated as areas to be optimized. This approach allows for focused, refined optimization of high-risk suspicious lesions while reducing invalid calculations caused by false triggers of single indicators, thus enhancing the identification and coverage capabilities of highly abnormal lesions.
[0236] The initial lesion region that meets one of the following conditions—that the overall gray-level fluctuation coefficient is greater than the first fluctuation threshold, and the overall contour roughness is between the first and second roughness thresholds, and the overall pixel uniformity is between the first and second uniformity thresholds—is designated as the region to be optimized. The second roughness threshold is less than the first roughness threshold, and the second uniformity threshold is less than the first uniformity threshold. This is because a high overall gray-level fluctuation coefficient is a core characteristic of mucosal surface hyperplasia and unevenness, a typical feature of hyperplastic polyps. These polyps often have significant surface roughness but relatively intact edge contours and mild color deviations. Only the contour roughness or pixel uniformity shows a moderate degree of abnormality, making it difficult to simultaneously meet the high threshold requirements. This rule uses strong abnormal gray-level fluctuation as the core constraint, combined with the constraint that either of the other two indicators is in the middle range between the high and low thresholds. This method is specifically adapted to polyp samples with prominent surface hyperplasia and weak edge and color abnormalities, preventing such suspicious regions with significant single core features from being filtered out by rigid high threshold screening conditions, ensuring that hyperplastic polyps are not missed.
[0237] The initial lesion region that meets one of the following criteria is selected as the optimization region: the overall contour roughness is greater than the first roughness threshold, the overall gray-level fluctuation coefficient is between the first fluctuation threshold and the second fluctuation threshold, and the overall pixel uniformity is between the first uniformity threshold and the second uniformity threshold. The first fluctuation threshold is greater than the second fluctuation threshold because: the higher the overall contour roughness value, the more burrs, distorted shape, and poor boundary continuity of the region's edge are, which are the most intuitive morphological characteristics of irregular broad-based polyps and atypical lesions. The core difference of this type of lesion is concentrated at the contour boundary level, while the surface gray-level fluctuation and color difference distribution are likely to only have slight anomalies and can only reach the medium index range. This rule takes the extremely high contour roughness as the primary judgment criterion, and combines the medium abnormality condition of gray-level fluctuation or pixel uniformity for supplementary constraints. It specifically covers special polyp types with broken edge shape and messy contour, effectively distinguishes between true lesions with irregular edges and interference from physiological wrinkles with regular contours, and completes the screening logic for lesions with abnormal shapes.
[0238] The initial lesion region that meets one of the following criteria is selected as the optimization region: overall pixel uniformity greater than the first uniformity threshold, overall grayscale fluctuation coefficient between the first and second fluctuation thresholds, and overall contour roughness between the first and second roughness thresholds. The first roughness threshold is greater than the second roughness threshold because: excessive overall pixel uniformity indicates a large dispersion of color difference between channels a and b within the region, prominent issues of mucosal congestion and redness, pigmentation mottledness, and disordered color distribution, which are key identification features of congestive polyps and inflammatory polyps. Lesions dominated by this type of color abnormality generally have gentle surface undulations and relatively regular edge contours, with only slight deviations between grayscale and contour indices. By using strong pixel uniformity abnormality as the core, combined with a judgment method where the grayscale fluctuation coefficient or contour roughness is in the medium range, suspicious lesion regions with color abnormality as the main manifestation can be accurately located, taking into account special lesion scenarios with abnormal color dimensions, comprehensively covering polyp types with different pathological manifestations, and reducing the probability of missed detection of polyps with color abnormalities.
[0239] In this embodiment, after screening all the initial lesion areas to obtain all the areas to be optimized, the edges of the areas to be optimized are corrected according to the following method, so that the rectal polyp lesion area can be obtained based on the corrected edges. Therefore, the specific correction method is as follows:
[0240] Extract the position coordinates of the fourth pixel of the edge of the region to be optimized; calculate the gradient magnitude of all fourth pixels of the edge of the region to be optimized; substitute all the position coordinates and gradient magnitudes into the energy function, so that the edge of the region to be optimized is corrected after the iteration termination condition is met based on the energy function, so as to obtain the colorectal polyp lesion region, wherein the energy function is:
[0241]
[0242] This represents the total energy of the energy function;
[0243] For the contour length constraint,
[0244] Let ▽ denote the Heaviside function, and ▽ denote the gradient operator.
[0245] The coordinate position at time t is... The level set function, when When located at the outline of the region to be optimized, ,when When located within the region to be optimized, ,when When located outside the region to be optimized, ;
[0246] These are the x-coordinate components and y-coordinate components of the fourth pixel in the original image coordinate system, respectively.
[0247] This represents the entire region to be optimized.
[0248] This indicates the contour length constraint.
[0249]
[0250] This represents the total pixel area of the region to be optimized;
[0251]
[0252] This represents the gradient boundary penalty term;
[0253] The grayscale image matrix represents the region to be optimized, and the grayscale image matrix includes the grayscale values of all fourth pixels;
[0254] This represents the gradient magnitude;
[0255]
[0256] This represents the a priori constraint term for polyp morphology;
[0257] This represents the second-order differential operator of Laplace;
[0258] This represents the baseline threshold for the standard physiological curvature of polyps.
[0259] In this embodiment, the level set function corresponding to the coordinates (x3, y3) at time t will be defined. Initial values are assigned according to the rule of zeroing out boundaries, positive values inside the region, and negative values outside the region. The position coordinates of the fourth pixel of all edges, gradient magnitude, region grayscale matrix, and preset fixed parameters are substituted into the total energy function in sequence. The contour length constraint, region area constraint, gradient boundary penalty, and polyp morphology prior constraint are calculated simultaneously through the gradient operator, Heaviside function, and Laplacian second-order differential operator. The length constraint smooths out redundant spikes in the contour, the area constraint locks in the reasonable range of the lesion, the gradient boundary penalty fits the real grayscale edge, and the curvature morphology constraint matches the physiological structure characteristics of the polyp. Then, in each iteration, the values are updated. The value, until the value after two adjacent iterations. If the interpolation is less than a preset threshold, this convergence threshold can be set to 10. -3 Then, based on the converged level set function ,extract =0 corresponds to the outline, thus outputting the determination result of the colorectal polyp lesion area.
[0260] This application provides an electronic device that may include a processing module and a memory. The memory stores a computer program, which, when executed by the processor, enables the electronic device to perform the corresponding steps in the method for determining the area of colorectal polyps described above.
[0261] In this embodiment, the processor can be an integrated circuit chip with signal processing capabilities. For example, the processor can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0262] The memory can be, but is not limited to, random access memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, etc.
[0263] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the electronic device described above can be referred to the corresponding steps in the aforementioned method, and will not be elaborated further here.
[0264] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method for determining the colorectal polyp lesion area as described in the above embodiments.
[0265] Computer-readable storage media may be magnetic disks, optical disks, read-only memory, random access memory, flash memory, USB flash drives, hard disks, or solid-state drives, etc., and may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implement the methods shown in the above embodiments.
[0266] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the above-described method for determining the lesion area of colorectal polyps. The computer program product may exist in a computer-readable storage medium in forms including, but not limited to, source files, executable files, and installation package files.
[0267] Based on the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by hardware or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, electronic device, or network device, etc.) to execute the methods described in the various implementation scenarios of this application.
[0268] In the embodiments provided in this application, it should be understood that the disclosed methods can also be implemented in other ways. The method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or part of code, which includes one or more executable instructions for implementing a specified logical function. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0269] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for determining the lesion area of colorectal polyps, characterized in that, The method includes: Acquire the original image of the area to be detected based on the visual terminal; The original image is preprocessed to obtain a processed image, wherein the preprocessing is used to remove brightness noise from the original image; Based on a preset extraction tool, the first color difference parameter of each first pixel in the processed image is obtained; Based on each of the first color difference parameters, the membership degree of each first pixel as a suspected polyp is obtained according to the clustering model; Based on the membership degree of all the first pixels, the initial lesion area of the suspected polyp is determined; Based on the contour of the initial lesion region, the gray level of each second pixel in the initial lesion region, and the second color difference parameter of each second pixel, the determination result of whether the initial lesion region is a colorectal polyp lesion region is determined. The second color difference parameter is calculated from the first a-channel color difference component and the first b-channel color difference component of the first Lab color space corresponding to the second pixel. The method of obtaining the first color difference parameter of each first pixel in the processed image based on a preset extraction tool includes: The processed image is mapped to the second Lab color space; Based on the extraction tool, extract the first color difference component of the second a channel and the second color difference component of the second b channel of each first pixel in the processed image after mapping to the second Lab color space; By splicing the first color difference component and the second color difference component, the first color difference parameter is obtained; The step of obtaining the membership degree of each first pixel as a suspected polyp based on each first color difference parameter and according to a clustering model includes: A1: Input all the first color difference parameters into the clustering model, and according to the clustering model, obtain the membership degree of each first pixel with several cluster centers of the clustering model. One of the several cluster centers is used to characterize suspected polyps. A2: Input the membership degree of each first pixel and the membership degrees of all other second pixels in the second neighborhood centered on the first pixel into the objective function to obtain the objective value; A3: Update the cluster center based on the membership degree of each first pixel and the membership degrees of all other first pixels in the second neighborhood centered on each first pixel, wherein the initial cluster center is obtained by a preset; A4: Repeat A1-A3 until the difference between the target values obtained from two consecutive executions of A2 is less than or equal to a preset threshold. A5: Input each of the first color difference parameters into the clustering model obtained after executing A4 to obtain the membership degree of each first pixel as a suspected polyp; The objective function is: ; This represents the first color difference parameter of the first pixel; Characteristic parameters representing cluster centers; This represents the membership degree of the first pixel i to cluster j; m represents the fuzzy coefficient; N represents the total number of pixels, and C represents the number of cluster categories; Indicates the spatial weight constraint coefficient; This represents the constraint value of the second neighborhood of the first pixel i. , Let represent the set of all first pixels within the second neighborhood. This indicates the membership degree of other first pixels o within the second neighborhood to cluster j; This represents the penalty weighting coefficient; This represents the color difference distance penalty value of the first pixel i. , and These represent the pixel mean values of the third a channel and the third b channel of a normal mucosa in the third Lab color space, respectively. Indicates the penalty factor. and These represent the first color difference component and the second color difference component of the first pixel i, respectively.
2. The method according to claim 1, characterized in that, The preprocessing of the original image to obtain the processed image includes: Obtain the original brightness of each third pixel in the original image, and the brightness variance of the first neighborhood centered on each third pixel; Based on the brightness variance, a suitable Gaussian kernel is matched for each of the first neighborhoods, wherein the brightness variance is negatively correlated with the window size and standard deviation of the Gaussian kernel. Based on the Gaussian kernel, a convolution operation is performed with all third pixels in the first neighborhood that match to obtain the luminance noise component of each third pixel, wherein the luminance noise is obtained from the luminance noise components of all the third pixels; The processed image is obtained based on the original luminance and luminance noise component of the third pixel.
3. The method according to claim 1, characterized in that, The determination of the initial lesion area of the suspected polyp based on all the membership degrees includes: Obtain the first pixel in the processed image whose membership degree is greater than the membership threshold; Based on the first pixel whose membership degree is greater than the membership degree threshold, a connected component is obtained, wherein the number of pixels in the connected component whose membership degree is greater than the membership degree threshold is at least a specified number; Calculate the total pixel area, contour compactness, and edge smoothness of the connected region, wherein the contour compactness is obtained based on the total pixel area of the connected region and the edge contour length of the connected region, and the edge smoothness is obtained based on the curvature between every two adjacent contour points in the edge contour of the connected region. Delete connected components that meet the rejection criteria, and the remaining connected components are the initial lesion regions. The rejection criteria are used to characterize connected components whose total pixel area is less than a preset area threshold, whose contour compactness is less than a first auxiliary threshold, or whose edge smoothness is less than a second auxiliary threshold.
4. The method according to claim 1, characterized in that, The step of determining whether the initial lesion region is a colorectal polyp lesion region based on the contour of the initial lesion region and the gray level and second color difference parameter of each second pixel in the initial lesion region includes: Based on the contour of the initial lesion region, and the gray level and second color difference parameter of each second pixel in the initial lesion region, the overall gray level fluctuation coefficient, overall contour roughness, and overall pixel uniformity of the initial lesion region are obtained. The overall gray level fluctuation coefficient is calculated based on the gray level of each second pixel, the overall contour roughness is calculated based on the contour of the initial lesion region, and the overall pixel uniformity is calculated based on the color difference parameter of each second pixel. The determination of whether the initial lesion area is a colorectal polyp lesion area is based on the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity.
5. The method according to claim 4, characterized in that, The step of obtaining the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity of the initial lesion region based on the contour of the initial lesion region and the grayscale and second color difference parameters of each second pixel in the initial lesion region includes: Obtain the sub-contour of the portion of the initial lesion area corresponding to the sliding window, as well as the grayscale of all second pixels in each sliding window and the second color difference parameter of each second pixel, wherein the number of sliding windows is several, the size of the several sliding windows is different, and the sliding window slides along a preset direction on the initial lesion area; Based on the sub-contour, and the grayscale of all second pixels in each sliding window and each second color difference parameter, the local grayscale fluctuation coefficient, local contour roughness and local pixel uniformity of each sliding window are calculated. Calculate the weighted average of the local grayscale fluctuation coefficient, the weighted average of the local contour roughness, and the weighted average of the local pixel uniformity of all sliding windows corresponding to each size, to obtain the grayscale fluctuation coefficient before fusion, the contour roughness before fusion, and the pixel uniformity before fusion corresponding to each size. The overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity are obtained by fusing the grayscale fluctuation coefficient, the contour roughness, and the pixel uniformity of sliding windows of all sizes before fusion.
6. The method according to claim 5, characterized in that, The step of determining whether the initial lesion area is a colorectal polyp lesion area based on the overall grayscale fluctuation coefficient, overall contour roughness, and overall pixel uniformity includes: The initial lesion region that satisfies at least two of the following conditions: the overall grayscale fluctuation coefficient is greater than the first fluctuation threshold, the overall contour roughness is greater than the first roughness threshold, and the overall pixel uniformity is greater than the first uniformity threshold, is taken as the region to be optimized. The initial lesion region that satisfies one of the following conditions is: the overall grayscale fluctuation coefficient is greater than the first fluctuation threshold, the overall contour roughness is between the first roughness threshold and the second roughness threshold, and the overall pixel uniformity is between the first uniformity threshold and the second uniformity threshold. The second roughness threshold is less than the first roughness threshold, and the second uniformity threshold is less than the first uniformity threshold. The initial lesion region that satisfies one of the following conditions is: the overall contour roughness is greater than the first roughness threshold, the overall gray level fluctuation coefficient is between the first fluctuation threshold and the second fluctuation threshold, and the overall pixel uniformity is between the first uniformity threshold and the second uniformity threshold. The first fluctuation threshold is greater than the second fluctuation threshold. The initial lesion region that satisfies one of the following conditions is: the overall pixel uniformity is greater than the first uniformity threshold, the overall gray level fluctuation coefficient is between the first fluctuation threshold and the second fluctuation threshold, and the overall contour roughness is between the first roughness threshold and the second roughness threshold. The first roughness threshold is greater than the second roughness threshold. Extract the position coordinates of the fourth pixel of the edge of the region to be optimized; Calculate the gradient magnitude of all fourth pixels at the edges of the region to be optimized; Substitute all the aforementioned location coordinates and gradient magnitudes into the energy function, so that after the iteration termination condition is met based on the energy function, the edge of the region to be optimized is corrected to obtain the colorectal polyp lesion region, wherein the energy function is: ; This represents the total energy of the energy function; For the contour length constraint, ; This refers to the Heaviside function. gradient operator The coordinate position at time t is... The level set function, when When located at the outline of the region to be optimized, ,when When located within the region to be optimized, ,when When located outside the region to be optimized, ; These are the x-coordinate components and y-coordinate components of the fourth pixel in the original image coordinate system, respectively. This represents the entire region to be optimized. Indicates the outline area constraint term; ; This represents the total pixel area of the region to be optimized; ; This represents the gradient boundary penalty term; The grayscale image matrix represents the region to be optimized, and the grayscale image matrix includes the grayscale values of all fourth pixels; This represents the gradient magnitude; ; This represents the a priori constraint term for polyp morphology; This represents the second-order differential operator of Laplace; This represents the baseline threshold for the standard physiological curvature of polyps.
7. An electronic device, characterized in that, The electronic device includes a processor and a memory coupled together, the memory storing a computer program that, when executed by the processor, causes the electronic device to perform the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 6.