Medical image enhancement method and system for anal fistula microscopic detection device
By optimizing anal fistula endoscopic images through a multi-stage processing method, image quality issues were resolved, achieving high-quality image enhancement effects and supporting doctors in accurate diagnosis and treatment.
Patent Information
- Application Number
- CN202511116695.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-11
AI Technical Summary
The image quality of existing fistula endoscopes is affected by factors such as uneven lighting, tissue fluid 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 adopted, including white balance correction, detail enhancement network, edge enhancement network and fusion network, combined with multi-scale convolution, noise suppression, multi-directional edge detection and adaptive image contrast adjustment to optimize image quality.
It significantly improves the imaging effect of anal fistula endoscopy, providing high-quality, clear image information to assist doctors in accurate diagnosis and treatment, and reduce the risks of diagnosis and treatment.
Smart Images

Figure CN120976084A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image processing, in particular to a medical image enhancement method and system for a treatment anoscope exploration device. BACKGROUND
[0002] An anal fistula is a common perianal disease, and its treatment effect is highly dependent on the accurate judgment of the preoperative fistula shape, running path and related inflammatory area. Anoscopy examination as an imaging method under direct vision has been widely used in clinical diagnosis and intraoperative exploration. However, in actual application, the image quality collected by anoscopy is often affected by various factors, such as uneven illumination caused by narrow cavity, liquid or mucosa reflection on the surface of the tissue, sensor noise interference during image acquisition, etc. These problems directly lead to color distortion, blurred details, unclear edge contours and other defects in the image, which seriously affect the identification and judgment of the lesion site (such as fistula channel, branch, internal orifice and inflammatory diffusion area) by doctors, and further increase the risk of preoperative evaluation and surgical operation.
[0003] At present, in order to improve the visual quality of anoscopy image, traditional image enhancement techniques such as histogram equalization, contrast stretching, filter denoising and other methods have been tried in research. However, most of these methods are general algorithms, lack the optimization ability for the special structure characteristics of medical images, and often have the following problems in the enhancement process: uneven enhancement; noise amplification; structure damage; weak generalization ability. SUMMARY
[0004] (I) Technical problems solved
[0005] The present application provides a medical image enhancement method and system for an anoscope exploration device, which 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 raised in the above background technology.
[0006] (II) Technical solutions
[0007] In order to achieve the above purpose, the present application specifically adopts the following technical solutions:
[0008] A medical image enhancement method for a treatment anoscope exploration device, the method comprising the following steps:
[0009] S1: The original image collected by anoscopy is input to the pre-processing module, and a pre-processed image is obtained by a white balance correction method;
[0010] The white balance correction method specifically comprises: 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, the R, G, B components of each pixel in the image are multiplied by the corresponding correction gain coefficient respectively, so as to realize color correction of the image; and finally, a pre-processed image is obtained;
[0011] S2: The pre-processed image is input into a detail enhancement network module in the enhancement fusion module for detail enhancement, to obtain a detail enhancement image;
[0012] S3: The pre-processed image is input into an edge enhancement network module in the enhancement fusion module for edge enhancement, to obtain an edge enhancement image;
[0013] S4: The detail enhancement image and the edge enhancement image are input into a fusion network module in the enhancement fusion module for fusion, to obtain an image after fusion of the detail enhancement and the edge enhancement image;
[0014] S5: The image after fusion of the detail enhancement and the edge enhancement image is input into a post-processing module, and the post-processing module adopts an adaptive image contrast adjustment method to optimize the contrast and brightness distribution of the image, so as to obtain a final output image;
[0015] The adaptive image contrast adjustment method specifically comprises: for a global image or a divided regional image block, the brightness of the image is regularized by an image gray dynamic range adjustment method or an image histogram processing method, so as to enhance the contrast of the image; the natural and continuous brightness transition of the final output image is ensured, the contrast of the image is high, and the generation of edge artifacts is avoided, which conforms to the observation and cognitive habits of medical personnel on pathological images.
[0016] Among them, the original image collected by the anal fistula scope is called ; the pre-processed image is called ; the detail enhancement image is called ; the edge enhancement image is called ; the image after fusion of the detail enhancement and the edge enhancement image is called a fusion image ; and the final output image is called .
[0017] Further, 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 line between the fistula wall lesion and the surrounding tissue and the boundary of the inflammatory area, while solving the problems of edge blur and fracture;
[0018] The detail enhancement network module improves the detail resolution of the lesion area through the combination of multi-scale convolutional layers, noise suppression layers, attention mechanisms, and residual connection layer components.
[0019] The edge enhancement network module includes multi-directional edge detection layers, edge repair layers, and edge refinement layers. Since the edges in the anal fistula mirror image have different directions, a multi-directional edge detection layer is introduced to extract edge information and fuse multi-directional edge maps. In the anal fistula mirror image, the edges are broken due to blurring or noise, so an edge repair layer is introduced to repair the edges of the image, fill the broken edges, and enhance the continuity of the edges. The edge refinement layer is used to optimize the clarity and accuracy of the edges.
[0020] Further, in the S4, the fusion network module fuses the detail enhanced image and the edge enhanced image to obtain a fusion image .
[0021] The fusion network module includes convolutional layers, ReLU activation functions, CBAM attention mechanisms, and Sigmoid activation functions.
[0022] Further, the fusion network module includes the 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 fusion image retains the details of the lesion area in the original image to the greatest extent.
[0024] By setting the structural similarity loss function, the structural similarity between the enhanced image and the original image is measured, so that the fusion network can retain the image structure while enhancing the details, improving the detail resolution of the lesion area.
[0025] By setting the edge similarity loss function, the pixel-level difference between the edge of the fusion image and the edge of the original image is measured, so that the edge of the fusion image is highly consistent with the edge of the original image. Not only can it repair the edge breakage problem caused by image blurring or noise interference and strengthen the continuity of the edge, but also can improve the clarity of the edge, so that doctors can more clearly observe the boundary of the lesion area, the path of the fistula wall, and the boundary of the inflammation 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 a anal fistula mirror exploration device, the system comprises:
[0028] The preprocessing module is used to process the raw images acquired by the fistula endoscope. Perform color correction to obtain the pre-processed image. ;
[0029] Detail enhancement network module, used for preprocessing images Perform detail enhancement to obtain a detail-enhanced image. ;
[0030] Edge enhancement network module for preprocessing images Perform edge enhancement to obtain the edge-enhanced image. ;
[0031] The fusion network module is used to fuse detail enhancement images and edge enhancement images to obtain a fused image. ;
[0032] The post-processing module is used to process the fused image. Adjust the contrast and brightness to obtain the final output image. .
[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 a endoscopic device for treating anal fistulas 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. .
[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. It describes how an independent convolutional branch is set for each input image, and ReLU activation 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 enhanced fused image. 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 :
[0057] (1)
[0058] Where H represents the height of the image; W represents the width of the image; Original images captured by an anal fistula endoscope; This represents an image that combines detail enhancement and edge enhancement effects.
[0059] Structural similarity loss :
[0060] (2)
[0061] (3)
[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. Represents the covariance between the fused enhanced image and the original image; and It is a constant set to avoid the denominator being zero.
[0063] Edge similarity loss :
[0064] (4)
[0065] in, represent Edge detection.
[0066] Total loss function:
[0067] (5)
[0068] in, , and These are the hyperparameters in the network. =1, =0.5, =0.4.
[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 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 .
[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 (101), and the preprocessed images are obtained through the white balance correction method; 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 (201) in the enhancement fusion module (2) for detail enhancement to obtain a detail-enhanced image; S3: The preprocessed image is input to the edge enhancement network module (202) in the enhancement fusion module (2) for edge enhancement to obtain an edge-enhanced image; 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; S5: The image after the detail enhancement and edge enhancement images are fused is input to the post-processing module (301). The post-processing module (301) 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. The medical image enhancement method for a endoscopic device for treating anal fistulas according to claim 1, characterized in that, In S2, the detail enhancement network module (201) 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 (202) 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. The detail enhancement network module (201) improves the detail resolution of the lesion area by combining multi-scale convolutional layers, noise suppression layers, attention mechanisms and residual connection layer components; The edge enhancement network module (202) comprises a multi-directional edge detection layer, an edge repair layer, and an edge refinement layer. Since the edges in the anal fistula endoscope image have different directions, a multi-directional edge detection layer is introduced to extract edge information and fuse the multi-directional edge images. In the anal fistula endoscope image, the edges are broken due to blurring or noise, so an edge repair layer is introduced to repair the edges of the image, fill in the broken edges, and enhance the continuity of the edges. The edge refinement layer is used to optimize the clarity and accuracy of the edges.
3. The medical image enhancement method for a endoscopic device for treating anal fistulas according to claim 1, characterized in that, In step S4, the fusion network module (203) enhances the detail of the image. and edge enhancement images Perform fusion processing to obtain a fused image. ; The fusion network module (203) includes: a convolutional layer, a ReLU activation function, a CBAM attention mechanism, and a Sigmoid activation function.
4. The medical image enhancement method for a endoscopic device for treating anal fistulas according to claim 3, characterized in that, The fusion network module (203) includes the training of the fusion network. At the same time, 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. 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.
5. A medical image enhancement system for a endoscopic device for treating anal fistulas, characterized in that, The system implements a medical image enhancement method for a endoscopic device for treating anal fistulas as described in any one of claims 1-3, the system comprising: The preprocessing module (101) 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 (201) for preprocessing images Perform detail enhancement to obtain a detail-enhanced image. ; Edge enhancement network module (202) for preprocessing images Perform edge enhancement to obtain the edge-enhanced image. ; The fusion network module (203) is used to fuse the detail enhancement image and the edge enhancement image to obtain the fused image. ; Post-processing module (301) is used for processing the fused image. Adjust the contrast and brightness to obtain the final output image. .
Citation Information
Patent Citations
Infrared thermal imaging system image detail enhancing and noise inhibiting method
CN105957030A
Underwater image color enhancement method based on potential low-rank representation and image fusion
CN111968054A
Remote sensing image classification method and system
CN117422936A
Adaptive image enhancement camera
CN118400620A
Underwater image enhancement method based on color correction and brightness channel optimization and related device
CN118505579A