A medical image enhancement method and system for an anal fistula probe device
By optimizing anal fistula endoscope images through a multi-stage processing method, the problem of poor image quality was solved, and high-quality image enhancement was achieved, supporting accurate diagnosis and treatment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JILIN UNIV FIRST HOSPITAL
- Filing Date
- 2025-08-11
- Publication Date
- 2026-05-15
AI Technical Summary
The image quality of existing fistula endoscopes is affected by factors such as uneven lighting, liquid reflection, and sensor noise interference, resulting in color distortion, blurred details, and unclear edges, which affects the identification and judgment of lesion sites.
A multi-stage processing approach is employed, including white balance correction, detail enhancement network, edge enhancement network, and fusion network, combined with adaptive image contrast adjustment, to optimize image quality, enhance details and edges in lesion areas, and suppress noise.
It significantly improves the image quality of anal fistula endoscopy, providing high-quality and clear image information to assist doctors in accurate diagnosis and treatment, and reduce the risks of diagnosis and treatment.
Smart Images

Figure CN120976084B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and specifically to a medical image enhancement method and system for an anal fistula endoscope. Background Technology
[0002] Anal fistula is a common perianal disease, and its treatment outcome highly depends on the accurate preoperative assessment of the fistula's morphology, course, and related inflammatory areas. Anal fistula endoscopy, as a minimally invasive imaging technique under direct visualization, has been widely used in clinical diagnosis and intraoperative exploration. However, in practice, the image quality acquired by anal fistula endoscopy is often affected by various factors, such as uneven illumination due to a narrow cavity, fluid or mucosal reflection on the tissue surface, and sensor noise interference during image acquisition. These problems directly lead to defects in the images, such as color distortion, blurred details, and unclear edge contours, seriously affecting the surgeon's identification and assessment of the lesion site (such as the fistula tract, branches, internal opening, and area of inflammatory spread), thereby increasing the risks of preoperative assessment and surgical procedures.
[0003] Currently, to improve the visual quality of anal fistula endoscopy images, research has attempted to introduce traditional image enhancement techniques, such as histogram equalization, contrast stretching, and filtering denoising. However, these methods are mostly general-purpose algorithms and lack the ability to optimize for the specific structural features of medical images. The following problems often occur during the enhancement process: uneven enhancement; noise amplification; structural damage; and weak generalization ability. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] This invention provides a medical image enhancement method and system for an anal fistula endoscope. It optimizes image quality through multi-stage processing, enhances the details and edges of the lesion area, and suppresses noise, providing a reliable basis for clinical diagnosis and solving the problems mentioned in the background art.
[0006] (II) Technical Solution
[0007] To achieve the above objectives, the present invention specifically adopts the following technical solution:
[0008] A medical image enhancement method for an anal fistula endoscopic probe, the method comprising the following steps:
[0009] S1: The raw images acquired by the fistula endoscope are input to the preprocessing module, and the preprocessed images are obtained through white balance correction.
[0010] The white balance correction method specifically includes: calculating the average value of each color channel (R, G, B) in the original image, and calculating the correction gain coefficient of each channel based on the average value; then, multiplying the R, G, B components of each pixel in the image by the corresponding correction gain coefficient to achieve color correction of the image; and finally obtaining the pre-processed image.
[0011] S2: The preprocessed image is input to the detail enhancement network module in the enhancement fusion module for detail enhancement to obtain a detail-enhanced image;
[0012] S3: The preprocessed image is input to the edge enhancement network module in the enhancement fusion module for edge enhancement to obtain an edge-enhanced image;
[0013] S4: The detail enhancement image and the edge enhancement image are input into the fusion network module in the enhancement fusion module for fusion to obtain the image after the detail enhancement and edge enhancement images are fused;
[0014] S5: The image after the detail enhancement and edge enhancement images are fused is input to the post-processing module. The post-processing module uses an adaptive image contrast adjustment method to optimize the contrast and brightness distribution of the image, thereby obtaining the final output image.
[0015] The adaptive image contrast adjustment method specifically includes: regularizing the brightness of the image by adjusting the dynamic range of image grayscale or processing the image histogram for the global image or regional image blocks, thereby enhancing the image contrast; ensuring that the brightness transition of the final output image is natural and continuous, with high image contrast, and avoiding the generation of edge artifacts, which conforms to the observation and cognition habits of medical personnel for pathological images.
[0016] Among them, the original image acquired by the fistula endoscope is called I1; the preprocessed image is called I2; and the detail-enhanced image is called I3. 2d Edge enhancement images are called I 2e The image after fusing the detail enhancement and edge enhancement images is called the fused image I3; the final output image is called I4.
[0017] Furthermore, in S2, the detail enhancement network module extracts and enhances the fine structure of the lesion area, including the texture of the fistula wall and the details of the inflammatory area, while reducing the interference of noise on the detail information; the edge enhancement network module extracts and enhances the edge information of the lesion area, including the boundary between the lesion and the surrounding tissue of the fistula wall and the boundary of the inflammatory area, while solving the problems of edge blurring and breakage.
[0018] The detail enhancement network module improves the detail resolution of lesion areas by combining multi-scale convolutional layers, noise suppression layers, attention mechanisms, and residual connection layer components.
[0019] The edge enhancement network module comprises a multi-directional edge detection layer, an edge repair layer, and an edge refinement layer. Since edges in anal fistula endoscopy images have different directions, a multi-directional edge detection layer is introduced to extract edge information and fuse the multi-directional edge maps. In anal fistula endoscopy images, edges are broken due to blurring or noise; therefore, an edge repair layer is introduced to repair the image edges, filling in broken edges and enhancing edge continuity. The edge refinement layer is used to optimize edge clarity and accuracy.
[0020] Furthermore, in step S4, the fusion network module enhances the detail of image I. 2d and edge enhancement image I 2e Perform fusion processing to obtain the fused image I3;
[0021] The fusion network module includes: convolutional layers, ReLU activation function, CBAM attention mechanism, and Sigmoid activation function.
[0022] Furthermore, the fusion network module includes training of the fusion network, and the training of the fusion network requires setting a total loss function, which includes a content loss function, a structural similarity loss function, and an edge similarity loss function.
[0023] The content loss function is used to measure the pixel difference between the enhanced image and the original image, so that the fused image retains the details of the lesion area in the original image to the greatest extent.
[0024] By setting a structural similarity loss function, the structural similarity between the enhanced image and the original image is measured, enabling the fusion network to preserve the image structure while enhancing details and improving the detail resolution of the lesion area;
[0025] By setting an edge similarity loss function, the pixel-level difference between the edges of the fused image and the original image is measured, so that the edges of the fused image are highly consistent with the edges of the original image. This can not only repair the edge breakage problem caused by image blurring or noise interference and strengthen the continuity of the edges, but also improve the clarity of the edges, so that doctors can more clearly observe the boundary of the lesion area, the path of the fistula wall, and the boundary of the inflammatory area.
[0026] The total loss function is used to balance the losses of different types of loss functions.
[0027] A medical image enhancement system for an anal fistula probing device, the system comprising:
[0028] The preprocessing module is used to perform color correction on the original image I1 acquired by the fistula endoscope to obtain the preprocessed image I2;
[0029] The detail enhancement network module is used to enhance the details of the preprocessed image I2 to obtain the detail-enhanced image I. 2d ;
[0030] The edge enhancement network module is used to enhance the edges of the preprocessed image I2 to obtain the edge-enhanced image I. 2e ;
[0031] The fusion network module is used to fuse detail enhancement images and edge enhancement images to obtain the fused image I3;
[0032] The post-processing module is used to adjust the contrast and brightness of the fused image I3 to obtain the final output image I4.
[0033] (III) Beneficial Effects
[0034] Combining all the above technical solutions, the beneficial effects of this invention are as follows:
[0035] The preprocessing module provided by this invention performs color correction on the original image obtained by the fistula endoscope to obtain a preprocessed image; the enhancement and fusion module performs detail enhancement and edge enhancement on the preprocessed image respectively, and fuses the detail-enhanced image and the edge-enhanced image to obtain a fused image; the postprocessing module is used to adjust the contrast and brightness of the fused image to obtain the final output image.
[0036] This invention significantly improves imaging performance using existing fistula endoscopes without relying on complex hardware. It provides doctors with high-quality, clear image information, thereby assisting them in accurate diagnosis and treatment and reducing errors and risks during the diagnosis and treatment process. Attached Figure Description
[0037] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure;
[0038] Figure 1 This is a schematic diagram of a medical image enhancement system for an anal fistula endoscope provided in an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram illustrating the structural principle of the detail enhancement network module provided in this embodiment of the invention;
[0040] Figure 3 This is a schematic diagram illustrating the structural principle of the edge enhancement network module provided in an embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of the structural principle of the fusion network module provided in an embodiment of the present invention.
[0042] In the diagram: 101, Preprocessing module; 2, Enhanced fusion module; 201, Detail enhancement network module; 202, Edge enhancement network module; 203, Fusion network module; 301, Postprocessing module. Detailed Implementation
[0043] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0044] Example
[0045] like Figure 1 As shown in the figure, an embodiment of the present invention provides a medical image enhancement method for an anal fistula endoscope. This method is composed of a deep learning network, which includes a preprocessing module 101, an enhancement and fusion module 2, and a post-processing module 301. The method includes the following steps:
[0046] S1: The raw image acquired by the fistula endoscope is input to the preprocessing module 101, where color correction is performed using a white balance correction method to obtain the preprocessed image;
[0047] The white balance correction method specifically includes: calculating the average value of each color channel (R, G, B) in the original image, and calculating the correction gain coefficient of each channel based on the average value; then, multiplying the R, G, B components of each pixel in the image by the corresponding correction gain coefficient, and normalizing the results; finally, outputting the corrected image as the preprocessed image.
[0048] S2: The preprocessed image is input to the detail enhancement network module 201 in the enhancement fusion module 2 for detail enhancement, and a detail-enhanced image is obtained;
[0049] In step S2 of this embodiment of the invention, as follows Figure 2As shown, the detail enhancement network module 201 specifically includes multi-scale convolutional layers, noise suppression layers, attention mechanisms, and residual connection layers. It can extract and enhance the fine structures of lesion areas, such as the texture of the fistula wall and details of the inflammatory area, while reducing noise interference with detail information. Specifically, the multi-scale convolutional layers use convolutional layers with different kernel sizes (3×3, 5×5, and 7×7) to extract multi-scale features of the image, capturing detailed information of lesion areas of different sizes. The noise suppression layer uses a wavelet transform-based method to suppress noise and retain key detail information. The attention mechanism adopts SENet, ensuring computational efficiency while dynamically adjusting the weights of each channel through SENet's channel attention module. Channels related to lesions such as fistula wall texture and inflammatory cell distribution are given higher weights, enhancing the expressiveness of these key features. Residual connections add the input features to the processed features, avoiding information loss and improving the training stability of the network. Through the collaborative work of these modules, the detail enhancement network module 201 can significantly improve the quality of detail features in lesion areas, providing a high-quality image foundation for subsequent analysis and diagnosis. In addition, the module's lightweight design ensures computational efficiency, enabling it to run efficiently on conventional computing devices and has good clinical application value.
[0050] S3: The preprocessed image is input to the edge enhancement network module 202 in the enhancement fusion module 2 for edge enhancement, and an edge-enhanced image is obtained;
[0051] In step S3 of this embodiment, as follows Figure 3As shown, the edge enhancement network module 202 specifically includes a multi-directional edge detection layer, an edge repair layer, and an edge refinement layer. It can extract and enhance edge information of the lesion area, such as the boundary between the fistula wall and surrounding tissue, and the boundary of the inflammatory area, while simultaneously addressing edge blurring and breakage. The multi-directional edge detection layer uses multi-directional convolution kernels (0°, 45°, 90°, 135°) to extract edge information in different directions and fuses the multi-directional edge maps. The edge repair layer is constructed from a residual dense network composed of residual dense blocks. When processing the edge map, it can keenly capture broken edge parts and, through a unique network structure and computational mechanism, accurately fill these breaks, thereby significantly enhancing the continuity of the edges. The advantage of the residual dense network lies in its ability to deeply mine and efficiently utilize the contextual information of the image. In complex edge repair tasks, with its powerful feature extraction and analysis capabilities, it achieves precise positioning and seamless repair of edge breaks, ensuring that the edges of the lesion area in the fistula endoscopic image are presented completely and clearly. The edge refinement layer consists of an upsampling layer and a feature extraction layer. The upsampling layer magnifies the low-resolution edge image, while the feature extraction layer further extracts edge features. Working together, they significantly optimize edge clarity and accuracy. This results in clearer and more accurate edges in the final output, helping doctors to more precisely determine the extent and boundaries of lesions. Further optimization of edge clarity and accuracy is achieved.
[0052] In this embodiment, the residual dense block used in the edge restoration layer consists of two 3×3 convolutions, one 1×1 convolution, and an LReLU activation function. The slope of the LReLU is set to 0.2 to avoid the vanishing negative gradient problem. To balance computational load and restoration quality, the edge restoration layer in this embodiment uses a total of 10 residual dense blocks. The upsampling layer of the edge refinement layer in this embodiment consists of a 4×4 transposed convolution and bilinear interpolation. The transposed convolution is used to quickly improve resolution, and the bilinear interpolation is used to smooth out jagged edges that may appear during feature map magnification, preserving edge details. The feature extraction layer of the edge refinement layer consists of an initial 3×3 convolution, two cascaded 3×3 convolutions (each followed by an LReLU activation function), and a 1×1 convolution, finally outputting a refined edge-enhanced image I. 2e .
[0053] S4: The detail enhancement image and the edge enhancement image are input to the fusion network module (203) in the enhancement fusion module 2 for fusion to obtain the image after the fusion of the detail enhancement image and the edge enhancement image;
[0054] In step S4 of this embodiment, as Figure 4The diagram shows the structure of the fusion network module 203. For each input image, an independent convolutional branch is set, and the ReLU activation function is used for feature extraction. Then, the features from the two branches are concatenated along the channel dimension to obtain fused features. A CBAM attention mechanism is introduced to analyze the feature map from the channel dimension. By learning the importance of features from different channels, higher weights are assigned to channels related to key information about anal fistula lesions, such as fistula wall texture and details of inflammatory areas. Finally, a Sigmoid activation function is used to limit the output values to a reasonable range, obtaining the fused enhanced image I3. In this embodiment, the convolutional layer size used in the fusion network module 203 is 3×3.
[0055] Define the loss function of this invention:
[0056] Content loss L con :
[0057]
[0058] Where H represents the height of the image; W represents the width of the image; I1 is the original image acquired by the fistula endoscope; and I3 represents the image with enhanced detail and edge enhancement effects.
[0059] Structural similarity loss L SSIM :
[0060] L SSIM =1-SSIM(I3,I1)(2)
[0061]
[0062] in, and These are the mean values of the fused enhanced image and the original image, respectively. and These are the variances of the fused enhanced image and the original image, respectively. C1 and C2 represent the covariance between the fused enhanced image and the original image; C1 and C2 are constants set to avoid the denominator being zero.
[0063] Edge similarity loss L edge :
[0064]
[0065] Canny represents Canny edge detection.
[0066] Total loss function:
[0067] L total =λ0L con +λ1L SSIM +λ2L edge(5)
[0068] Where λ0, λ1 and λ2 are the hyperparameters in the network, λ0 = 1, λ1 = 0.5 and λ2 = 0.4 respectively.
[0069] The purpose of content loss is to measure the pixel differences between the fused image and the original image, ensuring that the overall color, brightness, and contrast do not shift significantly. This loss prevents the addition of excessive artifacts or the generation of noise that does not match the original data during enhancement, preserving the overall features of key lesion areas in medical images.
[0070] The purpose of structural similarity loss is to measure the structural similarity between the fused image and the original image, making the fused image as close as possible to the original image in terms of contrast, brightness, and texture structure. This loss ensures that lesion areas (such as fistula walls and inflammatory areas) do not suffer structural loss or distortion due to over-enhancement, and to some extent compensates for the local blurring caused by pixel-level loss, thereby improving the overall readability and clinical diagnostic value of the image.
[0071] The purpose of edge similarity loss is to measure the consistency of edge features between the fused image and the original image. Specifically, it calculates the pixel-level differences between the resulting edge images after performing Canny edge detection on both. This loss can suppress structural degradation caused by image blurring or loss of key details, while also repairing edge breaks caused by noise interference or insufficient contrast. Guided by edge similarity loss, lesion areas (such as fistula wall paths and inflammatory boundaries) are more clearly distinguishable in the enhanced image, helping doctors to more accurately determine the extent and morphology of the lesion area, thereby improving diagnostic accuracy.
[0072] The total loss function takes into account multiple objectives and balances different types of losses, enabling the network to generate high-quality images that better meet clinical diagnostic needs and are highly consistent with expectations.
[0073] S5: The image after the detail enhancement and edge enhancement images are fused is input to the post-processing module 301. This module uses an adaptive histogram equalization method to optimize the contrast and brightness distribution of the image, thereby obtaining the final output image.
[0074] The adaptive image contrast adjustment method specifically includes: First, dividing the image into multiple smaller image blocks, specifically uniformly dividing it into several 8×8 pixel image blocks; then, calculating the local histogram for each image block and performing local histogram equalization based on the histogram to enhance the contrast of that area; to avoid over-enhancement or noise amplification in certain areas, limiting the enhancement amplitude of each image block to ensure the balance and rationality of the enhancement effect; during the processing, using bilinear interpolation to smoothly blend adjacent image blocks to ensure a natural and continuous transition in image brightness, avoiding edge artifacts or abrupt brightness differences; finally, the image after adaptive image contrast adjustment is used as the final output image.
[0075] Among them, the original image acquired by the fistula endoscope is called I1; the preprocessed image is called I2; and the detail-enhanced image is called I3. 2d Edge enhancement images are called I 2e The image after fusing the detail enhancement and edge enhancement images is called the fused image I3; the final output image is called I4.
[0076] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention and within the spirit and principles of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A medical image enhancement method for a endoscopic device used in the treatment of anal fistula, characterized in that, The method includes the following steps: S1: The raw images acquired by the fistula endoscope are input to the preprocessing module, and the preprocessed images are obtained through white balance correction. The white balance correction method specifically includes: calculating the average value of each color channel (R, G, B) in the original image, and calculating the correction gain coefficient of each channel based on the average value; then, multiplying the R, G, B components of each pixel in the image by the corresponding correction gain coefficient to achieve color correction of the image; and finally obtaining the pre-processed image. S2: The preprocessed image is input to the detail enhancement network module in the enhancement fusion module for detail enhancement to obtain a detail-enhanced image; In S2, the detail enhancement network module extracts and enhances the fine structure of the lesion area, including the texture of the fistula wall and the details of the inflammatory area, while reducing the interference of noise on the detail information; the edge enhancement network module extracts and enhances the edge information of the lesion area, including the boundary between the lesion of the fistula wall and the surrounding tissue, and the boundary of the inflammatory area, while solving the problems of edge blurring and breakage. The detail enhancement network module improves the detail resolution of lesion areas by combining multi-scale convolutional layers, noise suppression layers, attention mechanisms, and residual connection layer components. S3: The preprocessed image is input to the edge enhancement network module in the enhancement fusion module for edge enhancement to obtain an edge-enhanced image; In step S3, the edge enhancement network module extracts and enhances the edge information of the lesion area, including the boundary between the fistula wall and surrounding tissues, and the boundary of the inflammatory area, while simultaneously addressing the issues of blurred and broken edges. The edge enhancement network module comprises a multi-directional edge detection layer, an edge repair layer, and an edge refinement layer. Since edges in anal fistula endoscopy images have different directions, a multi-directional edge detection layer is introduced to extract edge information and fuse the multi-directional edge maps. To address the issue of broken edges in anal fistula endoscopy images due to blurring or noise, an edge repair layer constructed from a residual dense network composed of residual dense blocks is introduced to repair the image edges, filling in broken edges and enhancing edge continuity. The residual dense block consists of two 3×3 convolutional layers, one 1×1 convolutional layer, and a ReLU activation function; the edge repair layer contains a total of 10 residual dense blocks. The edge refinement layer is used to optimize the clarity and accuracy of the edges. S4: The detail enhancement image and the edge enhancement image are input into the fusion network module in the enhancement fusion module for fusion to obtain the image after the detail enhancement and edge enhancement images are fused; In step S4, the fusion network module performs fusion processing on the detail enhancement image and the edge enhancement image to obtain a fused image; The fusion network module includes: convolutional layers, ReLU activation function, CBAM attention mechanism, and Sigmoid activation function; Furthermore, the fusion network module includes training of the fusion network, and training of the fusion network requires setting a total loss function, which includes a content loss function, a structural similarity loss function, and an edge similarity loss function. The content loss function is used to measure the pixel difference between the enhanced image and the original image, so that the fused image retains the details of the lesion area in the original image to the greatest extent. By setting a structural similarity loss function, the structural similarity between the enhanced image and the original image is measured, enabling the fusion network to preserve the image structure while enhancing details and improving the detail resolution of the lesion area; By setting an edge similarity loss function, the pixel-level difference between the edges of the fused image and the original image is measured, so that the edges of the fused image are highly consistent with the edges of the original image. This can not only repair the edge breakage problem caused by image blurring or noise interference and strengthen the continuity of the edges, but also improve the clarity of the edges, so that doctors can more clearly observe the boundary of the lesion area, the path of the fistula wall, and the boundary of the inflammatory area. The total loss function is used to balance the losses of different types of loss functions; S5: The image after the detail enhancement and edge enhancement images are fused is input to the post-processing module. The post-processing module uses an adaptive image contrast adjustment method to optimize the contrast and brightness distribution of the image, thereby obtaining the final output image. The adaptive image contrast adjustment method specifically includes: regularizing the brightness of the image by adjusting the dynamic range of image grayscale or processing the image histogram for the global image or regional image blocks, thereby enhancing the image contrast; ensuring that the brightness transition of the final output image is natural and continuous, with high image contrast, and avoiding the generation of edge artifacts, which is in line with the observation and cognition habits of medical personnel for pathological images. Among them, the original images acquired by the fistula endoscope are called The preprocessed image is called... ; Detail-enhanced images are called Edge enhancement image is called The image obtained by fusing the detail enhancement and edge enhancement images is called the fused image. The final output image is called .
2. A medical image enhancement system for a endoscopic device for treating anal fistula, characterized in that, The system implements a medical image enhancement method for a endoscopic device for treating anal fistulas as described in claim 1, the system comprising: The preprocessing module is used to process the raw images acquired by the fistula endoscope. Perform color correction to obtain the pre-processed image. ; Detail enhancement network module, used for preprocessing images Perform detail enhancement to obtain a detail-enhanced image. ; Edge enhancement network module for preprocessing images Perform edge enhancement to obtain the edge-enhanced image. ; The fusion network module is used to fuse detail enhancement images and edge enhancement images to obtain a fused image. ; The post-processing module is used to process the fused image. Adjust the contrast and brightness to obtain the final output image. .