Method and system for clearing optical coherence tomography images
By combining adaptive Gamma enhancement and multi-scale processing with a multi-scale residual network, the problems of loss of texture details and amplification of noise in flat areas in OCT images are solved, thereby achieving image clarity and improved diagnostic results.
Patent Information
- Application Number
- CN202611123135.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2046-07-28
AI Technical Summary
Existing OCT image enhancement methods cannot simultaneously enhance details in textured regions and suppress noise in flat regions, resulting in a contradiction between the loss of details in textured regions and the amplification of noise in flat regions.
Adaptive Gamma enhancement is performed by calculating the adaptive Gamma index for each pixel. Combined with multi-scale guided filtering and multi-scale residual network processing, differential processing is performed on textured and flat areas respectively. Finally, denoising and detail restoration are performed through multi-scale residual network.
It achieves a balance between enhancing details in textured areas and suppressing noise in flat areas, thereby improving the clarity and diagnostic reliability of OCT images.
Smart Images

Figure CN122636617B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method and system for sharpening optical coherence tomography images. Background Technology
[0002] Optical coherence tomography (OCT) imaging technology can provide high-resolution cross-sectional images of the various layers of the retina. However, due to limitations in imaging principles and the optical properties of biological tissues, OCT images contain speckle noise, and the overall image brightness is low with insufficient texture contrast. OCT images simultaneously contain textured regions of the retinal layered structures and flat regions such as the vitreous cavity with weak texture. The speckle noise is unevenly distributed in these two types of regions, presenting a contradiction between enhancing details in textured regions and suppressing noise in flat regions during image enhancement.
[0003] OCT image enhancement schemes can be categorized as follows: The first category is adaptive Gamma correction methods based on global statistics. These methods calculate the global mean of the input grayscale image and then dynamically adjust a single Gamma value based on the relationship between the global mean and a preset threshold. The same Gamma exponent is applied to all pixels in the entire image for power-law transformation. The second category is enhancement methods based on histogram equalization, including classic histogram equalization and contrast-limited adaptive histogram equalization. These methods redistribute the probability density of image grayscale levels, making the histogram of the output image approximately uniform, thereby improving overall contrast. The third category is image denoising and enhancement methods based on deep learning, represented by multi-scale residual networks. These methods learn an end-to-end mapping from low-quality input to high-quality output through parallel multi-resolution streams, recursive residual groups, and channel attention mechanisms.
[0004] The above-mentioned solutions still have the following technical problems when processing OCT images: Global adaptive Gamma correction uses a uniform Gamma parameter for the entire image, which cannot distinguish between textured and flat regions, resulting in excessive amplification of noise in flat regions and insufficient brightening of textured regions; Histogram equalization methods significantly amplify speckle noise in flat regions when redistributing gray levels, and may also introduce unnatural blocky artifacts, disrupting the continuity of layered structures; Deep learning methods lack preprocessing mechanisms tailored to the speckle noise and gray-level distribution characteristics of OCT images, requiring the network to simultaneously learn brightness adjustment, noise suppression, and detail restoration, making training difficult and limiting its effectiveness. In summary, the above-mentioned solutions still suffer from the contradiction between amplifying noise in flat regions and losing details in textured regions. Summary of the Invention
[0005] This application provides a method and system for sharpening optical coherence tomography images to resolve the contradiction between noise amplification in flat areas and loss of detail in textured areas.
[0006] In a first aspect, this application provides a method for sharpening optical coherence tomography images, comprising: Acquire an image to be processed, wherein the image to be processed is an optical coherence tomography grayscale image, and the image to be processed includes textured regions and flat regions; Based on the neighborhood local standard deviation of each pixel in the image to be processed, the adaptive Gamma index of each pixel is calculated to perform adaptive Gamma enhancement on the image to be processed, resulting in a first enhanced image. The Gamma value of the texture region in the first enhanced image is less than the Gamma value of the flat region. The first enhanced image is subjected to guided filtering, and the multiple filtering results are weighted and fused to obtain a preprocessed image. The preprocessed image is input into a multi-scale residual network, which performs denoising and detail restoration on the preprocessed image to obtain a sharpened image. The multi-scale residual network is a network trained based on optical coherence tomography images.
[0007] In some feasible embodiments, obtaining the first enhanced image includes: calculating the global brightness mean of the image to be processed; calculating a global brightness factor based on the global brightness mean; constructing an integral image and a square integral image; for each pixel in the image to be processed, determining a square neighborhood window centered on the pixel; using the integral image and the square integral image, querying the sum of pixel gray values and the sum of squared pixel gray values within the neighborhood window; calculating a local mean and a local standard deviation based on the sum of pixel gray values and the sum of squared pixel gray values; calculating a normalized texture intensity based on the local standard deviation and a standard deviation threshold; calculating an adaptive Gamma index for the pixel based on the normalized texture intensity and the global brightness factor; and performing Gamma correction based on the adaptive Gamma index for pixels in the image to be processed whose gray values are greater than or equal to a dark area protection threshold to obtain the first enhanced image.
[0008] By accelerating the query of local statistics through integral images, the quantization of texture intensity is reduced from window-by-window traversal to constant time. The introduction of a dark area protection threshold can prevent noise in extremely low grayscale areas from being nonlinearly stretched and amplified.
[0009] In some feasible embodiments, calculating the adaptive Gamma index of the pixel based on the normalized texture intensity and the global luminance factor includes: calculating a first product, wherein the first product is the product of the normalized texture intensity, the modulation intensity coefficient, and the global luminance factor; calculating an initial Gamma index, wherein the initial Gamma index is the difference between 1 and the first product; and restricting the initial Gamma index within a first preset interval to obtain the adaptive Gamma index.
[0010] By using multiplicative modulation, texture intensity, global brightness, and user-controllable modulation coefficients are unified into the Gamma exponent calculation, thereby obtaining a smooth and controllable enhancement intensity distribution.
[0011] In some feasible embodiments, the step of calculating the normalized texture intensity based on the local standard deviation and the standard deviation threshold includes: calculating a first ratio, wherein the first ratio is the ratio of the local standard deviation to the standard deviation threshold; if the first ratio is greater than 1, truncating the normalized texture intensity to a value of 1; and if the first ratio is less than or equal to 1, using the first ratio as the value of the normalized texture intensity.
[0012] By truncating the texture intensity, the intensity is reduced to a closed interval of 0-1. The closer the intensity is to 1, the stronger the texture is, and the closer the intensity is to 0, the flatter the region is. This provides an intuitive and interpretable texture metric for Gamma exponential modulation.
[0013] In some feasible embodiments, calculating the global brightness factor based on the global average brightness value includes: calculating a second ratio, the second ratio being the ratio of the global average brightness value to a preset intermediate brightness value; calculating an initial global brightness factor, the initial global brightness factor being the difference between 1 and the second ratio; and limiting the initial global brightness factor to a second preset interval to obtain the global brightness factor; wherein the preset intermediate brightness value is 128, and the second preset interval is 0.3-1.0.
[0014] The global brightness factor allows the enhancement level to be adaptively adjusted according to the overall brightness of the image: dark images receive stronger enhancement, while bright images receive gentler enhancement, preventing overexposure.
[0015] In some feasible embodiments, the step of performing guided filtering on the first enhanced image and weightedly fusing the resulting multiple filtering results to obtain a preprocessed image includes: using the first enhanced image as the guide image and the input image, performing guided filtering at a first scale to obtain a first filtered image, wherein the guided filtering radius at the first scale is 5 pixels and the regularization parameter is 0.01; using the first enhanced image as the guide image and the input image, performing guided filtering at a second scale to obtain a second filtered image, wherein the guided filtering radius at the second scale is 15 pixels and the regularization parameter is 0.1; weightedly fusing the first filtered image and the second filtered image according to a preset weighting coefficient to obtain a fused image, wherein the preset weighting coefficient has a value range of 0.5-0.8; and performing saturation truncation processing on the fused image to ensure that the pixel values of the fused image fall within a preset range to obtain a preprocessed image.
[0016] Dual-scale guided filtering allows small-scale filtering to target high-frequency speckle noise and large-scale filtering to smooth background brightness fluctuations. The fusion of the two results in a clean and sharp-edge preprocessed result.
[0017] In some feasible embodiments, the step of inputting the preprocessed image into a multi-scale residual network and performing denoising and detail restoration on the preprocessed image through the multi-scale residual network to obtain a sharpened image includes: obtaining a three-channel tensor, wherein the three-channel tensor is obtained by copying the single-channel grayscale data of the preprocessed image three times along the channel dimension; mapping the pixel values of the three-channel tensor to a floating-point range to obtain a normalized three-channel tensor; and inputting the normalized three-channel tensor into the multi-scale residual network and performing denoising and detail restoration through the multi-scale residual network to obtain a sharpened image.
[0018] The format adaptation from single-channel grayscale image to three-channel network input is achieved by channel duplication and floating-point normalization, enabling the network to process OCT grayscale images while maintaining the original architecture.
[0019] In some feasible embodiments, the multi-scale residual network is trained through the following steps: acquiring an optical coherence tomography (OCT) image training dataset, which includes a first training set and a second training set. The first training set consists of OCT images with a resolution less than a resolution threshold, and the second training set consists of OCT images with a resolution greater than the resolution threshold. The images in the first training set correspond one-to-one with the images in the second training set, representing paired images at the same scanning location. The first training set is input into the multi-scale residual network to be trained, and forward propagation is performed through the multi-scale residual network to obtain a predicted sharp image. Based on the predicted sharp image and the second training set, a composite loss function is calculated, which includes mean absolute error loss, structural similarity loss, and feature map perception loss. According to the composite loss function, the network parameters of the multi-scale residual network to be trained are updated through backpropagation, and this iteration is repeated until the composite loss function converges, resulting in a trained multi-scale residual network.
[0020] The training scheme employs a composite loss function to simultaneously constrain pixel accuracy, structural fidelity, and visual perception quality, enabling the network to reconstruct images with natural textures and clear edges while denoising.
[0021] In some feasible embodiments, the step of inputting the preprocessed image into a multi-scale residual network and performing denoising and detail restoration on the preprocessed image through the multi-scale residual network to obtain a sharpened image includes: inputting the preprocessed image into the multi-scale residual network, performing forward propagation through the multi-scale residual network to obtain a network output tensor; extracting the first channel data of the network output tensor, or calculating the three-channel average value of the network output tensor; and performing saturation truncation processing on the first channel data or the three-channel average value to obtain the sharpened image.
[0022] The output post-processing converts the three-channel network output back into a single-channel grayscale image and ensures that the pixel values fall within the legal range through saturation truncation.
[0023] Secondly, this application provides an optical coherence tomography image sharpening system, comprising: The Gamma enhancement module is configured to: acquire an image to be processed, wherein the image to be processed is an optical coherence tomography grayscale image, the image to be processed includes a texture region and a flat region; calculate an adaptive Gamma index for each pixel based on the neighborhood local standard deviation of each pixel in the image to be processed, so as to perform adaptive Gamma enhancement on the image to be processed to obtain a first enhanced image, wherein the Gamma value of the texture region in the first enhanced image is less than the Gamma value of the flat region; The filtering preprocessing module is configured to: perform guided filtering on the first enhanced image, and perform weighted fusion of the multiple filtering results to obtain a preprocessed image; The denoising module is configured to: input the preprocessed image into a multi-scale residual network, and perform denoising and detail restoration on the preprocessed image through the multi-scale residual network to obtain a sharpened image. The multi-scale residual network is a network trained based on optical coherence tomography images.
[0024] Based on the above technical solutions, this application provides a method and system for sharpening optical coherence tomography (OCT) images. The method first calculates an adaptive Gamma index for each pixel based on the local standard deviation of the image neighborhood, so that textured regions obtain smaller Gamma values to fully brighten them and flat regions obtain larger Gamma values to suppress noise amplification. Then, the first enhanced image is weighted and fused through multi-scale guided filtering, and high-frequency speckle noise removal and large-scale background smoothing are achieved by using different filtering scales. The preprocessed image is then fed into a multi-scale residual network trained for OCT images to complete denoising and detail restoration. It can be seen that the method can take into account both the enhancement of details in textured regions and the suppression of noise in flat regions, thereby improving the sharpness of OCT images. Attached Figure Description
[0025] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A schematic flowchart illustrating the optical coherence tomography image sharpening method provided in this application embodiment; Figure 2 This is a schematic diagram of the multi-scale residual network structure provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the recursive residual group provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a cross-resolution information exchange network provided in an embodiment of this application; Figure 5 A comparative diagram of the image to be processed and the sharpened image provided in an embodiment of this application; Figure 6 A schematic diagram of the module structure of the optical coherence tomography image sharpening system provided in this application embodiment. Detailed Implementation
[0027] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following examples do not represent all embodiments consistent with this application.
[0028] An OCT imaging system consists of a low-coherence light source, a fiber optic interferometer, and a detector. Broadband near-infrared light emitted from the light source is split into reference light and sample light by a beam splitter. The reference light returns via a reference arm mirror, while the sample light illuminates the retinal tissue via a scanning mirror. Backscattered light from each tissue layer interferes with the reference light and is received by a spectrometer or photodetector. This interference is then reconstructed using Fourier transform to form A-scan signals in the depth direction. Multiple A-scans are arranged laterally to form a two-dimensional B-scan image. Because OCT imaging is based on the principle of interference, the partial coherence of the light source results in inherent speckle noise in the image. This speckle noise manifests as random fluctuations in grayscale values, creating a granular texture that visually reduces the discernibility of tissue layers.
[0029] In the clinical diagnostic process, ophthalmologists analyzing OCT images need to simultaneously observe the following structures: nerve fiber layer, ganglion cell layer, inner plexiform layer, nuclear layer, outer plexiform layer, outer nuclear layer, external membrane, inner / outer ganglia of photoreceptors, retinal pigment epithelium, and choroid. These structures appear as alternating bright and dark bands in the image. Bright bands correspond to tissue interfaces or cell layers with strong backscattering, while dark bands correspond to nuclear layers or septal regions with weaker backscattering. Effective diagnosis requires clearly distinguishable boundaries between layers, distinct contrast between bright and dark areas, and the absence of artifacts that disrupt the continuity of the layered structure.
[0030] Under the aforementioned diagnostic requirements, when analyzing OCT grayscale images, the retinal laminar structure region exhibits significant variations in tissue density gradients, resulting in textured areas with large fluctuations in local grayscale values. Conversely, the vitreous cavity and deep choroidal attenuation areas, due to uniform tissue or deep signal attenuation, appear as flat regions with gradual grayscale value changes. There is a conflict between the image enhancement needs for textured and flat regions. Textured regions require appropriate brightening to highlight subtle differences, while brightening flat regions amplifies speckle noise, creating granular artifacts that interfere with diagnosis.
[0031] In some enhancement schemes, the global brightness mean of the input grayscale image is calculated. Then, based on the relationship between the global mean and a preset threshold, a single Gamma value is dynamically adjusted using a linear or nonlinear mapping formula. Finally, a power-law transformation is performed on all pixels of the entire image using a uniform Gamma exponent. This scheme is simple in process and computationally efficient, but because the enhancement strategy is completely disconnected from the local content of the image, it cannot distinguish between textured and flat areas. When the global Gamma value is biased towards brightening, speckle noise in flat areas is amplified; when the Gamma value is biased towards conservatism, the detail enhancement in textured areas is insufficient.
[0032] Histogram equalization (HEM) redistributes the probability density of image gray levels to homogenize the output image histogram and expand the gray-level dynamic range. However, in OCT grayscale images, background noise regions occupy a large number of low gray-level pixels. When stretching the gray-level range, HEM amplifies the noise along with the image, and the statistics within the local window are unstable, easily producing blocky discontinuous artifacts in flat areas. Contrast-limited adaptive HEM suppresses noise amplification by cropping the peak portion of the histogram, but it still cannot fundamentally solve the different enhancement intensity requirements between textured and flat areas.
[0033] The deep learning-based multi-scale residual network scheme inputs the original OCT image or a simply normalized image into the network. The network needs to simultaneously perform brightness adjustment, noise suppression, and detail restoration, making the training task difficult and convergence slow. Furthermore, the speckle noise statistical characteristics and grayscale distribution features of OCT images differ from those of natural images or fundus photographs. When a network pre-trained on natural images is transferred to OCT images, the enhancement effect may decrease, or even unpredictable artifacts may be introduced. The proposed scheme also suffers from inconsistent network input quality and insufficient output stability.
[0034] In summary, the above methods cannot simultaneously achieve both enhanced detail in textured areas and noise suppression in flat areas.
[0035] To address the aforementioned issues, some embodiments of this application provide a method for sharpening optical coherence tomography (OCT) images. This method introduces a two-stage adaptive preprocessing stage before deep learning inference, placing brightness adjustment and preliminary noise suppression before the network. Then, a multi-scale residual network specifically trained for OCT images is used to complete denoising and detail restoration.
[0036] See Figure 1 , Figure 1 The flowchart of the optical coherence tomography image sharpening method provided in the embodiments of this application includes the following steps S100-S400.
[0037] S100: Acquire the image to be processed.
[0038] The image to be processed is the original grayscale image acquired by the OCT device, i.e., a two-dimensional B-scan image with a size of H×W pixels, for example, 920×920 pixels. The grayscale value of each pixel is an integer, and the range of values is determined by the quantization bit depth of the imaging device. The OCT device outputs an 8-bit grayscale image (grayscale range 0 to 255) or a higher bit depth image (such as 12-bit or 16-bit).
[0039] The image to be processed includes textured regions and flat regions. Textured regions correspond to areas with drastic changes in tissue density, such as the retinal layered structure and cross-sections of blood vessels, and are characterized by large fluctuations in local gray values. Flat regions correspond to areas with uniform tissue or weak signals, such as the vitreous cavity and deep attenuation areas of the choroid, and are characterized by gradual changes in local gray values.
[0040] The images to be processed can be acquired either by reading them directly from the data interface of the OCT imaging device in real time, or by loading existing scan data from the image storage system. Differences in dimensions caused by the output bit depth of different devices can be addressed in subsequent steps through normalization or adaptive parameter adjustments.
[0041] S200: Based on the local standard deviation of the neighborhood of each pixel in the image to be processed, calculate the adaptive Gamma index of each pixel to perform adaptive Gamma enhancement on the image to be processed, and obtain the first enhanced image.
[0042] The traditional form of Gamma correction is Iout = I γ Wherein, when γ < 1, the image is brightened; when γ > 1, the image is darkened; and when γ = 1, the image remains unchanged. In the first enhanced image, the Gamma value of the texture region is less than that of the flat region. This application correlates the Gamma index of each pixel with the texture intensity of its neighborhood. The stronger the texture, the smaller γ, and the more obvious the brightening. The flatter the region, the closer γ is to 1, and the original value is basically maintained. Thus, it is fundamentally different from the practice of global Gamma correction that uses the same γ value for the entire image.
[0043] From a physical perspective, local standard deviation measures the dispersion of gray values within a neighborhood. In textured regions, alternating tissue layers lead to drastic fluctuations in gray values, resulting in a larger local standard deviation; in flat regions, uniform tissue or weak signals lead to gentler fluctuations in gray values, resulting in a smaller local standard deviation. Local standard deviation becomes an effective statistical measure to distinguish between textured and flat regions, reflecting the information density of tissue structure in OCT images. Modulating the Gamma exponent based on local standard deviation implies a positive correlation between enhancement intensity and information density—enhancing areas with abundant information and preserving areas with scarce information, taking into account the distribution characteristics of speckle noise in OCT images.
[0044] Other approaches, such as global adaptive gamma correction, only utilize global statistics (e.g., global mean) to generate a single gamma value. This fails to capture texture differences between different regions within the image, applying the same power-law transformation regardless of whether the pixel is located in the retinal lamina or the vitreous cavity. This application takes a pixel-by-pixel analysis approach, using the local neighborhood of each pixel as the analysis window, thus ensuring that the spatial resolution of the gamma value matches the spatial resolution of the image texture.
[0045] In some embodiments, obtaining the first enhanced image includes the following sub-steps: calculating the global brightness mean of the image to be processed; calculating the global brightness factor based on the global brightness mean; constructing an integral image and a square integral image; for each pixel in the image to be processed, determining a square neighborhood window centered on the pixel, and querying the sum of pixel gray values and the sum of squared pixel gray values within the neighborhood window using the integral image and the square integral image; calculating the local mean and local standard deviation based on the sum of pixel gray values and the sum of squared pixel gray values; calculating the normalized texture intensity based on the local standard deviation and the standard deviation threshold; calculating the adaptive Gamma exponent of the pixel based on the normalized texture intensity and the global brightness factor; and performing Gamma correction based on the adaptive Gamma exponent for pixels in the image to be processed that have gray values greater than or equal to the dark area protection threshold to obtain the first enhanced image.
[0046] Specifically, iterate through all pixels of the image to be processed, sum the grayscale values of each pixel, and divide by the total number of pixels to obtain the global average brightness. The global average brightness reflects the overall brightness of the image, as shown in the following formula: ; Where H is the image height and W is the image width. The value is the pixel grayscale value of the input image at coordinates (x, y), ranging from 0 to 255.
[0047] In some embodiments, calculating a global brightness factor based on the global average brightness includes: calculating a second ratio, the second ratio being the ratio of the global average brightness to a preset intermediate brightness value; calculating an initial global brightness factor, the initial global brightness factor being the difference between 1 and the second ratio; and limiting the initial global brightness factor to a second preset range to obtain a global brightness factor; wherein the preset intermediate brightness value is 128, and the second preset range is 0.3-1.0.
[0048] Taking an 8-bit grayscale image (grayscale range 0 to 255) as an example, the median brightness value is 128. Initial global brightness factor. When the overall image is dark, that is... When it is much less than 128, Approaching 1.0 indicates a significant enhancement; when the overall image is brighter, that is... When it is greater than 128, The enhancement is reduced and moderated. By limiting the initial global brightness factor to a second preset range of 0.3-1.0, overprocessing of bright images and resulting distortion can be prevented. The global brightness factor, as a unified scaling factor, uniformly controls the baseline of the enhancement amplitude across the entire image, enabling the same processing flow to adapt to input images with different brightness levels.
[0049] Reconstruct the integral graph and the square integral graph, the integral graph Defined as the sum of the gray values of all pixels from the top left corner of the image to point (u,v), at the boundary. An integral graph can be constructed by traversing the entire graph in one step, and the recursive formula is as follows: ; in, The value of the integral image at coordinates (i,j) is the sum of the gray values of all pixels within the rectangular region from the top left corner (0,0) to (i,j). The pixel gray value at coordinates (i,j) of the input image; Let (i-1,j) be the value of the integral plot at (i-1,j). Let (i,j-1) be the value of the integral plot at (i,j-1). Let be the value of the integral graph at (i-1, j-1).
[0050] Square integral graph Defined as the sum of the squares of the gray values of all pixels from the top left corner of the image to point (i,j), with the boundary treatment method the same as for the integral image. The recursive formula and Similarly.
[0051] For each pixel (i, j) in the image to be processed, a square neighborhood window is determined centered on that pixel. The side length of the window is, for example, 2r+1, where r is the neighborhood radius. In some embodiments, r is 5, meaning the neighborhood window is 11×11 pixels. The window boundaries are then determined, including the left boundary. right boundary upper boundary lower boundary Number of pixels in the window .
[0052] Using an integral image, the sum of the pixel grayscale values Sum within the window can be obtained in O(1) time using the following formula, see below: ; Among them, when the index value goes out of bounds (such as...) or When ), the corresponding integral image term takes the value of 0. Similarly, the sum of the squares of the pixel grayscale values within the window, SumSq, is calculated as follows: ; This yields the local mean, as shown in the following formula: ; Where N is the number of pixels in the neighborhood.
[0053] Local mean square value, see the following formula: ; Local standard deviation, see the following formula: ; Without using an integral image, summing the results by iterating through the neighborhood window of each pixel individually would have a time complexity of O(H×W×r). 2 Using integral graphs, the query time for a single window is reduced to O(1), and the overall time complexity is O(H×W).
[0054] For example, for a 920×920 pixel image, the speedup is approximately 121x when r=5, enabling pixel-wise adaptive Gamma enhancement to be performed on the CPU in real time or near real time without the need for dedicated hardware acceleration such as a graphics processing unit (GPU).
[0055] In some embodiments, calculating the normalized texture intensity based on the local standard deviation and the standard deviation threshold includes: calculating a first ratio, the first ratio being the ratio of the local standard deviation to the standard deviation threshold; if the first ratio is greater than 1, truncating the normalized texture intensity to a value of 1; and if the first ratio is less than or equal to 1, using the first ratio as the value of the normalized texture intensity.
[0056] The mathematical expression is as follows: ; in, This is the standard deviation threshold.
[0057] Regarding the standard deviation threshold, statistical analysis of a large number of OCT images shows that the local standard deviation of textured regions is generally above 10, while the local standard deviation of flat regions is generally below 5. Setting it to 12 (8-bit grayscale image) allows for better separation of the two types of regions. When much smaller hour, A value close to 0 indicates that the pixel is located in a flat area, is sensitive to noise, and should be avoided for enhancement; when Greater than or equal to hour, =1 indicates that the pixel is located in a high-texture area and needs to be fully enhanced; intermediate transition area ∈(0,1) makes the enhancement intensity transition smoothly. For images output by devices with high noise levels, the standard deviation threshold can be appropriately increased (e.g., 15 or 18); for images with low noise levels, the standard deviation threshold can be decreased (e.g., 8 or 10).
[0058] In some embodiments, calculating the adaptive Gamma index of a pixel based on the normalized texture intensity and the global luminance factor includes: calculating a first product, the first product being the product of the normalized texture intensity, the modulation intensity coefficient, and the global luminance factor; calculating an initial Gamma index, the initial Gamma index being the difference between 1 and the first product; and restricting the initial Gamma index within a first preset range to obtain the adaptive Gamma index.
[0059] The mathematical expression is as follows: ; in, The modulation intensity coefficient, To normalize texture intensity, the first preset range is 0.5-1.0.
[0060] The modulation intensity coefficient controls the aggressiveness of the enhancement. In some embodiments, k=0.5, which can be adjusted within the range of 0.3-0.7 according to the noise level of the OCT device. A first preset range is, for example, 0.5-1.0, to ensure that γ is neither lower than 0.5 (avoiding excessive brightening leading to noise amplification) nor higher than 1.0 (avoiding darkening). When the pixel is located in a flat area, Approaching 0, When the value approaches 1, the pixel remains essentially unchanged; when the pixel is located in the texture area, If the image is close to 1, and the overall image is too dark ( If it approaches 1), then A value close to 0.5 produces a strong brightening effect; if the overall image is too bright ( If it approaches 0.3, then It approaches 0.85, providing only a slight brightening effect.
[0061] The transformation formula for Gamma correction is as follows: ; in, This is the threshold for dark area protection.
[0062] In the image to be processed, the aforementioned power-law transformation is performed on pixels with grayscale values greater than or equal to the shadow protection threshold. The shadow protection threshold is, for example, 15 (for an 8-bit grayscale image). For pixels with grayscale values lower than the shadow protection threshold, the original value is retained without any enhancement. Extremely dark pixels with grayscale values below 15 correspond to deep, signal-free areas or image edges in the OCT image where the signal is completely attenuated. These areas contain almost no effective tissue information and only noise. Applying any non-linear stretching to these pixels will amplify the pure noise into artifacts with texture features, interfering with diagnosis. Therefore, the shadow protection threshold is set from a signal fidelity perspective to ensure that noise remains only in the noise area and does not spread into the tissue area.
[0063] After performing the pixel-by-pixel adaptive Gamma enhancement on all pixels, the first enhanced image is obtained. The first enhanced image retains the original image size, and the grayscale values remain in 8-bit (or original bit depth) integer format. In the first enhanced image, the retinal layered structure in textured areas is significantly brightened, and the boundary contrast between layers is more distinct; the grayscale of flat areas remains largely unchanged, and speckle noise is not amplified.
[0064] Taking a macular OCT B-scan image as an example, the image size is 920×920 pixels, and the global average brightness is 85 (slightly dark). =12, k=0.5, =15. Integral map construction took approximately 3 milliseconds, pixel-by-pixel local standard deviation calculation took approximately 35 milliseconds, and Gamma exponent calculation and correction took approximately 2 milliseconds, for a total CPU time of approximately 40 milliseconds. After processing, the mean local standard deviation of the retinal nerve fiber layer region increased from 9.2 to 12.5, indicating an enhancement of tissue detail contrast of approximately 36%; the mean local standard deviation of the vitreous cavity region only changed from 2.1 to 2.3, indicating that noise in flat areas was not significantly amplified.
[0065] S300: Perform guided filtering on the first enhanced image, and then perform weighted fusion of the multiple filtering results to obtain a preprocessed image.
[0066] After the adaptive Gamma enhancement in step S200, the textured areas of the first enhanced image have been brightened, but the enhancement operation may introduce or amplify a small amount of speckle noise. Furthermore, due to uneven illumination or differences in tissue scattering in OCT imaging, the image background may exhibit slowly varying brightness fluctuations, i.e., low-frequency illumination unevenness. Step S300, while maintaining edge sharpness, suppresses speckle noise and smooths background brightness fluctuations.
[0067] Guided filtering is an edge-preserving smoothing operator. Its core assumption is that within a local window ω_k, the output image q and the guided image g satisfy a linear relationship, i.e., the following equation: ; in, It is a constant within the window ω_k.
[0068] The optimal solution is obtained by minimizing the cost function. , Then, the weighted average of each window at pixel i is taken to obtain the final output. This filter has a fast box filtering implementation of O(1) and can better preserve edge gradients compared to bilateral filtering. Approaching 1 Approaching 0 makes the output at edge locations almost unaffected by neighborhood smoothing.
[0069] A single guided filter parameter is insufficient to simultaneously remove subtle noise and smooth large-scale background undulations. Small-radius filtering is effective for fine speckle noise but not smoothing large-scale brightness fluctuations; large-radius filtering can homogenize the background but can produce halos near tissue edges. This application employs two guided filters of different scales and weights and fuses the results.
[0070] In some embodiments, guided filtering is performed on the first enhanced image, and the resulting multiple filtering results are weighted and fused to obtain a preprocessed image. This includes: using the first enhanced image as a guide image and the input image, performing guided filtering at a first scale to obtain a first filtered image, where the guided filtering radius at the first scale is 5 pixels and the regularization parameter is 0.01; using the first enhanced image as a guide image and the input image, performing guided filtering at a second scale to obtain a second filtered image, where the guided filtering radius at the second scale is 15 pixels and the regularization parameter is 0.1; weighting and fusing the first filtered image and the second filtered image according to weighting coefficients to obtain a fused image; and performing saturation truncation on the fused image to ensure that the pixel values fall within a preset range to obtain the preprocessed image.
[0071] The first-scale guided filter is a small-scale filter with a filter radius of... =5 pixels, regularization parameter =0.01. A window size corresponding to a radius of 5 pixels is approximately 11×11 pixels. This scale is close to the typical correlation length of speckle noise in OCT images (approximately 3-7 pixels), thus effectively filtering out isolated high-frequency speckle noise points. Regularization parameter Taking a smaller value of 0.01 makes the filtering more focused on edge preservation, especially near the boundaries of tissue layers. The value is kept close to 1 to ensure that the edge sharpness is not significantly degraded due to filtering.
[0072] The second-scale guided filtering is a large-scale filtering method with a filter radius of... =15 pixels, regularization parameter =0.1. A window with a radius of 15 pixels is approximately 31×31 pixels, much larger than the correlation length of speckle noise, effectively smoothing large-scale background brightness fluctuations. Regularization parameter Taking a larger value of 0.1 makes the filtering focus more on smoothness, especially in flat regions. Approaching 0 It approaches the mean within the window, thus achieving a uniform effect.
[0073] The first filtered image Second filtered image The fusion is performed according to the weighting coefficient w, as shown in the following formula: ; The weight w controls the dominance of small-scale results. In some embodiments, w = 0.6, and the value can be adjusted within the range of 0.5-0.8 according to the image noise level. If the image noise is strong, w can be increased appropriately to make small-scale filtering contribute more to emphasize denoising; if the image background has large undulations, w can be decreased appropriately to make large-scale filtering contribute more to obtain a more uniform background.
[0074] Then process the fused image For each pixel in the image, saturation truncation is performed to ensure that the pixel value falls within a preset range [0, 255]. If the pixel value is less than 0, it is set to 0; if it is greater than 255, it is set to 255; if it is within the range, it remains unchanged. After saturation truncation, the image is converted to an 8-bit unsigned integer format to obtain a preprocessed image. The edges of the texture areas in the preprocessed image are clear and the brightness is appropriate. Speckle noise is significantly suppressed, and the background grayscale changes smoothly and evenly.
[0075] For example, a small-scale guided filter is performed on a first enhanced image of 920×920 pixels (8-bit grayscale). =5, =0.01) took approximately 8 milliseconds, large-scale guided filtering ( =15, =0.1) took approximately 9 milliseconds, weighted fusion and saturation truncation took approximately 1 millisecond, for a total time of approximately 18 milliseconds. After processing, the standard deviation of the vitreous cavity region in the preprocessed image decreased from 2.8 to 1.6, indicating that noise in the flat area was further suppressed; the gradient magnitude of the edge of the retinal laminar structure decreased only from 42.3 to 40.1 (a decrease of approximately 5%), indicating that the edge of the laminar structure was preserved.
[0076] S400: Input the preprocessed image into a multi-scale residual network, and use the multi-scale residual network to denoise and restore details of the preprocessed image to obtain a sharpened image.
[0077] The preprocessed image already has a good brightness distribution and low noise level, but due to the smoothing effect of the guided filter, some subtle layered structures (such as the outer membrane, the inner / outer segment junction of photoreceptors, and other substructures with a thickness of only 1-3 pixels) may be slightly blurred. This step removes residual noise and restores the texture details that have been slightly softened by the smoothing operation.
[0078] Since preprocessing has already done a lot of work on brightness adjustment and preliminary noise suppression, the network only needs to focus on two tasks: denoising and detail restoration. This reduces the training difficulty and makes the inference performance more stable.
[0079] In some embodiments, a preprocessed image is input into a multi-scale residual network, and the preprocessed image is denoised and details are restored through the multi-scale residual network to obtain a sharpened image. This includes: obtaining a three-channel tensor, which is obtained by copying the single-channel grayscale data of the preprocessed image three times along the channel dimension; mapping the pixel values of the three-channel tensor from a preset range to a floating-point range to obtain a normalized three-channel tensor; and inputting the normalized three-channel tensor into a multi-scale residual network, and denoising and details are restored through the multi-scale residual network to obtain a sharpened image.
[0080] For three-channel adaptation, let the preprocessed image be... The grayscale data of a given dimension H×W is copied three times along the channel dimension to form a three-channel tensor of dimension 3×H×W. See the following formula: .
[0081] Multi-scale residual networks (MIRNetv2 is used as an example below, but this application is not limited to this specific architecture) are designed to process three-channel color images, with the input layer expecting three channels. For OCT grayscale images, a single channel is copied into three identical channels, allowing the network to accept grayscale input while maintaining the original architecture. The three channels are identical at initialization, and ideally, the network output is also identical, with only minor differences possible due to floating-point rounding errors.
[0082] By linearly mapping the pixel values of the three-channel tensor from [0, 255] to the floating-point range of [0, 1], a normalized three-channel tensor is obtained. .
[0083] Normalize the three-channel tensor The input is a multi-scale residual network, which then performs forward propagation. The following section, using the MIRNetv2 architecture as an example, explains the necessary modules, hierarchical structure, and connections of the multi-scale residual network. (See also...) Figure 2 : The initial convolutional layer uses a 3×3 kernel with a stride of 1, 3 input channels, and 64 output channels, followed by a Rectified Linear Unit (ReLU) activation function. This layer maps the input three-channel image (H×W×3) from pixel space to a high-dimensional feature space, providing the basic feature representation for subsequent multi-scale feature extraction. The output feature map size of the initial convolutional layer is H×W×64.
[0084] Four recursive residual groups are stacked after the initial convolutional layer. Each recursive residual group contains the following sub-modules: See Figure 3Multi-scale residual blocks: Three different sizes of convolutional kernels (3×3, 5×5, and 7×7) are used in parallel to extract features from different receptive fields. The outputs of the three branches are concatenated along the channel dimension and then fused using 1×1 convolutions. The number of channels in the fused result is the same as the number of channels in the input multi-scale residual block. Through parallel multi-scale convolutions, the network can simultaneously capture structural information at different scales in OCT images, such as fine speckle noise (corresponding to small convolutional kernels) and the continuity of layered structures (corresponding to large convolutional kernels).
[0085] Channel attention mechanism: Global average pooling is performed on the output feature map of the multi-scale residual block to obtain the channel description vector. This vector is then passed sequentially through two fully connected layers. The first fully connected layer performs channel dimensionality reduction (e.g., reducing the number of channels to 1 / 4 of the original), and the second fully connected layer restores the original number of channels. After passing through the sigmoid activation function, weight coefficients for each channel are generated. Finally, the weight coefficients are multiplied with the original feature map channel by channel to achieve feature recalibration. The channel attention mechanism enables the network to adaptively enhance feature channels that are important for denoising and detail recovery tasks, while suppressing unimportant channels.
[0086] Within each recursive residual group, multi-scale residual blocks and channel attention mechanisms are sequentially connected, and the recursive residual groups adopt residual connections, that is, the input of the group is directly added to the output of the last channel attention mechanism in the group to form group-level residual learning.
[0087] See Figure 4 The cross-resolution information exchange network maintains three resolution branches: the original resolution branch (H×W), the 1 / 2 downsampling branch (H / 2×W / 2), and the 1 / 4 downsampling branch (H / 4×W / 4). Downsampling is achieved through convolutions with a stride of 2, and upsampling is achieved through bilinear interpolation. Between every two recursive residual groups, the different resolution branches exchange information bidirectionally. Features from the high-resolution branch are downsampled and fused with features from the low-resolution branch, allowing the low-resolution branch to obtain high-resolution detail information; conversely, features from the low-resolution branch are upsampled and fused with features from the high-resolution branch, allowing the high-resolution branch to obtain a wider range of contextual information. Through information exchange between the three resolution branches, the network can process OCT images at different scales. The high-resolution branch preserves fine layered structural details, while the low-resolution branch provides global brightness distribution and background region information.
[0088] The residual learning and output layers ultimately output a residual map R of size H×W×3 to reconstruct the image. This refers to image sharpening. The residual learning strategy allows the network to learn only the differences between the input image and the target sharpened image (i.e., the residual noise that needs to be removed and the details that need to be restored), without having to regenerate the complete image content. This significantly reduces the difficulty of network training and speeds up convergence. The output layer uses a 3×3 convolution to map the final feature map to 3 channels, followed by a sigmoid activation function to restrict the output values to the range [0,1].
[0089] The connection relationships between the initial convolutional layer, recurrent residual group, cross-resolution information exchange, and output layer are as follows: The initial convolutional layer is input, and its output is connected to the first recursive residual group. The output of the first recursive residual group, after cross-resolution information exchange, is input to the second recursive residual group. The output of the second recursive residual group, after cross-resolution information exchange, is input to the third recursive residual group. The output of the third recursive residual group, after cross-resolution information exchange, is input to the fourth recursive residual group. The output of the fourth recursive residual group is connected to the output layer, which outputs the residual map R. Adding to R yields .
[0090] It should be noted that multi-scale residual networks, as a mature image restoration architecture, have been thoroughly validated in the industry, and this application does not protect the network structure. This application combines adaptive Gamma enhancement and multi-scale guided filtering preprocessing with multi-scale residual networks in a specific cascade, and performs targeted training for the speckle noise and grayscale distribution characteristics of OCT images.
[0091] In some embodiments, the multi-scale residual network is trained through the following steps: First, an optical coherence tomography (OCT) image training dataset is acquired. This dataset includes a first training set and a second training set. The first training set consists of OCT images with resolution less than a resolution threshold, and the second training set consists of OCT images with resolution greater than the resolution threshold. Images in the first and second training sets correspond one-to-one, representing pairs of images at the same scanning location. The first training set is input into the multi-scale residual network to be trained, and forward propagation is performed through the network to obtain predicted sharp images. Based on the predicted sharp images and the second training set, a composite loss function is calculated. This composite loss function includes mean absolute error loss, structural similarity loss, and feature map perception loss. According to the composite loss function, the network parameters of the multi-scale residual network to be trained are updated through backpropagation. This process is repeated iteratively until the composite loss function converges, resulting in a trained multi-scale residual network.
[0092] The following details the specific steps and parameters for training.
[0093] Construction of the training dataset: A large number of B-scan images from the same or compatible OCT devices were collected and divided into a first training set (low resolution) and a second training set (high resolution) according to image sharpness. Images in the first training set correspond one-to-one with images in the second training set, representing pairs of images from the same scan location. The sharpness threshold can be set using no-reference image quality evaluation metrics such as Laplacian variance and Brenner gradient. The training dataset was randomly divided into training, validation, and test sets in an 8:1:1 ratio. The training set was used to update network parameters, the validation set was used to monitor overfitting during training and select the best model, and the test set was used for final model performance evaluation.
[0094] The images in the first training set need to undergo preprocessing steps S100-S300, namely adaptive Gamma enhancement and dual-scale guided filtering, to obtain preprocessed low-resolution images, which are then input into the network to be trained. The images in the second training set serve as ground truth reference images, ensuring that the distribution of input data encountered by the network during the training phase is completely consistent with that during the actual inference phase. In other words, the network learns the mapping relationship from the preprocessed low-quality images to the high-quality reference images, rather than directly mapping from the original low-quality images, thereby reducing the training difficulty of the network.
[0095] The preprocessed first training set images are copied and normalized in three channels, then input into the multi-scale residual network to be trained. Forward propagation is performed according to the connection sequence of the initial convolutional layer, recurrent residual group, cross-resolution information exchange, and output layer, to obtain a clear predicted image. .
[0096] The composite loss function is shown in the following formula: ; in, For the average absolute error loss, For structural similarity loss, The loss is the feature map perception loss, where λ1, λ2, and λ3 are the weights of each loss term. In some embodiments, λ1=1.0, λ2=1.0, and λ3=0.1.
[0097] Where N1 is the total number of pixels involved in the loss calculation. The ground truth image is used. The average of the absolute differences between the grayscale values of each pixel in the predicted image and the ground truth image is calculated. This loss ensures that the network output maintains the same brightness as the reference image and is insensitive to outliers.
[0098] The three loss terms complement each other. Ensure brightness consistency at the pixel level Preserve the local structure of edges and textures at the structural level. Improve visual perception quality at the semantic feature level.
[0099] , By comprehensively considering the three components of brightness, contrast, and structure, minimizing structural similarity index measure (SSIM) makes the network output more perceptually similar to the reference image, especially preserving the local structure of edges and textures.
[0100] M is the number of all pixels involved in the loss calculation. For the feature map output by the lth layer (e.g., after the 3rd, 4th, and 5th convolutional layers) of the pre-trained Visual Geometry Group Network (VGG-16), by minimizing the Euclidean distance between the feature maps, the network can generate details with natural textures and realistic structures, rather than just pixel-level fitting.
[0101] According to the composite loss function The gradient of the loss with respect to the weights and biases of each layer in the network is calculated using the backpropagation algorithm, and the network parameters are updated using the Adam optimizer. The hyperparameters of the Adam optimizer are set as follows: initial learning rate 1×10⁻⁶. -4 The first-order moment decay rate β1 = 0.9, the second-order moment decay rate β2 = 0.999, and the numerical stability constant is 10. -8 Training employs mini-batch stochastic gradient descent, with the batch size set according to the GPU memory capacity, such as 8 or 16. The learning rate decays to 0.5 times its original value every 50 training epochs. Training continues until the composite loss function no longer decreases for 20 consecutive epochs on the validation set, at which point convergence is considered achieved. The model weights with the minimum loss on the validation set are then saved as the trained multi-scale residual network.
[0102] During the training process described above, the input data (preprocessed images from the first training set) and the output data (refined images) are... A mapping relationship is established between them through forward propagation of a multi-scale residual network, and a composite loss function is used to map them to the ground truth image. By establishing a supervisory signal, a closed loop is formed among the three: input, network, output, loss, and truth value, enabling the network to effectively learn the mapping from the preprocessed image to the sharp image.
[0103] In some embodiments, a preprocessed image is input into a multi-scale residual network, and the preprocessed image is denoised and details are restored through the multi-scale residual network to obtain a sharpened image. This includes: inputting the preprocessed image into the multi-scale residual network, performing forward propagation through the multi-scale residual network to obtain the network output tensor; extracting the first channel data of the network output tensor, or calculating the three-channel average value of the network output tensor; and performing saturation truncation processing on the first channel data or the three-channel average value to obtain the sharpened image.
[0104] The network output tensor is a 3×H×W floating-point tensor. Since the three input channels are identical and the network parameters are shared, the three channels are ideally completely identical. However, rounding errors in floating-point operations may cause slight differences. The data from the first channel can be used as the single-channel result, or the average of the three channels can be calculated to reduce the impact of rounding errors. Then, the values are mapped back to [0, 255] and saturation truncation is performed: output values less than 0 are set to 0, and values greater than 255 are set to 255. This converts the output to an 8-bit unsigned integer format, resulting in a sharpened image.
[0105] The textured areas of the image show clear boundaries between retinal layers, and the contrast between light and dark areas meets the needs of clinical observation. Speckle noise in flat areas is suppressed at multiple levels and does not interfere with diagnosis. The continuity of fine anatomical structures (such as the external membrane, RPE-Bruch membrane complex, etc.) is good, and no unnatural breaks or block artifacts are produced due to processing.
[0106] The following example illustrates this step using a specific implementation scenario. When using TensorRT to accelerate model inference and running with an RTX 5090 graphics card, the inference time for a single 920×920 resolution preprocessed image is approximately 0.5 seconds (depending on network depth and CPU model).
[0107] like Figure 5 As shown, Figure 5 In the image, 5a represents the image to be processed, and 5b represents the image to be sharpened. It can be seen that 5b represents the post-processing of the output data, restoring the floating-point three-channel tensor output by the network to a single-channel 8-bit grayscale image. This format is completely consistent with the image to be processed, facilitating direct use for clinical display and storage. Furthermore, it achieves an average improvement of over 110%, and the boundaries of various structural layers in the enhanced image are clearer. The three channels show minimal difference in the network output; therefore, whether the first channel or the average of the three channels is used, the final visual effect is almost identical.
[0108] Based on the above-mentioned method for enhancing optical coherence tomography (OCT) images, some embodiments of this application also provide an OCT image enhancement system.
[0109] See Figure 6 This application also provides an optical coherence tomography image sharpening system in some embodiments, the system comprising: The Gamma enhancement module is configured to: acquire an image to be processed, which is an optical coherence tomography (OCT) grayscale image, including texture regions and flat regions; calculate the adaptive Gamma index of each pixel based on the neighborhood local standard deviation of each pixel in the image to be processed, so as to perform adaptive Gamma enhancement on the image to be processed, and obtain a first enhanced image, wherein the Gamma value of the texture region in the first enhanced image is less than the Gamma value of the flat region.
[0110] The filtering preprocessing module is configured to: perform guided filtering on the first enhanced image, and weight and fuse the multiple filtering results to obtain a preprocessed image.
[0111] The denoising module is configured to input the preprocessed image into a multi-scale residual network, and then perform denoising and detail restoration on the preprocessed image through the multi-scale residual network to obtain a sharpened image. The multi-scale residual network is a network trained based on optical coherence tomography images.
[0112] The Gamma enhancement module receives the image to be processed from an OCT device or image storage system. Internally, it performs integral image construction, neighborhood local standard deviation calculation, normalized texture intensity calculation, global brightness factor calculation, adaptive Gamma exponent calculation, and power-law transformation for dark area protection, outputting the first enhanced image to the filtering preprocessing module. The filtering preprocessing module performs guided filtering on the first enhanced image at both small and large scales, weighted fusion and saturation truncation on the two filtering results, outputting the preprocessed image to the denoising module. The denoising module contains a pre-trained multi-scale residual network model. After adapting the preprocessed image into a three-channel normalized tensor, it feeds it into the network for forward inference, performs channel extraction and saturation truncation on the network output, and finally outputs a sharpened image.
[0113] The three modules can be deployed on the same computing device, such as a general-purpose CPU server or a personal computer; alternatively, they can be distributed to different devices according to computing needs. For example, the Gamma enhancement module and the filtering preprocessing module, due to their relatively small computational load, can run on a CPU, while the denoising module, which involves deep network forward inference, can run on a GPU. Intermediate data can be transferred between modules via memory or network. The functions of each module are consistent with the descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0114] Similar parts between the embodiments provided in this application can be referred to mutually. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods extended from the solution of this application without creative effort shall fall within the scope of protection of this application.
Claims
1. A method for sharpening optical coherence tomography images, characterized in that, include: Acquire an image to be processed, wherein the image to be processed is an optical coherence tomography grayscale image, and the image to be processed includes textured regions and flat regions; Based on the neighborhood local standard deviation of each pixel in the image to be processed, the adaptive Gamma index of each pixel is calculated to perform adaptive Gamma enhancement on the image to be processed, resulting in a first enhanced image. The Gamma value of the texture region in the first enhanced image is less than the Gamma value of the flat region. The first enhanced image is subjected to guided filtering, and the multiple filtering results are weighted and fused to obtain a preprocessed image. The preprocessed image is input into a multi-scale residual network, which performs denoising and detail restoration on the preprocessed image to obtain a sharpened image. The multi-scale residual network is a network trained based on optical coherence tomography images. The process of obtaining the first enhanced image includes: Calculate the global average brightness of the image to be processed; Calculate the global brightness factor based on the global average brightness value; Construct integral plots and square integral plots; For each pixel in the image to be processed, a square neighborhood window is determined with the pixel as the center; using the integral image and the square integral image, the sum of the pixel gray values and the sum of the squares of the pixel gray values within the neighborhood window are queried. Calculate the local mean and local standard deviation based on the sum of the pixel gray values and the sum of the squares of the pixel gray values; The normalized texture intensity is calculated based on the local standard deviation and the standard deviation threshold. The adaptive Gamma index of the pixel is calculated based on the normalized texture intensity and the global brightness factor. In the image to be processed, for pixels whose grayscale value is greater than or equal to the dark area protection threshold, Gamma correction is performed based on the adaptive Gamma index to obtain the first enhanced image; The step of calculating the adaptive Gamma index of the pixel based on the normalized texture intensity and the global luminance factor includes: Calculate the first product, which is the product of the normalized texture intensity, the modulation intensity coefficient, and the global brightness factor; Calculate the initial Gamma exponent, which is the difference between 1 and the first product; By restricting the initial Gamma index within a first preset range, an adaptive Gamma index is obtained. The multi-scale residual network is trained through the following steps: Obtain an optical coherence tomography (OCT) image training dataset, which includes a first training set and a second training set. The first training set consists of OCT images with resolution less than a resolution threshold, and the second training set consists of OCT images with resolution greater than a resolution threshold. The images in the first training set correspond one-to-one with the images in the second training set, and are paired images at the same scanning position. The first training set is input into the multi-scale residual network to be trained, and forward propagation is performed through the multi-scale residual network to be trained to obtain a clear predicted image; Based on the predicted clear image and the second training set, a composite loss function is calculated, which includes mean absolute error loss, structural similarity loss, and feature map perception loss. Based on the composite loss function, the network parameters of the multi-scale residual network to be trained are updated through backpropagation. This process is repeated iteratively until the composite loss function converges, resulting in a trained multi-scale residual network.
2. The method for enhancing optical coherence tomography images according to claim 1, characterized in that, The step of calculating the normalized texture intensity based on the local standard deviation and the standard deviation threshold includes: Calculate a first ratio, which is the ratio of the local standard deviation to the standard deviation threshold; If the first ratio is greater than 1, the normalized texture intensity is truncated to a value of 1; If the first ratio is less than or equal to 1, the first ratio is used as the value of the normalized texture intensity.
3. The method for enhancing optical coherence tomography images according to claim 1, characterized in that, The step of calculating the global brightness factor based on the global brightness mean includes: Calculate the second ratio, which is the ratio of the global average brightness value to the preset intermediate brightness value; Calculate the initial global brightness factor, which is the difference between 1 and the second ratio; The initial global brightness factor is restricted to a second preset range to obtain the global brightness factor; The preset intermediate brightness value is 128, and the second preset range is 0.3-1.
0.
4. The method for enhancing optical coherence tomography images according to claim 1, characterized in that, The step of performing guided filtering on the first enhanced image and weightedly fusing the multiple filtering results to obtain a preprocessed image includes: Using the first enhanced image as the guide image and the input image, a first-scale guided filter is performed to obtain a first filtered image. The radius of the first-scale guided filter is 5 pixels, and the regularization parameter is 0.
01. Using the first enhanced image as the guide image and the input image, a second-scale guided filter is performed to obtain a second filtered image. The radius of the second-scale guided filter is 15 pixels, and the regularization parameter is 0.
1. The first filtered image and the second filtered image are weighted and fused according to a preset weighting coefficient to obtain a fused image. The preset weighting coefficient ranges from 0.5 to 0.
8. The fused image is saturated and truncated to ensure that the pixel values of the fused image fall within a preset range, thus obtaining a preprocessed image.
5. The method for enhancing optical coherence tomography images according to claim 1, characterized in that, The step of inputting the preprocessed image into a multi-scale residual network and using the multi-scale residual network to denoise and restore details of the preprocessed image to obtain a sharpened image includes: Obtain a three-channel tensor, which is obtained by copying the single-channel grayscale data of the preprocessed image three times along the channel dimension; The pixel values of the three-channel tensor are mapped to the floating-point range to obtain a normalized three-channel tensor. The normalized three-channel tensor is input into the multi-scale residual network, and the multi-scale residual network is used for denoising and detail restoration to obtain a sharpened image.
6. The method for enhancing optical coherence tomography images according to claim 1, characterized in that, The step of inputting the preprocessed image into a multi-scale residual network and using the multi-scale residual network to denoise and restore details of the preprocessed image to obtain a sharpened image includes: The preprocessed image is input into the multi-scale residual network, and forward propagation is performed through the multi-scale residual network to obtain the network output tensor; Extract the first channel data of the network output tensor, or calculate the average value of the three channels of the network output tensor; The first channel data or the average value of the three channels is saturated and truncated to obtain the sharpened image.
7. A system for enhancing optical coherence tomography (OCT) images, characterized in that, The system is used to perform the optical coherence tomography image sharpening method according to any one of claims 1-6, the system comprising: The Gamma enhancement module is configured to: acquire an image to be processed, wherein the image to be processed is an optical coherence tomography grayscale image, the image to be processed includes a texture region and a flat region; calculate an adaptive Gamma index for each pixel based on the neighborhood local standard deviation of each pixel in the image to be processed, so as to perform adaptive Gamma enhancement on the image to be processed to obtain a first enhanced image, wherein the Gamma value of the texture region in the first enhanced image is less than the Gamma value of the flat region; The filtering preprocessing module is configured to: perform guided filtering on the first enhanced image, and perform weighted fusion of the multiple filtering results to obtain a preprocessed image; The denoising module is configured to: input the preprocessed image into a multi-scale residual network, and perform denoising and detail restoration on the preprocessed image through the multi-scale residual network to obtain a sharpened image. The multi-scale residual network is a network trained based on optical coherence tomography images.
Citation Information
Patent Citations
Deep learning-based microscopic image seamless splicing and enhanced reconstruction method
CN121353070A
Image recognition method and device based on residual network and storage medium
CN121810579A
