Shadow recovery method, model training method, system, medium, product and device

By employing a two-stage OCT image shadow restoration model, a binarization masking mechanism and a pre-trained model are used, combined with positive and negative sample balancing and natural prior knowledge. This solves the problem of retinal structural information loss caused by fundus vascular shadows, achieving high-precision shadow restoration and preservation of structural information.

CN122115222APending Publication Date: 2026-05-29SHANDONG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2025-12-31
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing optical coherence tomography (OCT), the shadows of retinal blood vessels cause the loss of retinal structural information, making it difficult to achieve high-precision shadow recovery. Furthermore, existing methods may generate incorrect structural information or erase existing information.

Method used

A two-stage OCT image shadow restoration model is designed. The model achieves high-precision restoration of shadow regions through a binarization masking mechanism. A pre-trained two-stage auxiliary gradient model is used, which is trained by combining positive and negative sample balance and natural prior knowledge. Artificially synthesized shadows are used for image restoration.

Benefits of technology

It achieves high-precision restoration of shadow areas, avoids the generation of erroneous structural information, improves the accuracy of shadow restoration and the model's perception of shadow areas, and maintains the integrity of the original structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115222A_ABST
    Figure CN122115222A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image processing. A shadow recovery method, model training method, system, medium, product and equipment are provided. The pre-trained two-stage auxiliary gradient model is used for shadow recovery on the pre-processed OCT image to obtain the OCT image after shadow recovery. The training process includes: obtaining multiple OCT images as training images, selecting different shadow degree training images after pre-processing the training images, expanding and constructing a training set according to different shadow degree training images; according to the training set, the training loss minimization is carried out by introducing the positive and negative sample balance mode in the first stage training process; guided by natural prior knowledge, combined with the shadow of the artificially synthesized training image, the second stage training is carried out. The present application realizes high-precision recovery of the shadow area through the binary mask mechanism, and avoids the generation of false structure information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, specifically to a shadow restoration method, a model training method, a system, a medium, a product, and equipment. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Optical coherence tomography (OCT) is a technique that obtains information about the internal structure of a sample by detecting the interference intensity of the backscattered light signal. This technique boasts micron- or even sub-micron-level axial resolution, enabling the measurement of retinal thickness and structural changes, and is considered the gold standard for diagnosing eye diseases. However, the presence of blood vessels in the retina causes the incident light beam to be absorbed by the blood flow within the vessels, creating shadowed areas in the retinal B-Scan image. This leads to loss of structural information, inaccurate retinal layering, and increased difficulty in observing minute lesions at the base of blood vessels, thus missing opportunities for early detection of eye diseases.

[0004] Currently, there are two main methods for removing vascular shadows and improving image quality: one is to optimize the hardware optical path to remove or reduce shadow pixels in the shadow area. For example, by designing the hardware optical path system and modifying the second channel, and integrating it into a typical ICI system, self-coherent images in coherent imaging can be removed, thus improving image quality. The other method is to restore the shadow area by processing the image. For example, this involves directly processing the image using image pixel statistical features or deep learning neural networks, using automatic numerical interpolation to compensate for retinal shadows, and using GAN models to denoise and restore the shadow area. However, neither of these methods can meet the requirement of maintaining the image structure in the retinal shadow restoration task; they may generate incorrect structural information or erase existing structural information. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a shadow restoration method, a model training method, a system, a medium, a product, and a device. It designs a two-stage OCT image shadow restoration model that achieves high-precision restoration of shadow areas through a binarization masking mechanism, thereby avoiding the generation of erroneous structural information.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a shadow restoration method.

[0007] A shadow restoration method includes the following steps: Obtain the OCT image to be processed, and preprocess the OCT image; The pre-trained two-stage auxiliary gradient model is used to perform shadow restoration on the pre-processed OCT image, resulting in a shadow-restored OCT image. The training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0008] As a further limitation of the first aspect of the invention, training images with different shade levels are selected, including: A mean test is performed on the matching regions of the region to be matched and the template region. The pixels of the template region and the pixels of the region to be matched are normalized. T The test determines the magnitude of the significant difference between the two at the level of the data mean; when T When the confidence level is greater than a set threshold, it is considered that there is no significant difference between the template image and the matching region. At this point, the difference value between the template pixels and the matching region is calculated. V ,when V If the image is less than a given threshold, it is included in the dataset; otherwise, it is discarded. when T When the confidence level is less than or equal to a set threshold, the negative cosine similarity between the template vector and the matching region vector is used. Added as an adaptive adjustment factor V In the calculation, if V If the value is less than a given threshold, the image is included in the dataset; otherwise, it is discarded.

[0009] As a further limitation of the first aspect of the present invention, the training images are expanded according to different shadow levels, including: expanding the images by means of affine transformation, perspective transformation, contrast adjustment and random occlusion to obtain a training set.

[0010] As a further limitation of the first aspect of the present invention, during the first stage of training, the loss function for: ; in, For the output value, For label values, These are the weighting coefficients. For the first Focal-loss of a single detection head, For the first Focal-loss of auxiliary heads, For the first Dice-loss detection head, For the first An auxiliary head, Dice-loss.

[0011] As a further limitation of the first aspect of the present invention, the first-stage training process is used to train images for multi-level feature joint segmentation.

[0012] As a further limitation of the first aspect of the present invention, in the second stage of training, the natural image with shadows and the training image with artificially synthesized shadows are used as inputs, and the loss function is... for: , ,in, N For the total batch size in each iteration, and Indicates the first n The model outputs and labels in batches. This represents the loss value of the auxiliary decoder.

[0013] As a further limitation of the first aspect of the invention, the second-stage training process is used to train the recovery of blood vessel shadows in images.

[0014] As a further limitation of the first aspect of the invention, artificially synthesized shadows simulate the contour shape of the segmentation model mask: , , , ,in, To generate a set of contour points, To generate contour points, A To control the random number of the contour amplitude, f Random numbers used to control the rate of change in the contour. For the number of points, The initial center point is random. and For the oscillation radius in and Magnitude of direction; Different brightness levels are assigned to the generated regions, and Gaussian blur is applied to the filled regions to simulate brightness non-uniformity, including: , In the formula, To fill areas with uneven shadows, For Gaussian kernel, for Uniform binarized mask image after filling the set of points. For the original image data, The image represents the input model. This represents convolution.

[0015] Secondly, the present invention provides a shadow restoration system.

[0016] A shadow restoration system, comprising: The OCT image acquisition unit is configured to: acquire an OCT image to be processed and preprocess the OCT image; The shadow restoration unit is configured to perform shadow restoration on the preprocessed OCT image using a pre-trained two-stage auxiliary gradient model, resulting in a shadow-restored OCT image; wherein, the training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0017] Thirdly, the present invention provides a two-stage assisted gradient model training method.

[0018] A two-stage assisted gradient model training method, wherein the two-stage assisted gradient model is used for OCT image shadow restoration, includes the following process: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0019] Fourthly, the present invention provides a two-stage assisted gradient model training system.

[0020] A two-stage assisted gradient model training system, wherein the two-stage assisted gradient model is used for OCT image shadow restoration, comprising: The training set construction unit is configured to: acquire multiple OCT images as training images, preprocess the training images, select training images with different shadow levels, and expand and construct the training set based on the training images with different shadow levels; The two-stage training unit is configured to: minimize the training loss in the first stage of training by introducing a positive-negative sample balance based on the training set; and conduct the second stage of training by using natural prior knowledge and combining artificially synthesized training image shadows.

[0021] Fifthly, the present invention provides a computer device, comprising: a processor and a computer-readable storage medium; A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program that, when executed by the processor, implements the shadow restoration method as described in the first aspect of the present invention.

[0022] In a sixth aspect, the present invention provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed as described in the first aspect of the present invention.

[0023] In a seventh aspect, the present invention provides a computer program product comprising a computer program that, when executed by a processor, implements the shadow restoration method as described in the first aspect of the present invention.

[0024] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention innovatively designs a two-stage eye B-Scan image shadow restoration model architecture, which achieves high-precision restoration of shadow areas through a binarization masking mechanism, avoids generating erroneous structural information, and improves the accuracy of shadow restoration.

[0025] 2. This invention innovatively proposes a solution to the difficulty of model training in the process of segmenting small target regions. By introducing Focal-loss and Dice-loss together, the model's learning ability on positive samples is improved.

[0026] 3. This invention innovatively proposes a training strategy for recovering B-Scan images of the eye, which improves the model's ability to perceive shadows in B-Scan images by incorporating prior knowledge of natural images.

[0027] 4. Among the numerous OCT images acquired, adaptive template matching is achieved through a few template regions to select images containing shadow areas.

[0028] 5. This invention proposes a method for artificially synthesizing simulated eye shadow regions. By simulating eye shadows, label pairs of OCT images are constructed, solving the problem of difficulty in obtaining shadow region label pairs of OCT images.

[0029] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0030] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0031] Figure 1 A flowchart illustrating the training process of the two-stage auxiliary gradient model provided in Embodiment 1 of the present invention; Figure 2 This is a grayscale histogram of the shaded area provided in Embodiment 1 of the present invention; wherein, Figure 2 (a) in the image is the original image. Figure 2 (b) in the image is the grayscale histogram at the first position. Figure 2 (c) in the image is the grayscale histogram at the second position. Figure 2 (d) in the figure represents the grayscale histogram at the 3rd position; Figure 3 This is a schematic diagram of the structure of the two-stage auxiliary gradient model provided in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the second-stage training process provided in Embodiment 1 of the present invention; Figure 5 This is a schematic diagram of a shadow restoration system provided in Embodiment 2 of the present invention; Figure 6 This is a schematic diagram of a two-stage assisted gradient model training system provided in Embodiment 4 of the present invention; Figure 7 This is a schematic diagram of a computer device provided in Embodiment 5 of the present invention. Detailed Implementation

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0033] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0034] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0035] Example 1: This implementation proposes a shadow restoration method. Taking retinal shadow region localization and restoration as an example, the image used is a B-Scan image of the retina. By utilizing strategies such as segmentation masks, natural prior knowledge, artificially synthesized shadows, and auxiliary training branches, high-precision restoration is achieved while preserving the original structure. The process includes the following steps: Obtain the OCT image to be processed, and preprocess the OCT image; The pre-trained two-stage auxiliary gradient model is used to perform shadow restoration on the pre-processed OCT image, resulting in a shadow-restored OCT image. The training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0036] More specifically, two-stage assisted gradient model training methods, such as Figure 1 As shown, K B-Scan images of the eye are acquired, i=0; dataset selection is performed. When a shadow area exists, the current image is saved, and it is determined whether i is greater than or equal to k. When no shadow area exists, it is determined whether i is greater than or equal to k. When i is less than k, i=i+1, and the dataset selection is continued. When i is greater than or equal to k, the dataset is segmented according to the standard, a two-stage restoration network model is established, and a loss function is set. Artificially synthesized shadow and natural image shadow datasets are introduced for model training, and shadow restoration of eye B-Scan images is performed.

[0037] More specifically, it includes the following processes: (1) B-Scan image preprocessing.

[0038] Speckle noise exists in B-Scan images of the eye, so a Gaussian filter is first used for smoothing to reduce the impact of speckle noise on edge information. Secondly, to improve the robustness of the shadow restoration method, B-Scan images with different shadow levels need to be selected. Because the blood vessels in the B-Scan images are of uneven thickness, the degree of incident light absorption varies, resulting in different shadow area sizes and pixel values.

[0039] To more efficiently find B-Scan images containing vascular shadows, this implementation proposes an adaptive threshold template matching method for finding shadow images with different brightness levels. The calculation method is as follows: (1); (2); (3); In the formula: P for T Test the confidence level. w and h For the width and height of the image, The mean of pixel samples in the template image. To match the mean of pixel samples in the image, The standard deviation of the template image samples. To match the standard deviation of the image samples, The number of pixels in the template image. To match the number of pixels in the matching region of the image, For template image, for The one-dimensional expansion vector, pixel value of a point To match the pixel values ​​of the region, for A one-dimensional expanded vector.

[0040] Specifically, the mean of the matching region is first tested, and the pixel distribution patterns of different shadow regions show common patterns. Figure 2 (As shown). The template pixels and the matching region pixels are normalized. At this point, it is assumed that there is no significant difference between the template image and the matching region. The difference between the template pixels and the matching region is then calculated. V ,when V Images smaller than a given threshold are included in the dataset; otherwise, they are discarded. Take the negative cosine similarity between the template vector and the matching region vector. Added as an adaptive adjustment factor V In the calculation, if V If the value is less than a given threshold, the image is included in the dataset; otherwise, it is discarded.

[0041] (2) Dataset creation.

[0042] After obtaining B-Scan images with varying degrees of shadow depth, data augmentation is performed on the original images to expand the dataset and increase the model's generalization ability. Affine transformations, perspective transformations, contrast adjustments, and random occlusion are used to increase the diversity of the training data. The augmented dataset is then segmented and labeled, with auxiliary segmentation and labeling tools used to label the B-Scan shadow regions. The labeled data is used for B-Scan shadow region segmentation, and the segmented mask images are used to restore the model's constrained recovery regions.

[0043] In the reconstruction model, there is a problem that the original image labels are difficult to obtain. This invention proposes a random artificial shadow generation method by simulating the contour shape of the segmentation model mask. The calculation formula is as follows: (4); (5); (6); (7); In the formula: To generate a set of contour points, To generate contour points, To control the random number of the contour amplitude, Random numbers used to control the rate of change in the contour. For the number of points, The initial center point is random. and The respective oscillation radius exist and The magnitude of the direction. Different brightness levels are assigned to the generated region. To simulate the unevenness of brightness, a Gaussian blur is applied to the filled region, as shown in the following formula: (8); (9); In the formula: To fill areas with uneven shadows, For Gaussian kernel, To form a uniform shaded area, For the original image data, The image represents the input model. This represents convolution. The eye B-Scan image is recovered based on the artificially synthesized shadow training model described above.

[0044] (3) Model design.

[0045] Figure 3In the `Resnet_Block`, the feature extraction module consists of 1x1 convolutions (Conv1*1), 3x3 convolutions (Conv3*3), batch normalization, and an activation function (ReLU). `SW_Block` represents the feature extraction module including self-attention and cross-attention, composed of layer normalization, window attention mechanism (W-MSA), sliding window attention mechanism (SW-MSA), and multilayer perceptron (MLP). Here, `Downsample` is the downsampling operation, `Upsample` is the upsampling operation, `contact` is the stacking operation along the channel dimension, `interpolate` is the interpolation operation, `flatten` is the flattening operation, `sum` is the summation operation along the channel dimension, and `skip` is the skip connection operation. `x` and `x0~xn` represent the two-dimensional input feature map information, and `v` and `v0~vn` represent the input feature map data during the encoding-decoding process, which are transformed into feature vectors by the `flatten` operation for attention calculation.

[0046] Figure 3 In the first stage, a segmentation model is constructed using ResNet50 as the backbone feature extraction network to jointly construct features from each level. During the forward propagation of the network, the original image is downsampled and channel-expanded before the feature map is fed into the ResNet_Block. Each Block contains BatchNorm normalization, Conv1*1 convolution, Conv3*3 convolution feature extraction, residual connections, and ReLU activation. The entire backbone network undergoes three downsampling operations during forward propagation, generating four feature maps at different scales. Each downsampling halves the image's width and height but doubles the number of features along the channel direction, i.e., the original input dimension (B,C,H,W) becomes (B,2C,H / 2,W / 2), where B is the number of images fed into the network at one time, C is the number of feature map channels, and H and W represent the image's height and width. The feature fusion module (interpolate and sum merge) fuses the features from the three feature layers and distributes the fused features to the auxiliary head to calculate the loss with the corresponding size detection head, thereby increasing the model's accuracy.

[0047] The first-stage segmentation task yields a binarized mask region, which is then superimposed on the original image along the feature map channel as the input image for the second stage.

[0048] In the second stage, an encoder-decoder model is used. An encoding and decoding process centered on SW_Block is constructed to enable interaction between shadow and background pixels. SW_Block includes W-MSA and SW-MSA attention modules, an MLP feedforward network, and a Layernormalization layer. In the encoder stage, W-MSA and SW-MSA are used to extract the full receptive field from the feature map. In the decoder stage, the image is upsampled and reconstructed using the encoder's feature vectors. At this stage, the W-MSA and SW-MSA modules acquire global information from the feature map during decoding, further constraining the coherence of the restored region structure. To further improve gradient backpropagation efficiency, a vector feature fusion module (flattening, interpolating, and summing) fuses multi-level features from the encoder and adds them to the auxiliary decoder head for loss calculation.

[0049] In the two-stage shadow restoration task, the first-stage model provides a high-precision binary mask for the second-stage restoration task through segmentation. Based on the masking mechanism, the restoration model's ability is constrained, no longer altering global pixel information, and achieving high preservation of background region pixels, thereby maximizing the invariance of structural information during retinal shadow restoration.

[0050] (4) Training strategies.

[0051] In the first stage of training, the vanishing gradient problem caused by small region segmentation leads to the model minimizing the training loss by predicting the entire image as the background. To balance the significant imbalance between positive and negative samples (positive samples account for approximately 5%, sometimes less than 1%), a combination of Focal-loss and Dice-loss is introduced to enhance the model's ability to learn positive sample regions. The loss function is shown below: (10); (11); (12); (13); In the formula: For the output value, For label values, These are the weighting coefficients. for , To prevent the constant 1e from having a denominator of zero -5 , For the first Focal-loss of a single detection head, For the first Focal-loss of auxiliary heads, For the first Dice-loss detection head, For the first An auxiliary head, Dice-loss.

[0052] In the second phase of training, the model is guided by natural prior knowledge by learning the distribution patterns of shadows in natural images. Figure 4 (As shown) This further enhances the perception of shadows in B-Scan images. Since the label files for B-Scan images are unavailable, the artificial synthesis method in step two is needed to add shadows, and the image with added shadows is used as the model input. Model training loss As shown in the following formula: (14); (15); In the formula, For the total batch size in each iteration, and This represents the model output value and label value for the nth batch. This is the decoding head loss value. This is the loss value for the auxiliary decoding head.

[0053] Example 2: like Figure 5 As shown, this implementation provides a shadow restoration system, including: The OCT image acquisition unit is configured to: acquire an OCT image to be processed and preprocess the OCT image; The shadow restoration unit is configured to perform shadow restoration on the preprocessed OCT image using a pre-trained two-stage auxiliary gradient model, resulting in a shadow-restored OCT image; wherein, the training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0054] It is understood that the aforementioned units can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The aforementioned units are based on logical functional division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the system may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0055] According to another embodiment of this application, the system described in this embodiment, and the method of embodiment 1 of this application, can be constructed and the method of embodiment 1 of this application implemented by running a computer program (including program code) capable of performing the steps involved in the corresponding method described in embodiment 1 on a general-purpose computing device including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, loaded into the aforementioned computing device through the computer-readable recording medium, and run therein.

[0056] Example 3: This implementation provides a two-stage auxiliary gradient model training method, which is used for OCT image shadow restoration, and includes the following process: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0057] For detailed information, please refer to the training process description in Example 1, which will not be repeated here.

[0058] Example 4: like Figure 6 As shown, this implementation provides a two-stage assisted gradient model training system. The two-stage assisted gradient model is used for OCT image shadow restoration, including: The training set construction unit is configured to: acquire multiple OCT images as training images, preprocess the training images, select training images with different shadow levels, and expand and construct the training set based on the training images with different shadow levels; The two-stage training unit is configured to: minimize the training loss in the first stage of training by introducing a positive-negative sample balance based on the training set; and conduct the second stage of training by using natural prior knowledge and combining artificially synthesized training image shadows.

[0059] It is understood that the aforementioned units can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The aforementioned units are based on logical functional division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the system may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0060] According to another embodiment of this application, the system described in this embodiment, and the method of embodiment 1 of this application, can be constructed and the method of embodiment 1 of this application implemented by running a computer program (including program code) capable of performing the steps involved in the corresponding method described in embodiment 1 on a general-purpose computing device including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, loaded into the aforementioned computing device through the computer-readable recording medium, and run therein.

[0061] Example 5: like Figure 7 As shown, this implementation provides an electronic device including a processor 1001, a communication interface 1002, and a computer-readable storage medium 1003. The processor 1001, communication interface 1002, and computer-readable storage medium 1003 can be connected via a bus or other means.

[0062] The communication interface 1002 is used to receive and send data. The computer-readable storage medium 1003 can be stored in the memory of the electronic device. The computer-readable storage medium 1003 is used to store computer programs, which include program instructions. The processor 1001 is used to execute the program instructions stored in the computer-readable storage medium 1003.

[0063] The processor 1001 (or CPU (Central Processing Unit)) is the computing and control core of electronic devices. It is suitable for implementing one or more instructions, specifically for loading and executing one or more instructions to achieve corresponding methods or functions.

[0064] The processor 1001 is configured to perform the following shadow restoration process: Obtain the OCT image to be processed, and preprocess the OCT image; The pre-trained two-stage auxiliary gradient model is used to perform shadow restoration on the pre-processed OCT image, resulting in a shadow-restored OCT image. The training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows. Alternatively, the following two-stage auxiliary gradient model training process can be performed: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0065] Example 4: This implementation provides a computer-readable storage medium (Memory), which is a memory device in an electronic device used to store programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the electronic device and extended storage media supported by the electronic device. The computer-readable storage medium provides storage space that stores the processing system of the electronic device.

[0066] Furthermore, this storage space also contains one or more instructions suitable for loading and execution by the processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM memory or unstable memory, such as at least one disk storage device; optionally, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.

[0067] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor loads and executes the one or more instructions stored in the computer-readable storage medium to perform the following shadow recovery process: Obtain the OCT image to be processed, and preprocess the OCT image; The pre-trained two-stage auxiliary gradient model is used to perform shadow restoration on the pre-processed OCT image, resulting in a shadow-restored OCT image. The training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows. Alternatively, the training process of the two-stage auxiliary gradient model can be implemented as follows: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0068] Example 5: This implementation provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the following shadow recovery process: Obtain the OCT image to be processed, and preprocess the OCT image; The pre-trained two-stage auxiliary gradient model is used to perform shadow restoration on the pre-processed OCT image, resulting in a shadow-restored OCT image. The training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows. Alternatively, the following two-stage auxiliary gradient model training process can be performed: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

[0069] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0070] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data processing device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0071] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A shadow restoration method, characterized in that, Includes the following processes: Obtain the OCT image to be processed, and preprocess the OCT image; The pre-trained two-stage auxiliary gradient model is used to perform shadow restoration on the pre-processed OCT image, resulting in a shadow-restored OCT image. The training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

2. The shadow restoration method as described in claim 1, characterized in that, Training images with different levels of shadow were selected, including: A mean test is performed on the matching regions of the region to be matched and the template region. The pixels of the template region and the pixels of the region to be matched are normalized. T The test determines the magnitude of the significant difference between the two at the level of the data mean; when T When the confidence level is greater than a set threshold, it is considered that there is no significant difference between the template image and the matching region. At this point, the difference value between the template pixels and the matching region is calculated. V ,when V If the image is less than a given threshold, it is included in the dataset; otherwise, it is discarded. when T When the confidence level is less than or equal to a set threshold, the negative cosine similarity between the template vector and the matching region vector is used. Added as an adaptive adjustment factor V In the calculation, if V If the value is less than a given threshold, the image is included in the dataset; otherwise, it is discarded.

3. The shadow restoration method as described in claim 1, characterized in that, During the first phase of training, the loss function for: ; in, For the output value, For label values, These are the weighting coefficients. For the first Focal-loss of a single detection head. For the first Focal-loss of auxiliary heads, For the first Dice-loss detection head, For the first An auxiliary head, Dice-loss.

4. The shadow restoration method as described in claim 1, characterized in that, In the second stage of training, natural images with shadows and training images with artificially synthesized shadows are used as inputs, and the loss function is... for: , ,in, N For the total batch size in each iteration, and Indicates the first n The model outputs and labels in batches. This represents the loss value of the auxiliary decoder.

5. The shadow restoration method as described in claim 4, characterized in that, Artificially synthesized shadows simulate the outline shape of the segmentation model mask: , , , ,in, To generate a set of contour points, To generate contour points, A To control the random number of the contour amplitude, f Random numbers used to control the rate of change in the contour. For the number of points, The initial center point is random. and The magnitude of the oscillation radius in the x and y directions; Different brightness levels are assigned to the generated regions, and Gaussian blur is applied to the filled regions to simulate brightness non-uniformity, including: , In the formula, To fill areas with uneven shadows, For Gaussian kernel, for Uniform binarized mask image after filling the set of points. For the original image data, The image represents the input model. This represents convolution.

6. A shadow restoration system, characterized in that, include: The OCT image acquisition unit is configured to: acquire an OCT image to be processed and preprocess the OCT image; The shadow restoration unit is configured to perform shadow restoration on the preprocessed OCT image using a pre-trained two-stage auxiliary gradient model, resulting in a shadow-restored OCT image; wherein, the training of the two-stage auxiliary gradient model includes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, in the first stage of training, the training loss is minimized by introducing a positive and negative sample balance; the second stage of training is conducted by using natural prior knowledge as guidance and combining artificially synthesized training image shadows.

7. A two-stage assisted gradient model training method, characterized in that, The two-stage auxiliary gradient model is used for OCT image shadow restoration. Includes the following processes: Multiple OCT images are acquired as training images. After preprocessing the training images, training images with different shade levels are selected, and the training set is expanded based on the training images with different shade levels to construct a training set. Based on the training set, during the first stage of training, the training loss is minimized by introducing a positive and negative sample balance. The second stage of training is conducted by using prior knowledge of nature as a guide and combining it with artificially synthesized shadows in the training images.

8. A computer device, characterized in that, include: Processor and computer-readable storage media; A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the shadow recovery method as described in any one of claims 1 to 5; or implements the two-stage assisted gradient model training method as described in claim 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and execute the shadow recovery method as described in any one of claims 1 to 5; or, execute the two-stage assisted gradient model training method as described in claim 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the shadow recovery method as described in any one of claims 1 to 5; or implements the two-stage assisted gradient model training method as described in claim 7.