A method and system for adaptive enhancement of microscopic endoscopic images
By employing an adaptive enhancement method, utilizing a trajectory prediction network and a density peak clustering algorithm, the problem of mismatched threshold settings in microscopic endoscopic image enhancement was solved, resulting in improved image clarity and noise control, and enhanced accuracy in lesion identification and disease assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AFFILIATED HUSN HOSPITAL OF FUDAN UNIV
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-07
AI Technical Summary
In existing microscopic endoscopic image enhancement technologies, the threshold setting is not suitable, resulting in loss of image details, noise amplification, or uneven enhancement. This cannot effectively solve the problems of jitter and blurring, affecting the accuracy of lesion identification and disease diagnosis.
An adaptive enhancement method based on trajectory prediction network and density peak clustering algorithm is adopted to obtain the feature vectors representing pixels, perform non-uniform sparse sampling and clustering, obtain the fitting function, and finally achieve adaptive enhancement.
It improves the clarity and realism of microscopic endoscopic images, ensures clear presentation of image details and effective noise control, and enhances the accuracy of lesion identification and disease assessment.
Smart Images

Figure CN122066592B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to an adaptive enhancement method and system for microscopic endoscope images. Background Technology
[0002] With the widespread application of microendoscopic technology in clinical diagnosis, the clarity and realism of the acquired images directly determine the accuracy of lesion identification and disease assessment. Image enhancement technology has become a support for improving diagnostic efficiency.
[0003] In existing microendoscopic image enhancement technologies, threshold settings often suffer from insufficient adaptability. They fail to fully consider the differences in the weak texture characteristics of microendoscopic images, nor do they distinguish the differences in pixel change patterns in images of different locations and lesion degrees. In the application of thresholds, either unreasonable settings lead to loss of image details and amplification of noise, or the lack of quantitative standards results in uneven enhancement, failing to effectively solve the visual interference caused by factors such as jitter and blur.
[0004] Therefore, there is an urgent need for a solution to address the problem of poor image enhancement in microendoscopic images, thereby improving image enhancement quality. Summary of the Invention
[0005] In view of the aforementioned problems, and in conjunction with the first aspect of the present invention, embodiments of the present invention provide an adaptive enhancement method for microscopic endoscopic images, the method comprising:
[0006] The microendoscopic images are preprocessed based on a preset enhancement intensity to obtain an image sequence. The microendoscopic images are then subjected to non-uniform sparse sampling to obtain representative pixels.
[0007] Based on a trajectory prediction network and combined with the pixel values representing pixels in the image sequence, the pixel change trajectory is obtained, and the feature vector of each pixel change trajectory is extracted.
[0008] The pixel change trajectory is clustered based on the density peak clustering algorithm to obtain the clustering results;
[0009] The clustering results are used to fit the data, obtain the fitting function, and solve the fitting function to obtain the optimal enhancement strength.
[0010] Based on the similarity propagation mechanism, the feature vector and the optimal enhancement intensity are diffused to the microendoscopic image to obtain a continuous intensity map, and then adaptive enhancement of the microendoscopic image is performed by combining linear interpolation.
[0011] Furthermore, embodiments of the present invention also provide a microscopic endoscope image adaptive enhancement system, comprising:
[0012] The processing module preprocesses the microendoscopic image based on a preset enhancement intensity to obtain an image sequence. Based on a trajectory prediction network and combined with the pixel values representing pixels in the image sequence, it obtains the pixel change trajectory and extracts the feature vector of each pixel change trajectory.
[0013] The sampling module is used to perform non-uniform sparse sampling on the microendoscopic image to obtain representative pixels.
[0014] A clustering module, which clusters pixel change trajectories based on a density peak clustering algorithm to obtain clustering results;
[0015] The calculation module fits the clustering results to obtain a fitting function, and solves the fitting function to obtain the optimal enhancement intensity.
[0016] A diffusion module, which diffuses the feature vector and the optimal enhancement intensity to the microendoscopic image based on a similarity propagation mechanism, to obtain a continuous intensity mapping map;
[0017] An enhancement module adaptively enhances microendoscopic images using a continuous intensity mapping map and linear interpolation. Attached Figure Description
[0018] Figure 1 This is a flowchart of the steps of an adaptive enhancement method for microscopic endoscope images according to the present invention;
[0019] Figure 2 This is a schematic diagram of an adaptive image enhancement system for microendoscopic microscopes according to the present invention. Detailed Implementation
[0020] The present invention will be further described in detail below through specific embodiments. The following embodiments are merely descriptive and not limiting, and should not be used to limit the scope of protection of the present invention.
[0021] like Figure 1 As shown, an adaptive enhancement method for microendoscopic images includes the following steps:
[0022] Step S1: Preprocess the microendoscopic image based on the preset enhancement intensity to obtain the image sequence, and perform non-uniform sparse sampling on the microendoscopic image to obtain representative pixels.
[0023] Step S1 includes:
[0024] Step S1-1: Three enhancement intensities are preset, namely p=0, p=0.5, and p=1. p=0 indicates that no enhancement is applied to the microendoscopic image, p=0.5 indicates that the microendoscopic image is enhanced at a medium intensity, and p=1 indicates that the microendoscopic image is enhanced at the maximum intensity.
[0025] It should be noted that the enhancement intensity p is a parameter used to quantify the degree of image enhancement, and its value range is set to [0,1]. Here, p=0 corresponds to the original image state, without applying any enhancement operation, and retaining the original pixel information of the image; p=0.5 corresponds to medium intensity enhancement, which moderately adjusts the contrast and brightness of the image, which can improve the image clarity without amplifying noise; p=1 corresponds to maximum intensity enhancement, which maximizes the adjustment of the contrast and brightness of the image, and is used to capture the weakest detail information in the image, providing complete intensity change data for trajectory prediction.
[0026] Furthermore, the setting of the three enhancement intensities follows the gradient principle to ensure that subsequent trajectory prediction can cover the pixel change patterns under different enhancement levels. In order to balance accuracy and computational efficiency, this embodiment selects three enhancement intensities: p=0, p=0.5, and p=1. p=0 is used as the original baseline and p=1 is used as the maximum enhancement limit, which can completely cover the entire dynamic range of pixel enhancement and ensure that trajectory prediction can capture the complete change pattern from no enhancement to maximum enhancement. p=0.5 is used as an intermediate gradient point, which can effectively fill the gap between the two extreme intensities and avoid trajectory prediction distortion due to excessive sampling intervals. At the same time, it does not require setting too many intermediate intensity points, reducing the computational load of subsequent data processing. This also takes into account the dual requirements of image clarity and realism for clinical diagnosis.
[0027] For example, for gastric microendoscopic images, three enhancement intensities are preset: p=0, p=0.5, and p=1. The image corresponding to p=0 is the original gastric microendoscopic image without any enhancement. The gastric mucosal texture is blurred and the microvessels are difficult to distinguish. The medium-intensity enhanced image corresponding to p=0.5 improves the contrast and brightness of the original image, making the gastric mucosal texture clear and the outlines of microvessels discernible. The maximum intensity enhanced image corresponding to p=1 further improves the contrast and brightness of the original image, clearly showing the fine folds of the gastric mucosa and the branches of microvessels, but also slightly amplifies a small amount of noise in the image.
[0028] Step S1-2: Based on the three enhancement intensities, the microendoscopic images are preprocessed to generate three microendoscopic images with different enhancement effects, which are then combined into an image sequence.
[0029] Specifically, the input microscopic endoscope image is preprocessed using three set enhancement intensities. The preprocessing mainly includes image denoising, grayscale normalization, and enhancement operations to ensure that the three generated images have a uniform grayscale range and image quality, avoiding the influence of irrelevant noise and grayscale deviations on subsequent trajectory prediction. Denoising can employ a Gaussian filtering algorithm with a 3×3 kernel size to remove random noise from the image. Grayscale normalization maps the image grayscale values to the range [0, 255], ensuring comparability of pixel values under different enhancement intensities. Enhancement operations employ a contrast-limited adaptive histogram equalization algorithm, adjusting the enhancement amplitude according to the set enhancement intensity p; the larger p is, the greater the contrast gain of the algorithm. The three generated images with different enhancement effects are combined in ascending order of enhancement intensity to form an image sequence. This image sequence completely records the pixel changes of the original image under different enhancement intensities.
[0030] In some possible embodiments, for gastric microendoscopic images, the original image at p=0 is first subjected to 3×3 Gaussian filtering for noise reduction to remove a small amount of salt-and-pepper noise; then grayscale normalization is performed to map the image grayscale values to [0,255]; then CLAHE enhancement operations are performed on the images at p=0.5 and p=1 respectively, where the contrast gain can be set to 1.3 when p=0.5 and 1.6 when p=1; finally, three images are generated, and the three images are combined in ascending order of p value to obtain a gastric microendoscopic image sequence.
[0031] Steps S1-3: Based on gradient-guided non-uniform sparse sampling, sample the microscopic endoscope image to obtain representative pixels.
[0032] Specifically, a default sampling interval is set, and the sampling interval is halved for encrypted sampling in edge regions with large gradient magnitudes in the image. The total number of sampling points is set simultaneously, and all sampling points are used as representative pixels.
[0033] Specifically, to balance sample representativeness and computational efficiency, this step employs a gradient-guided non-uniform sparse sampling method to sample the microscopic endoscope image. This means adjusting the sampling density based on the magnitude of the image gradient. Regions with large gradient magnitudes, such as edges and detail areas, exhibit drastic pixel changes and are key areas for image enhancement, requiring denser sampling to retain more detail. Regions with small gradient magnitudes, such as smooth areas, show gradual pixel changes and can use the default sampling interval to reduce the number of sampling points and decrease subsequent computational load.
[0034] Furthermore, the default sampling interval is first set to 16, meaning one sampling point is selected every 16 pixels. Then, the gradient magnitude of the image can be calculated using the Sobel operator. When the gradient magnitude is greater than a preset threshold (in this embodiment, the gradient threshold is set to 20), it is determined to be an edge region, and the sampling interval is halved for encrypted sampling. At the same time, the total number of sampling points is set to approximately 5% of the total pixels of the image to ensure that the number of sampling points can cover the key areas of the image without excessively increasing the computational burden. Finally, all selected sampling points are used as representative pixels, which can accurately reflect the pixel distribution and variation patterns of the entire image.
[0035] It should be noted that, in order to balance sampling efficiency and representativeness, the default sampling interval is set to 16 in this embodiment. Specifically, for commonly used 1024×768 resolution microscopic endoscope images, an interval of 16 can keep the total number of sampling points at about 5% of the total pixels. This avoids both excessively small intervals that would lead to a surge in computation and excessively large intervals that would cause key features to be missed. At the same time, the gradient threshold is set to 20, which can accurately distinguish between edge regions and smooth regions. This avoids misjudging smooth regions as edges due to a threshold that is too low, and also avoids missing weak edges due to a threshold that is too high, resulting in loss of details.
[0036] Understandably, the edge regions are key information-carrying areas in microscopic endoscopic images, such as the edges of gastric mucosa and microvascular vessels. These regions exhibit dramatic pixel variations, directly determining the image's detail clarity and diagnostic effectiveness. Enhanced sampling can capture more edge detail features, avoiding the loss of edge information due to sparse sampling. Specifically, the enhanced sampling includes: calculating the gradient magnitude of each pixel in the image using the Sobel operator; identifying all pixel regions with gradient magnitudes greater than a preset threshold of 20 and marking them as edge regions; halving the sampling interval of the edge regions from the default 16 to 8, i.e., selecting one sampling point every 8 pixels, doubling the sampling density compared to smooth regions; uniformly sampling row by row and column by column within the marked edge regions according to the new sampling interval of 8, ensuring a uniform distribution of sampling points within the edge regions; and summing the sampling points obtained from the enhanced sampling of the edge regions with the sampling points obtained from the smooth regions at the default interval of 16, using them together as representative pixels.
[0037] In some possible embodiments, for a 1024×768 pixel gastric microendoscopic image, a default sampling interval of 16 is set. In the smooth gastric mucosa region of the image, where the gradient amplitude is less than 20, a sampling point is selected every 16 pixels. In the gastric mucosa edge and microvascular region, where the gradient amplitude is greater than 20, the sampling interval is halved to 8 for encrypted sampling. The total number of pixels in the image is 786,432, and the total number of sampling points is approximately 39,322, accounting for about 5% of the total pixels. Among the final selected representative pixels, about 60% are distributed in key areas such as the edge and microvascular region, and 40% are distributed in the smooth region. These representative pixels can fully reflect the pixel change characteristics of the gastric microendoscopic image.
[0038] Step S2: Based on the trajectory prediction network and combined with the pixel values representing pixels in the image sequence, obtain the pixel change trajectory and extract the feature vector of each pixel change trajectory.
[0039] Step S2 includes:
[0040] Step S2-1: Obtain historical data of microendoscopy and construct a trajectory prediction network based on the historical data of microendoscopy.
[0041] Specifically, firstly, a large amount of historical microendoscopic data is acquired, including microendoscopic images of different locations and lesion degrees, as well as pixel value data of these images under different enhancement intensities; then, the historical data is preprocessed to extract the complete pixel change trajectory of each pixel under different enhancement intensities as the label for model training, and the enhancement intensity K is 10-20, covering the range [0,1].
[0042] Furthermore, the trajectory prediction network adopts a three-level fully connected architecture consisting of an input layer, a hidden layer, and an output layer. The input layer, the network's input, contains three neurons, each corresponding to a pixel value at a given enhancement level (p=0, p=0.5, p=1). It receives the three input features representing the pixel and transforms them into a vector form that the network can process. The hidden layer consists of two layers, each containing 32 neurons and employing the ReLU activation function. The first hidden layer receives the 3D vector from the input layer and extracts features through linear transformation and ReLU activation, mapping the low-dimensional input features to high-dimensional features. The second hidden layer receives the 32-dimensional feature vector output from the first hidden layer and further deepens and fuses these features, filtering redundant information and retaining features related to the pixel's trajectory change. The output layer contains 10 neurons, corresponding to the 10 predicted enhancement levels (p=0, 0.1, 0.2, ..., 1.0), and uses a linear activation function to map the high-dimensional features output from the hidden layer to specific pixel values, forming a complete pixel trajectory change.
[0043] For example, a massive amount of historical microscopic endoscopic image data of the stomach, intestines, and other parts of the body is acquired. For each historical image, 15 images with different enhancement intensities are generated, such as p=0, 0.07, 0.14, ..., 1.0. The pixel value of each pixel under these 15 enhancement intensities is extracted to form a complete pixel change trajectory, which is used as a training label. A three-layer fully connected trajectory prediction network is constructed. The input layer receives three pixel values, corresponding to p=0, 0.5, and 1. The two hidden layers each have 32 neurons. The output layer outputs 10 pixel values, corresponding to p=0, 0.1, 0.2, ..., 1.0. The historical trajectories of gastric microscopic endoscopic images are used as training data. During training, the mean square error between the predicted trajectory and the real trajectory is minimized. After 50 training rounds, the loss function converges, resulting in a fixed trajectory prediction network.
[0044] Step S2-2: Extract the three pixel values of each representative pixel at the corresponding position in the image sequence, input the three pixel values into the trajectory prediction network, and output the pixel change trajectory.
[0045] Specifically, firstly, from the image sequence, including three images corresponding to p=0, p=0.5, and p=1, the pixel value of each representative pixel at its corresponding position in the three images is extracted, resulting in three pixel values for each representative pixel, denoted as v0, v0.5, and v1, corresponding to p=0, 0.5, and 1 respectively. Then, these three pixel values are used as input to the trajectory prediction network. Based on the three input pixel values, the trajectory prediction network outputs a complete pixel change trajectory containing 10 pixel values, corresponding to enhancement intensities p=0, 0.1, 0.2, ..., 1.0, with each representative pixel corresponding to an independent pixel change trajectory.
[0046] In some possible embodiments, continuing the above case, a representative pixel located at the edge of the gastric mucosa is selected from 39,322 representative pixels of gastric microendoscopic images, such as the representative pixel with coordinates (256, 384). From the image sequence, the pixel values v0=85 when p=0, v0.5=120 when p=0.5, and v1=165 when p=1 are extracted from this pixel. These three pixel values (85, 120, 165) are input into the trajectory prediction network, and the network outputs 10 pixel values, corresponding to p=0 (85), 0.1 (92), 0.2 (100), 0.3 (108), 0.4 (116), 0.5 (120), 0.6 (128), 0.7 (138), 0.8 (150), 0.9 (158), and 1.0 (165), respectively, forming the pixel change trajectory of the representative pixel.
[0047] Steps S2-3: For each pixel change trajectory, extract derivative features, frequency domain features, and morphological features respectively, and integrate them into a feature vector.
[0048] It should be noted that the derivative feature of the pixel change trajectory reflects the rate of change of the trajectory, the frequency domain feature reflects the oscillation characteristics of the trajectory, and the morphological feature reflects the curve shape of the trajectory. The feature vector formed by the combination of the three can comprehensively describe the differences in the pixel change trajectory. In the extraction process, the specific parameters of the three types of features are extracted first, then all parameters are normalized and mapped to the range of [0,1]. Finally, the parameters of the three types of features are integrated in a fixed order to form a feature vector.
[0049] Furthermore, the derivative features can be extracted using numerical differentiation. A first-order derivative sequence is obtained by calculating the pixel value difference corresponding to adjacent enhancement intensities. Then, a second-order derivative sequence is obtained by performing a second numerical differentiation on the first-order derivative sequence, and the peak position, peak size, and mean of the derivatives are statistically analyzed. Frequency domain features can be extracted using fast Fourier transform. A Fourier transform is performed on the complete pixel change trajectory, and the DC component and main frequency amplitude are separated from the transform result. The high-frequency energy proportion is obtained by calculating the ratio of high-frequency component energy to total energy. Morphological features can be extracted using integration, Euclidean distance, and quadratic function fitting. The area under the curve is calculated using the trapezoidal integral method, the curve length is obtained by summing the Euclidean distances between adjacent pixels, and the coefficients are obtained by fitting a quadratic function to determine the curve convexity.
[0050] Step S2-3 includes:
[0051] Step S2-3-1: The derivative features are used to describe the rate of change of the pixel change trajectory, specifically including the first derivative sequence, the second derivative sequence, the position of the derivative peak, the magnitude of the derivative peak, and the mean of the derivative.
[0052] Understandably, derivative features describe the rate of change of a pixel's trajectory, reflecting how fast and how much the pixel value changes with enhancement intensity. Specifically, the first derivative sequence is calculated using the difference between pixel values corresponding to two adjacent enhancement intensities, reflecting the rate of change of the trajectory within each enhancement intensity interval. The second derivative sequence is calculated using the difference between two adjacent first derivative values, reflecting the trend of the trajectory's rate of change, i.e., the concavity or convexity of the trajectory. The peak position of the derivative is the enhancement intensity position corresponding to the maximum value in the first derivative sequence, reflecting the enhancement intensity point where the pixel value changes the fastest. The magnitude of the peak derivative is the maximum value in the first derivative sequence, reflecting the maximum rate of change of the pixel value. The mean derivative is the average value of the first derivative sequence, reflecting the average rate of change of the pixel value.
[0053] For example, for the pixel change trajectory of the pixel point representing the edge of the gastric mucosa, with 10 pixel values, calculate its derivative features; the first derivative sequence is [7,8,8,8,4,8,10,12,7], corresponding to 9 differences; the second derivative sequence is [1,0,0,-4,4,2,2,-5]; the peak position of the derivative is p=0.8, corresponding to the maximum value of the first derivative of 12; the peak value of the derivative is 12; the mean of the derivative is 8.22.
[0054] Step S2-3-2, the frequency domain features are used to describe the oscillation characteristics of the pixel change trajectory, specifically including the DC component, the main frequency amplitude, and the proportion of high-frequency energy.
[0055] Understandably, frequency domain features, extracted by performing a Fast Fourier Transform on pixel change trajectories, can reflect the oscillation characteristics of the trajectory and are used to distinguish between noise trajectories and valid trajectories. The DC component is a constant term after the Fourier transform, reflecting the overall offset level of the trajectory, i.e., the average level of pixel values. The dominant frequency amplitude is the amplitude corresponding to the frequency component with the largest amplitude after the Fourier transform, reflecting the intensity of the most dominant oscillation frequency of the trajectory. The high-frequency energy ratio is the ratio of the energy of the high-frequency component to the total energy, used to identify noise trajectories. It should be noted that the high-frequency energy ratio is relatively high for noise trajectories and relatively low for valid trajectories, usually below 30%.
[0056] For example, performing a Fast Fourier Transform on the pixel change trajectory representing the edge of the gastric mucosa yields a DC component of 118, corresponding to the average value of the trajectory pixels; a main frequency amplitude of 28; a total energy of 1250; a high-frequency component energy of 280; and a high-frequency energy ratio of 280 / 1250 = 22.4%, which is less than 30%, indicating that the trajectory is a valid trajectory with no significant noise interference.
[0057] Step S2-3-3: The morphological features are used to describe the curve shape of the pixel change trajectory, specifically including the area under the curve, the curve length, and the curve convexity.
[0058] Understandably, morphological features are used to describe the curve shape of the pixel change trajectory, reflecting the overall trend of pixel value changes with enhancement intensity; the area under the curve is the area enclosed by the trajectory and the enhancement intensity coordinate axis, reflecting the cumulative change of pixel value with enhancement intensity. The larger the area, the greater the overall enhancement of pixel value; the curve length is the actual arc length of the trajectory, reflecting the degree of trajectory fluctuation. The longer the length, the more drastic the trajectory fluctuation; the curve convexity is obtained by fitting a quadratic function v=ak²+bk+c to obtain the coefficient 'a', where v represents the pixel value in the pixel change trajectory, k represents the enhancement intensity in the pixel change trajectory, and a, b, and c are all fitting coefficients. 'a' greater than 0 indicates that the trajectory is an upward convex curve, that is, the pixel value change rate gradually slows down; 'a' less than 0 indicates that the trajectory is a downward convex curve, that is, the pixel value change rate gradually accelerates; 'a' approximately equal to 0 indicates that the trajectory is a linear curve, that is, the pixel value change rate is basically constant.
[0059] For example, the area under the curve of the pixel change trajectory representing the pixel point at the edge of the gastric mucosa was calculated by the trapezoidal integral method, and the area was 1180. The enhancement intensity interval was 0.1, and the integration range was 0 to 1. The curve length was calculated by summing the Euclidean distances between adjacent pixels, and the length was 45.2. The quadratic function was fitted and the coefficient was obtained as -2.5, indicating that the trajectory is a convex curve, that is, the pixel value change rate gradually increases with the increase of enhancement intensity.
[0060] Finally, the three extracted features are integrated into a feature vector. The specific process includes: after extracting the parameters of each of the three types of features, normalizing each parameter. The min-max normalization algorithm can be used to map all parameters to the range of [0,1] to eliminate the influence of differences in the magnitude of different parameters; following the order of derivative features - frequency domain features - morphological features, the normalized parameters are concatenated in sequence to form a one-dimensional feature vector with a dimension of 11. Each feature vector uniquely corresponds to a pixel change trajectory.
[0061] Step S3: Cluster the pixel change trajectory based on the density peak clustering algorithm to obtain the clustering results.
[0062] It should be noted that this embodiment uses density peak clustering instead of other clustering algorithms such as K-means or hierarchical clustering. The reasons include: density peak clustering eliminates the need to pre-set the number of clusters, allowing for adaptive identification of cluster centers based on the actual distribution of feature vectors, thus avoiding poor clustering results caused by an unreasonable pre-set number of clusters. It is also suitable for scenarios where the distribution of feature vectors in different microscopic endoscope images varies significantly. Furthermore, it has no strict requirements on the distribution shape of feature vectors, handling both densely distributed and sparse, non-spherical feature vectors, thus adapting to the complex distribution characteristics of high-dimensional feature vectors in this scheme. It can also effectively distinguish between noise points and effective clusters, allowing for further optimization of clustering results through subsequent small cluster merging steps, avoiding the impact of noise trajectories on clustering accuracy, and ensuring that the clustering results accurately correspond to pixel trajectories with different enhancement requirements.
[0063] The local density and minimum distance to higher density points of each pixel change trajectory are obtained, and a decision value is obtained by multiplying the local density and minimum distance. Cluster centers are identified based on the decision value, the number of clusters is obtained based on the cluster centers, and the clustering result is obtained based on the number of clusters.
[0064] In this process, non-cluster centers are assigned to the cluster to which the nearest cluster center belongs. At the same time, small clusters are defined and merged into the nearest neighbor cluster whose feature vector is closest to that of the small cluster. The small cluster is defined as a cluster whose number of pixels is less than 0.1% of the total number of pixels.
[0065] Specifically, the density peak clustering algorithm is used to group the pixel change trajectories of all representative pixels, and pixel trajectories with similar enhancement needs are grouped into one category, providing a classification basis for the subsequent fitting function and the solution of the optimal enhancement intensity. First, the feature vector is used as the clustering object, and the local density ρ and the minimum distance δ to higher density points are calculated for each feature vector, that is, the corresponding pixel change trajectory.
[0066] Furthermore, the local density ρ is obtained by calculating the Euclidean distance between the feature vector and all other feature vectors, and counting the number of feature vectors whose distances are less than a preset cutoff distance, reflecting the density of the trajectory in the feature space; the minimum distance δ is the minimum value among the Euclidean distances of the feature vector to all feature vectors with a local density greater than its own, reflecting the proximity of the trajectory to high-density trajectories; at the same time, the decision value is obtained by multiplying the two, i.e., Y=ρ×δ. The larger the decision value, the more likely the trajectory is to become a cluster center; by setting a decision value threshold, which is adaptively determined according to the data distribution, cluster centers are identified, and the number of cluster centers is the number of clusters.
[0067] It should be noted that, in order to adapt to the distribution characteristics of the feature vectors in this scheme and to balance the rationality of local density calculation and the stability of clustering effect, since all parameters of the feature vectors in this scheme are mapped to the range of [0,1] after min-max normalization, the Euclidean distance of the feature vectors is usually in the range of [0,3]. Setting the cutoff distance to 1.5 can make the local density ρ of each feature vector in a reasonable range of 5-80. This avoids the local density ρ being too small due to the cutoff distance being too small, making it difficult to identify the cluster center, and also avoids the local density ρ being too concentrated due to the cutoff distance being too large, making it impossible to distinguish the dense regions of different clusters.
[0068] Meanwhile, since the feature vector distributions of different microscopic endoscope images vary, a fixed threshold cannot be adapted to all scenarios. If the threshold is set too high, the number of cluster centers will be too small, and pixel trajectories with different enhancement needs will be grouped into one category, affecting the targeting of the subsequent optimal enhancement intensity. If the threshold is set too low, the number of cluster centers will be too large, resulting in redundant clustering. Therefore, based on the decision value distribution of different feature vectors, such as the decision value range of 1.5-416 in this embodiment, the threshold is adaptively set, which is 100 in this embodiment, so as to meet the different enhancement needs of pixels in different regions.
[0069] Furthermore, non-cluster centers are assigned to the cluster to which their nearest cluster center belongs, completing the initial clustering. At the same time, small clusters are defined, which are those with less than 0.1% of the total number of pixels. By calculating the similarity of the feature vectors of small clusters with other clusters, the smaller the Euclidean distance, the higher the similarity. Small clusters are then merged into the nearest neighbor cluster with the highest similarity, and the final clustering result is obtained.
[0070] In some possible embodiments, for the pixel change trajectory, i.e., feature vector, of the gastric microendoscopic image, the local density ρ and minimum distance δ of each feature vector are first calculated, and the truncation distance is set to 1.5; the decision value threshold is set to 100, and 8 cluster centers are identified, i.e., the number of clusters is 8; all non-cluster center points are assigned to the cluster to which the nearest cluster center belongs, completing the preliminary clustering; the total number of pixels is 786432, and the criterion for small clusters is that the number of pixels is less than 786. After the preliminary clustering, 2 small clusters are obtained, with the number of pixels being 520 and 680, respectively; the Euclidean distance of the feature vectors of these 2 small clusters and the other 6 clusters is calculated, and the small cluster with the number of pixels of 520 is merged into the cluster with the smallest Euclidean distance, corresponding to the trajectory of the smooth gastric mucosa region, and the small cluster with the number of pixels of 680 is merged into the cluster with the smallest Euclidean distance, corresponding to the trajectory of the microvascular region, finally obtaining 8 stable clustering results, and each cluster corresponds to a class of pixel trajectories with similar enhancement needs.
[0071] Step S4: Fit the clustering results to obtain the fitting function, and solve the fitting function to obtain the optimal enhancement intensity.
[0072] Step S4 includes:
[0073] Step S4-1: Perform parametric fitting on each cluster in the clustering results to obtain the fitting function, wherein the fitting function is specifically expressed as... ;
[0074] Among them, the Indicated as enhanced strength, the In order to control the rapid saturation of components, the This is expressed as a control response sensitivity, the This is represented as the component controlling linear enhancement.
[0075] It should be noted that for each cluster, the pixel change trajectory of all representative pixels in the cluster is parametrically fitted to obtain the fitting function. This fitting function consists of an exponential saturation term and a linear enhancement term, which can fit the saturation-linear composite trend of pixel value change with enhancement intensity.
[0076] in, Controlling the fast saturation component, the larger the value, the faster the pixel value reaches saturation, which is suitable for pixels that need to be rapidly enhanced, such as edges and details; The higher the value of the control response sensitivity, the more sensitive the pixel value is to the enhancement intensity, which is suitable for pixels with drastic changes; The linear enhancement component is controlled; the larger its value, the greater the linear enhancement of the pixel value, which is suitable for pixels requiring steady enhancement, such as smooth regions. The fitting process uses the least squares method, taking the trajectory data of all representative pixels within a cluster as samples, including the enhancement intensity p and the corresponding pixel value v, minimizing the mean square error between the fitted value and the true value, and solving for the corresponding value for each cluster. The parameters determine the fitting function for this clustering class.
[0077] It should be noted that controlling the rapid saturation component, controlling the response sensitivity, and controlling the linear enhancement component can all be obtained simultaneously through the same least squares fitting process. The specific process involves using the complete pixel change trajectories of all representative pixels within a cluster as samples (each sample contains a set of (p,v) data), substituting all sample data into the fitting function to construct a mean squared error function. This function reflects the deviation between the fitted value and the true pixel value of the sample. The least squares method is then used to find a set of values that minimizes the mean squared error. The parameter is the parameter value corresponding to this cluster; where, The solution is directly related to the saturation characteristics of the pixel values, and the fitting process will adaptively adjust according to the saturation rate of the sample trajectory. The larger the size, the faster the trajectory saturates, and the better the solution obtained. The larger the value; The solution is related to the sensitivity of the trajectory to changes; the more drastic the change in the sample trajectory with the enhancement intensity, the more sensitive the solution becomes. The larger the value; The solution is related to the linear change trend of the trajectory; the more obvious the linear enhancement feature of the sample trajectory, the better the solution. The larger the value, the more simultaneously all three are solved, ensuring the fit between the fitting function and the sample trajectory, and accurately matching the enhancement needs of this type of pixel.
[0078] In some possible embodiments, continuing the above case, for the clusters corresponding to the gastric mucosal edge regions among the 8 clusters obtained in step S3, parameterized fitting is performed; using the trajectory data of all representative pixels within this cluster as samples, the least squares fitting function is used to solve for the obtained function. =80, =2.5, =40, and substitute it into the above fitting function; where, controlling the fast saturation component to 80 indicates that the fast saturation component of this type of pixel is strong and can quickly achieve the saturation enhancement effect; controlling the response sensitivity to 2.5 indicates that this type of pixel has a high response sensitivity to the enhancement intensity; controlling the linear enhancement component to 40 indicates that the linear enhancement amplitude of this type of pixel is moderate, taking into account the enhancement effect and avoiding distortion.
[0079] Step S4-2, construct the objective function The fitting function is solved based on the objective function to obtain the optimal enhancement intensity for each cluster.
[0080] Among them, the and All of these are weighting coefficients, the aforementioned The first derivative of the fitted function is expressed as follows: It is represented as the second derivative of the fitted function.
[0081] Specifically, this step uses a constructed objective function to balance pixel enhancement effects and the risk of image distortion, ensuring that the optimal enhancement intensity obtained improves image clarity without causing over-enhancement or noise amplification. In this embodiment, the weighting coefficients in the objective function... and The values are 0.7 and 0.3 respectively, where, Used to emphasize the enhancement effect, The larger the size, the more pronounced the enhancement effect. Used to suppress excessive enhancement The larger the value, the stronger the trajectory concavity and convexity, and the higher the risk of over-enhancement. It is the first derivative of the fitted function, reflecting the rate of change of pixel value with enhancement intensity. The larger the size, the more pronounced the enhancement effect; It is the second derivative of the fitted function, reflecting the changing trend of the enhancement rate. An excessively large value indicates a drastic change in the enhancement rate, which can easily lead to over-enhancement. By solving for the maximum value of the objective function, the optimal enhancement intensity corresponding to each cluster is obtained, and the optimal balance between enhancement effect and image quality is achieved through the optimal enhancement intensity.
[0082] It should be noted that when solving the objective function, the objective function value is set to be greater than or equal to 26, based on practical requirements. Simultaneously, based on the enhancement effect requirements, the enhancement rate is set to be greater than or equal to 70. These specific limitations are designed to ensure that the risk of distortion is controllable. This was verified through extensive testing using microscopic endoscopic images. For example, the tests revealed that when the objective function value is less than 26, the enhancement rate decays too slowly, resulting in a surge in pixel values and significant noise amplification. For instance, the noise grayscale value in the smooth area of the gastric mucosa increases from 10-15 to 30-40, exceeding the clinically acceptable range. When the objective function value is greater than or equal to 26, the enhancement rate decays gradually, and the noise amplification remains within a controllable range.
[0083] Furthermore, based on the minimum requirements for image clarity in clinical diagnosis, the enhancement rate was set to be greater than or equal to 70. This was also verified through extensive testing. For example, 50 clinicians were selected to rate the image clarity corresponding to different enhancement rates, ranging from 1 to 10 points. A score of 8 or above was considered to meet clinical requirements. When v'(p) was less than 70, the pixel enhancement was insufficient, and key details such as small blood vessels and fine folds in the gastric mucosa could not be clearly distinguished. The physicians' scores were all below 8 points. When v'(p) was greater than or equal to 70, key details could be clearly presented, and the physicians' scores were greater than 8 points, which met the requirements for clinical diagnosis.
[0084] For example, 100 images of gastric microendoscopic surgery were selected and grouped for testing according to different target function values and enhancement rates. Among them, 30 images with a target function value of 24 and v'(p)=65 showed an average increase of 18 in noise grayscale value, a low microvascular recognition rate, and an average physician score of 7.2, which did not meet the standard. 40 images with a target function value of 26 and v'(p)=70 showed an average increase of 4 in noise grayscale value, a high microvascular recognition rate, and an average physician score of 8.5, which met the standard. 30 images with a target function value of 30 and v'(p)=85 showed an average increase of 3 in noise grayscale value, a microvascular recognition rate of 98%, and an average physician score of 9.1.
[0085] It should be noted that this step is based on the clinical diagnostic needs of microendoscopic images, aiming to achieve an optimal balance between prioritizing enhancement effects and secondary distortion control. Therefore, the weighting coefficients are... Set to 0.7 The value is set to 0.3; the specific reasons are as follows: the requirement for microscopic endoscopic images is to improve clarity, providing clear information on lesions, edges, and microvessels for clinical diagnosis. Setting it to 0.7 assigns a higher weight to the enhancement effect, ensuring that the optimal enhancement intensity effectively increases the pixel value change rate, making key details clearer. Simultaneously, a lower but necessary weight needs to be assigned to distortion control, ensuring that excessive suppression doesn't negatively impact the enhancement effect while effectively constraining drastic changes in the enhancement rate. This avoids problems like noise amplification and image distortion caused by over-enhancement, balancing image realism. Therefore, in this step... Set to 0.3; this setting allows key areas such as edges and small blood vessels to receive sufficient enhancement, while avoiding over-enhancement of smooth areas, ultimately achieving a balance between enhancement effect and image quality.
[0086] In some possible embodiments, a target function is constructed based on the fitting function for the gastric mucosal edge region clustering obtained in step S4-1; firstly, the first derivative v'(p) = 200e is obtained. (-2.5p) +40, second derivative v''(p) = -500e (-2.5p) Substituting the first and second derivatives into the objective function, we obtain the objective function expression as 0.7 × (200e (-2.5p) +40)-0.3×(-500e (-2.5p) )=290e (-2.5p) +28; Now, taking the derivative of the objective function, p'=-725e (-2.5p) It was found that the objective function is monotonically decreasing, meaning that the smaller p is, the larger the objective function value, but too small p will lead to insufficient enhancement; the larger p is, the smaller the objective function value, and the better the enhancement effect, but the higher the risk of distortion. Combining the constraints of the objective function value and the enhancement effect, the objective function value must be greater than or equal to 26, and the enhancement rate must be greater than or equal to 70. The solution yields p less than or equal to 0.76. In this embodiment, the microendoscopy needs to be enhanced, so the maximum value of p, i.e., 0.76, is selected; 0.76 is the optimal enhancement intensity corresponding to the clustering of the gastric mucosal edge region.
[0087] Step S5: Based on the similarity propagation mechanism, the feature vector and the optimal enhancement intensity are diffused to the microendoscopic image to obtain a continuous intensity mapping map, and the microendoscopic image is adaptively enhanced by linear interpolation.
[0088] Step S5 includes:
[0089] Step S5-1: Obtain the dual similarity between each pixel in the microendoscopic image and its surrounding representative pixels. The dual similarity is obtained based on spatial distance weight and pixel value similarity weight.
[0090] It should be noted that the dual similarity is an index that measures the similarity between each pixel in a microendoscopic image and its surrounding representative pixels. It is used to determine the feature vector of the representative pixel and the weight of the optimal enhancement intensity to diffuse into the whole image. It comprehensively considers spatial proximity and pixel feature similarity to ensure the accuracy of the diffusion results.
[0091] Specifically, the spatial distance weight is calculated based on the Euclidean distance between a pixel and its representative pixel. The closer the distance, the greater the weight. The formula is as follows: Among them, W s Represented as spatial distance weights, where d is the spatial distance between the pixel and the representative pixel, and σ is the spatial distance weight. s As a preset parameter, this embodiment sets it to 10; the pixel value similarity weight is calculated based on the difference between the pixel value and the pixel value of the representative pixel. The smaller the difference, the greater the weight. The formula is as follows: ;
[0092] Wherein, the W r Represented as pixel value similarity weight, I(x,y) is the pixel value of the current pixel, I(x i ,y i ) represents the pixel value of a pixel, σ r The preset parameter is set to 20 in this embodiment; the dual similarity is obtained by multiplying the spatial distance weight and the pixel value similarity weight, and is used to quantify the overall similarity between the current pixel and the representative pixel.
[0093] For example, for a non-representative pixel in a gastric microendoscopic image with coordinates (258, 386) and pixel value I=90, calculate its double similarity with the five surrounding representative pixels. The selected surrounding representative pixels include the one mentioned in step S2-2 with coordinates (256, 384) and pixel value I=85, and the spatial distance between them is d≈2.83; the spatial distance weight W... s ≈0.923; Pixel value similarity weight W r ≈0.939; therefore, the double similarity between this pixel and the representative pixel is 0.867.
[0094] Step S5-2: Based on dual similarity, perform weighted average interpolation on the feature vectors of surrounding representative pixels and the optimal enhancement intensity to obtain the feature vector and optimal enhancement intensity of each pixel in the microendoscopic image, and generate a continuous intensity mapping map.
[0095] Specifically, through dual similarity, for each non-representative pixel, representative pixels within a certain range around it are selected. In this embodiment, a 3×3 neighborhood is used. Using dual similarity as the weight, the feature vectors and optimal enhancement intensities of these representative pixels are weighted and interpolated by weighted average to obtain the feature vector and optimal enhancement intensity of the non-representative pixel. For representative pixels, their own feature vectors and optimal enhancement intensities are directly used. In this way, the features and optimal enhancement intensities of sparse representative pixels are diffused to all pixels in the entire image, ensuring that each pixel has a corresponding feature vector and optimal enhancement intensity. The optimal enhancement intensities of all pixels in the entire image are arranged according to pixel coordinates to generate a continuous intensity mapping map.
[0096] In some possible embodiments, for a non-representative pixel at coordinates (258, 386) in a gastric microendoscopic image, five representative pixels within its 3×3 neighborhood are selected. The dual similarity of each representative pixel is 0.867, 0.752, 0.683, 0.591, and 0.524, respectively, and the corresponding optimal enhancement intensities are 0.6, 0.58, 0.55, 0.52, and 0.5, respectively. The optimal enhancement intensity of the non-representative pixel is calculated using weighted average interpolation (0.867×0.6+0.752×0.58+0.58). 683×0.55+0.591×0.52+0.524×0.5)÷(0.867+0.752+0.683+0.591+0.524)≈0.556; At the same time, the feature vector of the pixel is obtained by the same weighted average interpolation method; Repeat this process to obtain the optimal enhancement intensity of all pixels in the whole image and generate a continuous intensity map. In the map, the optimal enhancement intensity of the gastric mucosa edge region is concentrated in 0.55-0.65, the smooth region is concentrated in 0.4-0.5, and the microvascular region is concentrated in 0.6-0.7.
[0097] Step S5-3: Based on linear interpolation and combined with the optimal enhancement intensity of each pixel in the continuous intensity map, pixel-level enhancement of the microendoscopic image is performed, and the enhanced image is output.
[0098] Specifically, based on the optimal enhancement intensity of each pixel in the continuous intensity map, linear interpolation is performed between the original image and the image with the maximum enhancement intensity to obtain the enhanced pixel value of that pixel, ensuring that the enhancement effect accurately matches the optimal enhancement intensity; the enhancement formula is I. e (x,y)=(1-p(x,y))·I(x,y)+p(x,y)·E max (x,y), where I e (x,y) represents the enhanced pixel value, I(x,y) represents the original image pixel value, p(x,y) represents the optimal enhancement intensity for that pixel, and E max(x,y) represents the maximum intensity of the enhanced image pixel value when p=1. Through this formula, each pixel can obtain a personalized enhancement effect based on its optimal enhancement intensity. The enhancement amplitude is large in edge and detail areas, and moderate in smooth areas, avoiding over-enhancement and noise amplification, and finally outputting an enhanced image.
[0099] In some possible embodiments, for the pixel at coordinates (258, 386) in the gastric microendoscopic image, its original pixel value I(x, y) = 90, and the maximum intensity enhanced image pixel value E max (x,y)=170, optimal enhancement intensity p=0.556; calculate the enhanced pixel value according to the enhancement formula: I e ≈134.48, rounded to 134; repeat this process to perform linear interpolation enhancement on all pixels in the entire image, and finally output the enhanced image of the gastric microendoscopy.
[0100] Figure 2 The diagram illustrates a microscopic endoscope image adaptive enhancement system that can realize the ideas of this application, according to some embodiments of this application.
[0101] Specifically, a microendoscopic image adaptive enhancement system includes:
[0102] The processing module preprocesses the microendoscopic image based on a preset enhancement intensity to obtain an image sequence. Based on a trajectory prediction network and combined with the pixel values representing pixels in the image sequence, it obtains the pixel change trajectory and extracts the feature vector of each pixel change trajectory.
[0103] The sampling module is used to perform non-uniform sparse sampling on the microendoscopic image to obtain representative pixels.
[0104] A clustering module, which clusters pixel change trajectories based on a density peak clustering algorithm to obtain clustering results;
[0105] The calculation module fits the clustering results to obtain a fitting function, and solves the fitting function to obtain the optimal enhancement intensity.
[0106] A diffusion module, which diffuses the feature vector and the optimal enhancement intensity to the microendoscopic image based on a similarity propagation mechanism, to obtain a continuous intensity mapping map;
[0107] An enhancement module adaptively enhances microendoscopic images using a continuous intensity mapping map and linear interpolation.
[0108] The specific usage and function of this embodiment are explained below:
[0109] First, the microendoscopic image is preprocessed with a pre-set enhancement intensity to obtain an image sequence. Non-uniform sparse sampling is then performed on the microendoscopic image to obtain representative pixels. Next, a trajectory prediction network is used, combined with the pixel values of the representative pixels in the image sequence, to obtain pixel change trajectories and extract feature vectors for each trajectory. Then, a density peak clustering algorithm is used to cluster the pixel change trajectories, obtaining the clustering results. The clustering results are then fitted to obtain a fitting function, which is solved to obtain the optimal enhancement intensity. Finally, a similarity propagation mechanism is used to spread the feature vectors and the optimal enhancement intensity to the microendoscopic image, obtaining a continuous intensity map. Linear interpolation is then used to adaptively enhance the microendoscopic image. By setting multiple thresholds, including gradient threshold, cutoff distance, and decision value threshold, and combining this with density peak clustering, quantitative control of the entire image enhancement process is achieved. The similarity propagation mechanism accurately identifies the proximity and similarity between pixels, thereby improving enhancement accuracy.
[0110] This embodiment provides an electronic device, which may include: at least one processor, at least one network interface, a user interface, a memory, and at least one communication bus.
[0111] The following is a detailed introduction to the various components of the electronic device:
[0112] The communication bus can be used to enable communication between the various components mentioned above.
[0113] The user interface may include buttons, and optional user interfaces may also include standard wired interfaces and wireless interfaces.
[0114] The network interface may include, but is not limited to, Bluetooth modules, NFC modules, Wi-Fi modules, etc.
[0115] The processor may include one or more processing cores. It connects various parts of the electronic device via various interfaces and lines, executing instructions, programs, code sets, or instruction sets stored in memory, and accessing data stored in memory to perform various functions and process data. Optionally, the processor can be implemented using at least one hardware form of DSP, FPGA, or PLA. The processor can integrate one or more of the following: CPU, GPU, and modem, for example, one or more digital signal processors (DSPs) or one or more field-programmable gate arrays (FPGAs). The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor.
[0116] The memory may include RAM or ROM. Optionally, the memory may include a non-transitory computer-readable medium. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (e.g., touch function, sound playback function, image playback function, etc.), instructions for implementing the various method embodiments described above, etc.; the data storage area may store data involved in the various method embodiments described above, etc. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor. The memory, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an evaluation application. The processor may be used to call the evaluation application stored in the memory and execute the method steps mentioned in the foregoing embodiments.
[0117] It should be noted that the above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0118] The above embodiments can be implemented, in whole or in part, through software, hardware (such as circuits), firmware, or any other combination thereof.
[0119] When implemented using software, the above embodiments can be implemented in whole or in part as a computer program product, which includes one or more computer instructions or computer programs; when the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part.
[0120] It is understood that the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device; the computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via transmission methods such as infrared, wireless, or microwave; the computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0121] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0122] It should be understood that, in the embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0123] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An adaptive enhancement method for microendoscopic images, characterized in that, It includes the following steps: The microendoscopic images are preprocessed based on a preset enhancement intensity to obtain an image sequence. The microendoscopic images are then subjected to non-uniform sparse sampling to obtain representative pixels. Based on a trajectory prediction network and combined with the pixel values representing pixels in the image sequence, the pixel change trajectory is obtained, and the feature vector of each pixel change trajectory is extracted. This includes acquiring historical data from microendoscopy, constructing a trajectory prediction network based on the historical data from microendoscopy, extracting three pixel values corresponding to the position of each representative pixel in the image sequence, inputting these three pixel values into the trajectory prediction network, outputting the pixel change trajectory, and extracting derivative features, frequency domain features, and morphological features for each pixel change trajectory and integrating them into a feature vector. The derivative features are used to describe the rate of change of the pixel change trajectory, specifically including the first derivative sequence, the second derivative sequence, the position of the derivative peak, the magnitude of the derivative peak, and the mean of the derivative. The frequency domain features are used to describe the oscillation characteristics of the pixel change trajectory, specifically including the DC component, the amplitude of the main frequency, and the proportion of high-frequency energy. The morphological features are used to describe the curve shape of the pixel change trajectory, specifically including the area under the curve, the length of the curve, and the convexity of the curve. The pixel change trajectory is clustered based on the density peak clustering algorithm to obtain the clustering results; This includes obtaining the local density of each pixel change trajectory and the minimum distance to a higher density point, obtaining a decision value by multiplying the local density and the minimum distance, identifying cluster centers based on the decision value, obtaining the number of clusters based on the cluster centers, and obtaining the clustering result based on the number of clusters. In this process, non-cluster centers are assigned to the cluster to which the nearest cluster center belongs. At the same time, small clusters are defined and merged into the nearest neighbor cluster whose feature vector is closest to that of the small cluster. The small cluster is represented as a cluster whose number of pixels is less than 0.1% of the total number of pixels. The clustering results are used to fit the data, obtain the fitting function, and solve the fitting function to obtain the optimal enhancement strength. Based on the similarity propagation mechanism, the feature vector and the optimal enhancement intensity are diffused to the microendoscopic image to obtain a continuous intensity map, and then adaptive enhancement of the microendoscopic image is performed by combining linear interpolation.
2. The adaptive enhancement method for microscopic endoscopic images according to claim 1, characterized in that, The microscopic endoscopic images are preprocessed based on a preset enhancement intensity to obtain an image sequence, including: Three enhancement intensities are preset: p=0, p=0.5, and p=1. p=0 indicates that no enhancement is applied to the microendoscopic image, p=0.5 indicates that the microendoscopic image is enhanced at a medium intensity, and p=1 indicates that the microendoscopic image is enhanced at the maximum intensity. Based on the three enhancement intensities, the microendoscopic images are preprocessed to generate three microendoscopic images with different enhancement effects, which are then combined into an image sequence.
3. The adaptive enhancement method for microendoscopic images according to claim 1, characterized in that, Non-uniform sparse sampling is performed on the microendoscopic images to obtain representative pixels, including: Gradient-guided non-uniform sparse sampling is used to sample microscopic endoscope images and obtain representative pixels. Specifically, a default sampling interval is set, and the sampling interval is halved for encrypted sampling in edge regions with large gradient magnitudes in the image. The total number of sampling points is set simultaneously, and all sampling points are used as representative pixels.
4. The adaptive enhancement method for microendoscopic images according to claim 1, characterized in that, Based on the clustering results, a fitting function is obtained, and the optimal enhancement strength is obtained by solving the fitting function, including: For each cluster in the clustering results, a parameterized fitting is performed to obtain the fitting function, which is specifically expressed as follows: ; Among them, the Indicated as enhanced strength, the In order to control the rapid saturation of components, the This is expressed as a control response sensitivity, the This is represented as the control of linear enhancement components; Construct the objective function The fitting function is solved based on the objective function to obtain the optimal enhancement intensity for each cluster. Among them, the and All of these are weighting coefficients, the aforementioned The first derivative of the fitted function is expressed as follows: It is represented as the second derivative of the fitted function.
5. The adaptive enhancement method for microendoscopic images according to claim 1, characterized in that, Based on a similarity propagation mechanism, feature vectors and optimal enhancement intensities are diffused to the microendoscopic image to obtain a continuous intensity map. Adaptive enhancement of the microendoscopic image is then performed using linear interpolation, including: The dual similarity between each pixel in a microendoscopic image and its surrounding representative pixels is obtained, and the dual similarity is obtained based on spatial distance weight and pixel value similarity weight. Based on dual similarity, a weighted average interpolation is performed on the feature vectors of surrounding representative pixels and the optimal enhancement intensity to obtain the feature vector and optimal enhancement intensity of each pixel in the microendoscopic image, and a continuous intensity mapping map is generated. Pixel-level enhancement of microendoscopic images is performed based on linear interpolation and combined with the optimal enhancement intensity of each pixel in the continuous intensity map, resulting in an enhanced image.
6. A microendoscopic image adaptive enhancement system for implementing the method of any one of claims 1-5, characterized in that, include: The processing module preprocesses the microendoscopic image based on a preset enhancement intensity to obtain an image sequence. Based on a trajectory prediction network and combined with the pixel values representing pixels in the image sequence, it obtains the pixel change trajectory and extracts the feature vector of each pixel change trajectory. The sampling module is used to perform non-uniform sparse sampling on the microendoscopic image to obtain representative pixels. A clustering module, which clusters pixel change trajectories based on a density peak clustering algorithm to obtain clustering results; The calculation module fits the clustering results to obtain a fitting function, and solves the fitting function to obtain the optimal enhancement intensity. A diffusion module, which diffuses the feature vector and the optimal enhancement intensity to the microendoscopic image based on a similarity propagation mechanism, to obtain a continuous intensity mapping map; An enhancement module adaptively enhances microendoscopic images using a continuous intensity mapping map and linear interpolation.