An adaptive endoscope image defogging method and device and a storage medium

CN122928673APending Publication Date: 2026-10-16BEIJING GAOXIN HUITONG MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610916644.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

单一卷积神经网络依赖局部卷积核运算,难以有效建模整图大范围、非均匀分布的雾化干扰特征,全局建模能力缺失;常规Transformer网络依靠全局自注意力机制,计算复杂度高、推理延迟大,难以满足内窥镜嵌入式终端术中实时处理的硬件部署需求

Benefits of technology

[0022] Therefore, the adaptive endoscopic image dehazing method, device, and computer-readable storage medium provided by this invention, relying on the principles of medical optical imaging and the actual imaging characteristics of endoscopes, innovatively employs a distance-free fog depth inversion mechanism and an improved dark channel algorithm for masking bright tissues. It constructs a medical-specific four-channel physical prior input, solving the problem of poor scene adaptability of traditional physical models. A CNN-Transformer dual-stream coding architecture with gated interaction is designed to achieve deep complementary fusion of local lesion details and global dynamic fogging interference features, balancing imaging accuracy and lightweight deployment requirements. Simultaneously, a pixel-level gradient adaptive dehazing weight mechanism is constructed to adapt to instantaneous irregular fogging changes during surgery, and a lesion-differentiated composite loss function is used to train the deep learning network, ensuring that the color of normal tissue conforms to clinical standards while protectively preserving abnormal lesion features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928673A_ABST
    Figure CN122928673A_ABST
Patent Text Reader

Abstract

The application provides a kind of self-adapting endoscope image defogging method, device and storage medium, relies on medical optical imaging principle and endoscope actual imaging characteristics, original no ranging fog depth inversion mechanism and improved dark channel algorithm of highlight tissue shielding, constructs medical exclusive four-channel physical prior input, solves the problem of poor scene adaptability of traditional physical model;Design CNN-Transformer double-flow coding architecture with gate interaction, realize the deep complementary fusion of local lesion details and global dynamic fogging interference characteristics, and consider the imaging accuracy and lightweight deployment requirements;At the same time, construct a pixel-level gradient adaptive defogging weight mechanism, adapt to the instantaneous irregular fog changes in operation, and use lesion differentiation composite loss function to train the deep learning network, while ensuring the normal tissue color to match the clinical standard, the lesion abnormal features are protected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical image processing and computer vision technology, and in particular to an adaptive endoscopic image dehazing method, apparatus and computer-readable storage medium. Background Technology

[0002] During minimally invasive endoscopic surgery, routine procedures such as high-frequency electrocoagulation, tissue cutting, and wound cauterization continuously generate fine tissue dust and moisture within the surgical cavity. This causes image quality degradation in the intraoperative endoscopic images, including fogging, blurring, and reduced contrast. Furthermore, the unique imaging environment of the human body's closed cavities, coupled with the unidirectional illumination of the endoscope's cold light source, multiple scattering of light within the cavity, and significant differences in reflectivity among different human tissues, makes intraoperative images prone to uneven brightness, color shifts, and blurred textures. A fogged and blurred surgical field can obscure delicate lesion structures such as microvessels, mucosal folds, and tiny polyps, interfering with the surgeon's intraoperative identification and judgment, and increasing the difficulty and risk of the surgery.

[0003] Currently, dehazing methods for endoscopic images are mainly divided into two categories: traditional physical model algorithms and deep learning image enhancement algorithms. Both have significant shortcomings in practical application and cannot meet the needs of dynamic clinical surgery.

[0004] Traditional physical prior algorithms based on atmospheric scattering models, such as the dark channel prior algorithm, are all built upon assumptions about natural light in open outdoor scenes, the absence of high-brightness interference, and long-distance fog transmission. It is important to note that outdoor natural light is multi-directional and uniform scattering of ambient light, while endoscopic imaging relies on unidirectional strong light supplementation from a cold light source; the two have fundamentally different illumination geometry characteristics. Furthermore, outdoor scenes lack the high reflectivity of biological tissue, and the long-distance fog transmission assumption is completely different from the optical attenuation laws of close-range endoscopic imaging (the cavity distance is typically 3-10cm). Therefore, traditional physical models are not suitable for the special imaging environment of a closed, narrow endoscope cavity, directional strong light supplementation from a cold light source, close-range imaging, and the dense distribution of highly reflective tissue in the human body. In practical processing, traditional dark channel algorithms cannot distinguish between physiologically inherently bright tissues such as human fat and fascia and bright areas caused by fogging. This problem does not exist in outdoor scenes, but in endoscopic images, the normalized brightness of fat tissue can reach 0.85-0.95, which severely overlaps with the bright areas caused by fog. This makes traditional algorithms prone to overestimating transmittance and inaccurate atmospheric light values, ultimately resulting in clinically unacceptable consequences such as severe color distortion, excessive smoothing of mucosal texture, and loss of subtle lesions in the defogging endoscopic images. At the same time, the fixed and uniform parameters of traditional physical algorithms cannot adapt to the instantaneous and non-uniform changes in fogging interference concentration during surgery, and their adaptive ability to dynamic fog conditions is extremely poor.

[0005] Existing deep learning dehazing algorithms are mostly designed for training in natural outdoor scenes, and the feature extraction logic of general-purpose networks has low adaptability to the laws of medical imaging. Single convolutional neural networks rely on local convolutional kernel operations, which makes it difficult to effectively model the large-scale, non-uniformly distributed fogging interference features of the entire image, and lacks global modeling capabilities; conventional Transformer networks rely on global self-attention mechanisms, which have high computational complexity and large inference latency, making it difficult to meet the hardware deployment requirements of real-time processing in endoscopic embedded terminals during surgery.

[0006] While a few dual-stream network structures combining CNN and Transformer exist in existing technologies, they generally suffer from several technical defects: First, the two types of networks only use a simple feature concatenation and superposition method without a dedicated cross-branch interactive filtering mechanism, resulting in severe feature redundancy and low utilization of effective features; Second, they do not introduce medical-specific physical prior constraints, and the network training lacks scene-specific prior guidance, leading to poor correction accuracy for haze and weak fog interference, and generally resulting in overcorrection of haze and incomplete removal of dense fog; Third, they lack medical color fidelity constraint logic, and the uniform image enhancement method will destroy the inherent color of human body cavity tissues, while also covering abnormal color features of lesions, which is not conducive to clinical lesion identification.

[0007] A search of existing publicly available patents and technical literature reveals that current improvements to endoscopic image dehazing primarily focus on minor modifications to traditional physical model parameters or lightweight optimization of general network structures. These solutions fail to address the four core industry pain points: lack of physical ranging capabilities in endoscopy, strong interference from physiologically bright tissues, instantaneous non-uniform dynamic fogging during surgery, and the need for protective preservation of lesion color features. Therefore, existing technologies have significant room for substantial improvement. Summary of the Invention

[0008] The present invention aims to provide an adaptive endoscopic image dehazing method, apparatus, and computer-readable storage medium that overcomes or at least partially solves the above-mentioned problems.

[0009] To achieve the above objectives, the technical solution of the present invention is specifically implemented as follows: The first aspect of the present invention provides an adaptive endoscopic image dehazing method, comprising: S1. Perform illumination compensation and noise reduction preprocessing on the original hazy image of the endoscope to obtain a standardized RGB image; S2. Construct a medical-specific four-channel physical prior feature map based on the standardized RGB image, including: removing physiologically bright tissue interference through a dual-threshold screening mechanism based on pixel brightness statistical distribution; calculating improved dark channel features and local block atmospheric light features; solving pixel-level fog depth by combining transmittance inversion and generating a scattering coefficient map adapted to the endoscope cavity environment; and stitching the scattering coefficient map, the improved dark channel features, and the local block atmospheric light features with the standardized RGB image to obtain four-channel input features. S3. Input the four-channel input features into a lightweight dual-stream encoder, extract local tissue fine texture features through a multi-scale dilated convolutional CNN branch, model global fogging interference distribution features through a lightweight axial Transformer branch, and achieve cross-branch interactive fusion of dual-stream features through an attention gating mechanism. S4. Based on the pixel neighborhood gray-level variance and the first and second thresholds determined according to the gray-level distribution law of clinical endoscopy images, the image is divided into dense fog area, thin fog gradient area and fog-free area. The gradient dynamic weight mechanism is used to allocate the differentiated defogging intensity to complete the adaptive reconstruction of the fog-free image. S5. Input the reconstructed image into a deep learning network that has been pre-trained and optimized using medical color mean loss, texture loss and physical residual loss. The abnormal color features of the lesion area are preserved through the lesion color exemption mechanism set in the network, and a clear endoscopic image is output.

[0010] Optionally, the formula for calculating the scattering coefficient map is:

[0011] Where α is the intensity coefficient of the endoscope light source, and β is the attenuation coefficient of the human body cavity tissue medium. The fog depth is at the pixel level and is obtained by inverting the image transmittance.

[0012] Optionally, the value range of α is 1.0 to 1.3; and the value range of β is 0.15 to 0.25.

[0013] Optionally, the dual-threshold screening mechanism sets a first screening threshold and a second screening threshold. The first screening threshold and the second screening threshold are determined based on the inherent distribution law of pixel brightness in normal tissues of medical endoscopes, and are used to distinguish between physiological high-brightness areas and fogging interference high-brightness areas. The first screening threshold T1=0.85 and the second screening threshold T2=0.95.

[0014] Optionally, the lightweight axial Transformer employs an axial decomposition attention mechanism, decomposing the global self-attention into a cascade of two one-dimensional attentions, horizontal and vertical, thus optimizing the computational complexity to [value missing]. It is configured with 4 layers of attention coding, a single-head attention structure and a 0.5-channel compression factor.

[0015] Optionally, dynamic gradient dehazing weights The calculation formula is:

[0016] in, The grayscale variance of the pixel neighborhood. For the first threshold, This is the second threshold.

[0017] Optionally, the first threshold The second threshold is 0.15. It is 0.45.

[0018] Optionally, the composite loss function is:

[0019] in, To address the KL divergence color loss based on the standard tissue color map of medical endoscopes, a standard RGB threshold range for normal tissues in human cavities is pre-defined, and a lesion color exemption mechanism is set. Image texture gradient loss; This represents the residual loss of the physical model.

[0020] A second aspect of the present invention provides an adaptive endoscopic image dehazing device, comprising: The preprocessing module is used to perform illumination compensation and noise reduction preprocessing on the original hazy image of the endoscope to obtain a standardized RGB image; The physical prior construction module is used to construct a medical-specific four-channel physical prior feature map based on the standardized RGB image. This includes: removing physiologically bright tissue interference through a dual-threshold screening mechanism based on the statistical distribution of pixel brightness; calculating improved dark channel features and local block atmospheric light features; solving pixel-level fog depth by combining transmittance inversion and generating a scattering coefficient map adapted to the endoscopic cavity environment; and stitching the scattering coefficient map, the improved dark channel features, and the local block atmospheric light features with the standardized RGB image to obtain four-channel input features. The dual-stream encoding module is used to input the four-channel input features into a lightweight dual-stream encoder, extract local tissue fine texture features through a multi-scale dilated convolutional CNN branch, model global fogging interference distribution features through a lightweight axial Transformer branch, and realize cross-branch interactive fusion of dual-stream features through an attention gating mechanism. The adaptive reconstruction module is used to divide the image into a dense fog region, a light fog gradient region, and a fog-free region based on the pixel neighborhood gray-level variance and a first threshold and a second threshold determined according to the gray-level distribution law of clinical endoscope images. It uses a gradient dynamic weighting mechanism to allocate differentiated defogging intensity and complete the adaptive reconstruction of the fog-free image. The deep learning image correction module is used to input the reconstructed image into a deep learning network that has been pre-trained and optimized using medical color mean loss, texture loss and physical residual loss. The abnormal color features of the lesion area are preserved through the lesion color exemption mechanism set in the network, and a clear endoscopic image is output.

[0021] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described adaptive endoscopic image dehazing method.

[0022] Therefore, the adaptive endoscopic image dehazing method, device, and computer-readable storage medium provided by this invention, relying on the principles of medical optical imaging and the actual imaging characteristics of endoscopes, innovatively employs a distance-free fog depth inversion mechanism and an improved dark channel algorithm for masking bright tissues. It constructs a medical-specific four-channel physical prior input, solving the problem of poor scene adaptability of traditional physical models. A CNN-Transformer dual-stream coding architecture with gated interaction is designed to achieve deep complementary fusion of local lesion details and global dynamic fogging interference features, balancing imaging accuracy and lightweight deployment requirements. Simultaneously, a pixel-level gradient adaptive dehazing weight mechanism is constructed to adapt to instantaneous irregular fogging changes during surgery, and a lesion-differentiated composite loss function is used to train the deep learning network, ensuring that the color of normal tissue conforms to clinical standards while protectively preserving abnormal lesion features. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart of the adaptive endoscopic image dehazing method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the adaptive endoscopic image defogging device provided in an embodiment of the present invention. Detailed Implementation

[0025] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0026] The core of this invention lies in combining the actual imaging optical characteristics of endoscopes, the distribution patterns of clinical images, and the low computing power deployment conditions of embedded devices. It features a unique physical prior constraint mechanism adapted to medical scenarios, a gated interactive dual-stream feature fusion architecture, a pixel-level gradient adaptive fog control mechanism, and a lesion-differentiated color fidelity mechanism. While effectively removing intraoperative fogging interference, it accurately preserves the subtle lesion texture and abnormal lesion color features, adapts to dynamic non-uniform fog conditions during surgery, and meets the application requirements of high-precision, real-time imaging in clinical practice.

[0027] Figure 1 A flowchart of the adaptive endoscopic image dehazing method provided in an embodiment of the present invention is shown. See [link / reference]. Figure 1 The adaptive endoscopic image dehazing method provided in this embodiment of the invention includes: S1. Perform illumination compensation and noise reduction preprocessing on the original hazy image from the endoscope to obtain a standardized RGB image.

[0028] Specifically, this step is the image illumination compensation and noise reduction preprocessing step.

[0029] This invention acquires raw RGB hazy images of endoscopes during minimally invasive surgery and corrects uneven illumination issues such as center overexposure and edge dimming in endoscopic cold light source imaging using an adaptive brightness stretching mapping algorithm. Simultaneously, adaptive Gaussian filtering is employed to remove salt-and-pepper noise and impulse noise generated during intraoperative acquisition, unifying image quality standards to obtain standardized RGB images with balanced illumination and noise suppression. This eliminates the interference of illumination distortion and noise on subsequent physical parameter calculations and feature extraction.

[0030] S2. Construct a medical-specific four-channel physical prior feature map based on standardized RGB images, including: removing physiologically bright tissue interference through a dual-threshold screening mechanism based on pixel brightness statistical distribution, calculating improved dark channel features and local block atmospheric light features, solving pixel-level fog depth by combining transmittance inversion and generating a scattering coefficient map adapted to the endoscope cavity environment, and stitching the scattering coefficient map, improved dark channel features, local block atmospheric light features and standardized RGB images together to obtain four-channel input features.

[0031] Specifically, this step involves constructing a medical-specific four-channel physical prior feature map.

[0032] This invention calculates improved dark channel features, local atmospheric light features, and pixel-level scattering coefficient features based on a preprocessed standardized RGB image, and then concatenates these features with the original RGB image to form a four-channel feature input.

[0033] First, establish a standard atmospheric scattering model: ,in The fog map was observed. For the fog-free image to be recovered, Let A be the transmittance and A be the global atmospheric light. This invention obtains this through improved dark channel prior inversion. .

[0034] As an optional implementation of the present invention, the dual-threshold screening mechanism sets a first screening threshold and a second screening threshold. The first screening threshold and the second screening threshold are determined based on the inherent distribution law of pixel brightness in normal tissues of medical endoscopes, and are used to distinguish between physiological high-brightness areas and fogging interference high-brightness areas. The first screening threshold T1=0.85 and the second screening threshold T2=0.95.

[0035] In the improved dark channel feature calculation process, dual highlight screening thresholds T1=0.85 and T2=0.95 are set. These thresholds are determined based on the inherent distribution law of pixel brightness in normal tissues of medical endoscopes, which is a well-known inherent range in medical imaging. In clinical endoscopic images, the normalized brightness of physiologically bright tissues such as human fat and fascia is stably distributed in the range of 0.85~0.95, while the brightness of haze interference and mucosa and lesion tissues is lower than this range. Through this dual threshold screening logic, physiologically bright pixel interference can be accurately eliminated, and only pure haze features are retained for dark channel calculation, effectively avoiding the problems of highlight misjudgment and parameter estimation deviation in medical images caused by traditional dark channel algorithms.

[0036] The local atmospheric light features are estimated using an 8×8 block adaptive method, which calculates the atmospheric light intensity by selecting fog-free, bright areas of the image block by block. This replaces the traditional global atmospheric light solution method, adapts to the local illumination differences inside the cavity, improves the accuracy of physical parameter estimation, and solves the problem of poor global parameter adaptability.

[0037] As an optional embodiment of the present invention, the formula for calculating the scattering coefficient map is:

[0038] Where α is the intensity coefficient of the endoscope light source, and β is the attenuation coefficient of the human body cavity tissue medium. The fog depth is at the pixel level and is obtained by inverting the image transmittance.

[0039] As an optional implementation of this invention, α takes a value range of 1.0 to 1.3; β takes a value range of 0.15 to 0.25.

[0040] To address the inherent limitations of endoscopes in terms of their lack of physical ranging devices and the inability to obtain true fog depth values, this invention solves for pixel-level fog depth d(x) using a transmittance inversion method. The calculation formula is as follows:

[0041] Among them, the dielectric attenuation coefficient The preferred values ​​are 0.15 to 0.25, and the preferred light source intensity coefficient α is 1.0 to 1.3. The methods for determining the light source intensity coefficient α and the attenuation coefficient β include, but are not limited to: calibration based on the rated luminous flux and factory brightness gain curve of the endoscope light source, or obtaining them through multiple sets of optical attenuation experiments on simulated tissue smoke of known concentrations and regression fitting. The above parameters are all general optical attenuation parameter ranges for water vapor and tissue smoke in the human body's sealed cavities, falling within the scope of well-known physical principles in medical optics. Furthermore, they can be finely adjusted for specific endoscope models through calibration methods.

[0042] A pixel-level scattering coefficient map is constructed based on the above parameters:

[0043] It can accurately characterize the spatial non-uniform scattering distribution of atomization interference inside the endoscope cavity, providing precise medical optical prior constraints for the network.

[0044] By dimensionally stitching improved dark channel features, local atmospheric light features, scattering coefficient features, and standardized RGB images, a four-channel medical-specific prior feature map is obtained, which is different from the existing general three-channel input method without physical constraints.

[0045] S3. Input the four-channel input features into a lightweight dual-stream encoder, extract local tissue fine texture features through multi-scale dilated convolutional CNN branches, model global fogging interference distribution features through lightweight axial Transformer branches, and achieve cross-branch interactive fusion of dual-stream features through attention gating mechanism.

[0046] Specifically, this step is the parallel feature extraction step of the lightweight dual-stream encoder.

[0047] This invention sets up parallel and complementary CNN local feature branches and lightweight axial Transformer global feature branches to complete multi-dimensional differential feature extraction. The two types of branches perform their respective functions and complement each other, rather than being a simple superposition of existing technologies.

[0048] The CNN local detail branch employs a 3-layer multi-scale dilated convolutional structure with a kernel size of 3×3 and dilation rates of 1, 2, and 3 respectively, and a uniform output channel count of 64. This structure can capture tissue textures, mucosal folds, microvessels, and minute lesion details at different scales, ensuring that local fine features are not lost and compensating for the shortcomings of Transformer in local detail extraction.

[0049] As an optional implementation of this invention, the lightweight axial Transformer employs an axial decomposition attention mechanism, decomposing the global self-attention into a cascade of two one-dimensional attentions, horizontal and vertical, thus optimizing the computational complexity to... It is configured with 4 layers of attention coding, a single-head attention structure and a 0.5-channel compression factor.

[0050] The lightweight axial Transformer global branch employs an axial decomposition attention mechanism: decomposing the global self-attention into a cascade of two one-dimensional attentions, horizontal (Hor-izontal) and vertical (Vertical), thereby optimizing the computational complexity of traditional attention to O(N²). This significantly reduces memory usage and computational redundancy. The network employs a 4-layer attention coding layer and a single-head attention structure, with a channel compression coefficient of 0.5. This configuration is the optimal lightweight configuration for general medical embedded vision devices. While ensuring global fog modeling capabilities, it adapts to the deployment requirements of endoscope terminals with low computing power and high real-time performance, accurately capturing the global distribution characteristics of non-uniform dynamic fog interference in the entire image, and making up for the lack of global modeling capabilities of CNNs.

[0051] S4. Based on the pixel neighborhood gray-level variance and the first and second thresholds determined according to the gray-level distribution law of clinical endoscopic images, the image is divided into dense fog area, thin fog gradient area and fog-free area. The gradient dynamic weight mechanism is used to allocate the differentiated defogging intensity to complete the adaptive reconstruction of the fog-free image.

[0052] Specifically, this step is the attention-gated interaction and gradient-adaptive image reconstruction step.

[0053] This invention adds an original attention-gating interaction module, which intelligently filters and adaptively fuses the features of the dual-stream branch outputs, suppresses redundant noise features of each branch, strengthens effective complementary features, and achieves bidirectional deep fusion of local detail features and global fog features, overcoming the common industry problems of simple feature splicing, feature redundancy, and inefficient fusion in traditional dual-stream networks.

[0054] As an optional implementation of this invention, dynamic gradient dehazing weights The calculation formula is:

[0055] in, The grayscale variance of the pixel neighborhood. The first threshold, This is the second threshold.

[0056] As an optional implementation of this invention, the first threshold The second threshold is 0.15. It is 0.45.

[0057] This invention is based on pixel neighborhood grayscale variance The fog conditions are divided into zones, and the zoning thresholds are based on the inherent distribution law of grayscale in clinical endoscopic fog images. These zones are known imaging characteristic ranges: fog-free images have uniform pixel grayscale distribution and variance is generally lower than the first threshold (preferably 0.15); light fog images have small, uniform fluctuations in grayscale and variance is between the first threshold and the second threshold (preferably 0.45); dense fog images have chaotic grayscale fluctuations and extremely poor contrast, with variance higher than the second threshold.

[0058] Configure gradient dynamic dehazing weights based on partitioning results. This breaks through the limitations of existing binarization with fixed weights. The specific formula is as follows:

[0059] in, The first threshold is (preferably 0.15). The second threshold is (preferably 0.45). Substituting the threshold into the above formula yields:

[0060] Specifically: in dense fog areas, defogging is fully enabled to completely remove the heavy fog obscuring the image; in fog-free areas, defogging is disabled to preserve the original image's true details and colors, avoiding distortion caused by ineffective processing; in light fog areas, linear gradient weights are used for smooth transition, completely solving the problems of discontinuous processing effects and harsh edges in different areas, perfectly adapting to dynamic, instantaneous, and non-uniform fog conditions during surgery.

[0061] S5. Input the reconstructed image into a deep learning network that has been pre-trained and optimized using medical color mean loss, texture loss and physical residual loss. The abnormal color features of the lesion area are preserved through the lesion color exemption mechanism set in the network, and a clear endoscopic image is output.

[0062] Specifically, this step is an image correction step based on a deep learning model.

[0063] This invention inputs the reconstructed image into a pre-trained and optimized deep learning network, which then outputs the final dehazed endoscopic image. During the training phase, the deep learning network is constrained by a composite loss function consisting of medical color mean loss, texture loss, and physical residual loss, with the color loss including a lesion color exemption mechanism.

[0064] As an optional implementation of the present invention, the composite loss function is:

[0065] in, To address the KL divergence color loss based on the standard tissue color map of medical endoscopes, a standard RGB threshold range for normal tissues in human cavities is pre-defined, and a lesion color exemption mechanism is set. Image texture gradient loss; This represents the residual loss of the physical model.

[0066] The total loss function formula of this invention is:

[0067] The weighting ratio is strictly determined based on the priority of clinical applications of medical images. It takes color fidelity as the core diagnostic guarantee, detail preservation as the basis for lesion recognition, and physical consistency as the bottom line for imaging reliability. It belongs to the exclusive and reasonable weighting logic in the field of medical image enhancement, which is different from the general random weighting method.

[0068] Among them, color loss Based on the publicly available standard color spectrum of medical endoscopes, it pre-defines standard RGB color ranges for normal human tissues such as mucous membranes, blood vessels, and fat, and uses KL divergence to accurately measure image color deviation. Simultaneously, it innovates a lesion color exemption mechanism. Specifically, it calculates the Euclidean distance between the pixel's RGB value and the pre-define "normal tissue RGB mean vector." If the distance exceeds a preset threshold Tlesion (preferably 0.2), the pixel is determined to belong to a suspected lesion area. When calculating color loss, the loss weight of this area is reduced to 0.2 times the normal weight (or set to 0), thus avoiding forced correction of abnormal color features of lesions and preserving the unique color shift information of lesions, meeting the needs of accurate clinical lesion identification.

[0069] Texture loss By constraining image gradient features using the L2 paradigm, we comprehensively ensure that the fine textures of lesions such as microvessels, tiny protrusions, and mucosal folds are not lost. (Physical residual loss) This is used to constrain the consistency between the dehazed image and the optical scattering model of the endoscope cavity, avoiding problems such as excessive dehazing, model distortion, and image artifacts, and ensuring the authenticity and reliability of the imaging.

[0070] It is worth noting that all parameters in this invention are set based on the general principles of medical optics, the inherent parameters of endoscope equipment at the factory, and the inherent distribution patterns of clinical endoscope images. These are scenario-specific adaptation parameters that do not require calibration based on specific experimental datasets. They are compatible with mainstream medical endoscope imaging scenarios and embedded hardware deployment conditions, and have strong practicality and robustness.

[0071] Therefore, addressing the industry pain points of existing endoscopic dehazing technologies, such as reliance on general outdoor imaging assumptions, severe interference from physiologically bright tissues, poor adaptability to dynamic non-uniform fog conditions, easy loss of lesion color and details, and difficulty in hardware deployment, the adaptive endoscopic image dehazing method provided in this invention relies on medical optical imaging principles and the actual imaging characteristics of endoscopes. It features a unique distance-free fog depth inversion mechanism and an improved dark channel algorithm for shielding bright tissues, constructing a medical-specific four-channel physical prior input to solve the problem of poor scene adaptability of traditional physical models. It designs a CNN-Transformer dual-stream coding architecture with gated interaction to achieve deep complementary fusion of local lesion details and global dynamic fog interference features, balancing imaging accuracy and lightweight deployment requirements. At the same time, it constructs a pixel-level gradient adaptive dehazing weight mechanism to adapt to instantaneous irregular fog changes during surgery, and uses a lesion-differentiated composite loss function to train a deep learning network, ensuring that the color of normal tissue conforms to clinical standards while protectively preserving abnormal lesion features.

[0072] Figure 2 This diagram illustrates the structure of an adaptive endoscopic image defogging device provided in an embodiment of the present invention. This device applies the aforementioned method. The following is only a brief description of the structure of the adaptive endoscopic image defogging device; for other matters not covered herein, please refer to the relevant descriptions in the aforementioned adaptive endoscopic image defogging method. Figure 2 The adaptive endoscopic image dehazing device provided in this embodiment of the invention includes: The preprocessing module is used to perform illumination compensation and noise reduction preprocessing on the original hazy image of the endoscope to obtain a standardized RGB image; The physical prior construction module is used to construct a medical-specific four-channel physical prior feature map based on a standardized RGB image. This includes: removing physiologically bright tissue interference through a dual-threshold screening mechanism based on the statistical distribution of pixel brightness; calculating improved dark channel features and local block atmospheric light features; solving pixel-level fog depth by combining transmittance inversion and generating a scattering coefficient map adapted to the endoscope cavity environment; and stitching the scattering coefficient map, improved dark channel features, local block atmospheric light features, and standardized RGB image together to obtain four-channel input features. The dual-stream coding module is used to input four-channel input features into a lightweight dual-stream encoder, extract local tissue fine texture features through multi-scale dilated convolutional CNN branches, model global fogging interference distribution features through lightweight axial Transformer branches, and achieve cross-branch interactive fusion of dual-stream features through attention gating mechanism. The adaptive reconstruction module is used to divide the image into a dense fog region, a light fog gradient region, and a fog-free region based on the pixel neighborhood gray-level variance and a first threshold and a second threshold determined according to the gray-level distribution law of clinical endoscope images. It uses a gradient dynamic weighting mechanism to allocate differentiated defogging intensity and complete the adaptive reconstruction of the fog-free image. The deep learning image correction module is used to input the reconstructed image into a deep learning network that has been pre-trained and optimized using medical color mean loss, texture loss, and physical residual loss. The abnormal color features of the lesion area are preserved through the lesion color exemption mechanism set in the network, and a clear endoscopic image is output.

[0073] As an optional embodiment of the present invention, the formula for calculating the scattering coefficient map is:

[0074] Where α is the intensity coefficient of the endoscope light source, and β is the attenuation coefficient of the human body cavity tissue medium. The fog depth is at the pixel level and is obtained by inverting the image transmittance.

[0075] As an optional implementation of this invention, α takes a value range of 1.0 to 1.3; β takes a value range of 0.15 to 0.25.

[0076] As an optional implementation of this invention, the dual-threshold screening mechanism sets the first screening threshold T1=0.85 and the second screening threshold T2=0.95. The first screening threshold and the second screening threshold are determined based on the inherent distribution law of pixel brightness in normal tissues of medical endoscopes, and are used to distinguish between physiological high-brightness areas and fogging interference high-brightness areas.

[0077] As an optional implementation of this invention, the lightweight axial Transformer employs an axial decomposition attention mechanism, decomposing the global self-attention into a cascade of two one-dimensional attentions, horizontal and vertical, thus optimizing the computational complexity to... It is configured with 4 layers of attention coding, a single-head attention structure and a 0.5-channel compression factor.

[0078] As an optional implementation of this invention, dynamic gradient dehazing weights The calculation formula is:

[0079] in, The grayscale variance of the pixel neighborhood. The first threshold, This is the second threshold.

[0080] As an optional implementation of this invention, the first threshold The second threshold is 0.15. It is 0.45.

[0081] As an optional implementation of this invention, the composite loss function is:

[0082] in, To address the KL divergence color loss based on the standard tissue color map of medical endoscopes, a standard RGB threshold range for normal tissues in human cavities is pre-defined, and a lesion color exemption mechanism is set. Image texture gradient loss; This represents the residual loss of the physical model.

[0083] Therefore, the adaptive endoscopic image dehazing device provided in this embodiment of the invention relies on the principles of medical optical imaging and the actual imaging characteristics of endoscopes. It has created a unique distance-free fog depth inversion mechanism and an improved dark channel algorithm for shielding bright tissues. It constructs a medical-specific four-channel physical prior input to solve the problem of poor scene adaptability of traditional physical models. It designs a CNN-Transformer dual-stream coding architecture with gated interaction to achieve deep complementary fusion of local lesion details and global dynamic fogging interference features, taking into account both imaging accuracy and lightweight deployment requirements. At the same time, it constructs a pixel-level gradient adaptive dehazing weight mechanism to adapt to the instantaneous irregular fogging changes during surgery, and uses a lesion-differentiated composite loss function to train a deep learning network. While ensuring that the color of normal tissue conforms to clinical standards, it protectively preserves the abnormal features of lesions.

[0084] This invention overcomes the scene adaptability defects of traditional and general deep learning dehazing algorithms. The overall architecture is novel, logically rigorous, and highly practical. It is adapted to the real-time deployment requirements of embedded devices and has extremely high clinical application value and promotion prospects.

[0085] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described adaptive endoscopic image dehazing method.

[0086] Therefore, it can be seen that the present invention has the following beneficial effects compared with the prior art: 1. This invention sets up a fog depth inversion mechanism and a physiological bright tissue shielding mechanism adapted to endoscope range-free working conditions. It breaks the inherent assumption of traditional physical models based on outdoor scenes and solves the core industry pain points of traditional dark channel algorithms in medical images, such as misjudgment of bright tissues, inaccurate transmittance estimation, and large color deviation. The adaptability of the physical model far exceeds that of existing general improvement solutions.

[0087] 2. This invention adopts a lightweight dual-stream complementary architecture with gated interaction, which is not a simple reuse of existing dual-stream networks. It solves the defects of feature redundancy and inefficient fusion in traditional dual-stream networks through a bidirectional feature screening and fusion mechanism. At the same time, it takes into account the preservation of local subtle lesion textures and the ability to model global dynamic non-uniform fog conditions. While reducing network computing power overhead and adapting to embedded terminal deployment, it makes up for the technical shortcomings of incomplete feature extraction of single network structures.

[0088] 3. This invention sets up a pixel-level gradient adaptive fog condition control mechanism. Compared with the existing binarization fixed weight processing method, it can achieve a smooth transition of defogging intensity in the fog area, perfectly adapt to the actual clinical characteristics of instantaneous, irregular and non-uniform changes in fogging interference during surgery, and completely solve the problems of image fragmentation and poor dynamic adaptability of traditional technology.

[0089] 4. This invention establishes a lesion-differentiated color fidelity mechanism, which differs from the general image uniform color correction method. It takes into account both the color authenticity of normal tissue and the uniqueness of abnormal lesion features, fully meeting the needs of clinical diagnosis. It solves the problem of lesion color and detail loss that is common in existing dehazing algorithms, and has extremely high clinical applicability.

[0090] This invention can be applied to the removal of dynamic atomization interference (including smoke and water vapor) during surgery in various medical endoscopes such as laparoscopy, hysteroscopy, and otolaryngology endoscopy. It can restore the details of the surgical field and preserve the color of tissues. It can be embedded in the endoscope terminal device to complete real-time image optimization processing.

[0091] Therefore, this invention overcomes the scene adaptation defects of traditional and general deep learning dehazing algorithms. The overall architecture is novel, logically rigorous, and highly practical. It is adapted to the real-time deployment requirements of embedded devices and has extremely high clinical application value and promotion prospects.

[0092] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0093] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. An adaptive endoscopic image dehazing method, characterized in that, include: S1. Perform illumination compensation and noise reduction preprocessing on the original hazy image of the endoscope to obtain a standardized RGB image; S2. Construct a medical-specific four-channel physical prior feature map based on the standardized RGB image, including: removing physiologically bright tissue interference through a dual-threshold screening mechanism based on pixel brightness statistical distribution; calculating improved dark channel features and local block atmospheric light features; solving pixel-level fog depth by combining transmittance inversion and generating a scattering coefficient map adapted to the endoscope cavity environment; and stitching the scattering coefficient map, the improved dark channel features, and the local block atmospheric light features with the standardized RGB image to obtain four-channel input features. S3. Input the four-channel input features into a lightweight dual-stream encoder, extract local tissue fine texture features through a multi-scale dilated convolutional CNN branch, model global fogging interference distribution features through a lightweight axial Transformer branch, and achieve cross-branch interactive fusion of dual-stream features through an attention gating mechanism. S4. Based on the pixel neighborhood gray-level variance and the first and second thresholds determined according to the gray-level distribution law of clinical endoscopy images, the image is divided into dense fog area, thin fog gradient area and fog-free area. The gradient dynamic weight mechanism is used to allocate the differentiated defogging intensity to complete the adaptive reconstruction of the fog-free image. S5. Input the reconstructed image into a deep learning network that has been pre-trained and optimized using medical color mean loss, texture loss and physical residual loss. The abnormal color features of the lesion area are preserved through the lesion color exemption mechanism set in the network, and a clear endoscopic image is output.

2. The method according to claim 1, characterized in that, The formula for calculating the scattering coefficient map is: Where α is the intensity coefficient of the endoscope light source, and β is the attenuation coefficient of the human body cavity tissue medium. The fog depth is at the pixel level and is obtained by inverting the image transmittance.

3. The method according to claim 2, characterized in that, The value range of α is 1.0 to 1.3; the value range of β is 0.15 to 0.

25.

4. The method according to claim 1, characterized in that, The dual-threshold screening mechanism sets a first screening threshold and a second screening threshold. The first screening threshold and the second screening threshold are determined based on the inherent distribution law of pixel brightness in normal tissues of medical endoscopes, and are used to distinguish between physiological high-brightness areas and fogging interference high-brightness areas. The first screening threshold T1=0.85 and the second screening threshold T2=0.

95.

5. The method according to claim 1, characterized in that, The lightweight axial Transformer employs an axial decomposition attention mechanism, decomposing global self-attention into a cascade of two one-dimensional attentions: horizontal and vertical. This optimizes computational complexity to [value missing]. It is configured with 4 layers of attention coding, a single-head attention structure and a 0.5-channel compression factor.

6. The method according to claim 1, characterized in that, Dynamic gradient dehazing weights The calculation formula is: in, The grayscale variance of the pixel neighborhood. The first threshold, This is the second threshold.

7. The method according to claim 6, characterized in that, The first threshold The second threshold is 0.

15. It is 0.

45.

8. The method according to claim 1, characterized in that, The composite loss function is: in, To address the KL divergence color loss based on the standard tissue color map of medical endoscopes, a standard RGB threshold range for normal tissues in human cavities is pre-defined, and a lesion color exemption mechanism is set. Image texture gradient loss; This represents the residual loss of the physical model.

9. An adaptive endoscopic image dehazing device, characterized in that, include: The preprocessing module is used to perform illumination compensation and noise reduction preprocessing on the original hazy image of the endoscope to obtain a standardized RGB image; The physical prior construction module is used to construct a medical-specific four-channel physical prior feature map based on the standardized RGB image. This includes: removing physiologically bright tissue interference through a dual-threshold screening mechanism based on the statistical distribution of pixel brightness; calculating improved dark channel features and local block atmospheric light features; solving pixel-level fog depth by combining transmittance inversion and generating a scattering coefficient map adapted to the endoscopic cavity environment; and stitching the scattering coefficient map, the improved dark channel features, and the local block atmospheric light features with the standardized RGB image to obtain four-channel input features. The dual-stream encoding module is used to input the four-channel input features into a lightweight dual-stream encoder, extract local tissue fine texture features through a multi-scale dilated convolutional CNN branch, model global fogging interference distribution features through a lightweight axial Transformer branch, and realize cross-branch interactive fusion of dual-stream features through an attention gating mechanism. The adaptive reconstruction module is used to divide the image into a dense fog region, a light fog gradient region, and a fog-free region based on the pixel neighborhood gray-level variance and a first threshold and a second threshold determined according to the gray-level distribution law of clinical endoscope images. It uses a gradient dynamic weighting mechanism to allocate differentiated defogging intensity and complete the adaptive reconstruction of the fog-free image. The deep learning image correction module is used to input the reconstructed image into a deep learning network that has been pre-trained and optimized using medical color mean loss, texture loss and physical residual loss. The abnormal color features of the lesion area are preserved through the lesion color exemption mechanism set in the network, and a clear endoscopic image is output.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the adaptive endoscopic image dehazing method according to any one of claims 1 to 8.