Retinal blood vessel segmentation method based on structure-adaptive context-sensitive
By introducing the structure adaptive layer, hole residual path and adaptive feature fusion module into the fully convolutional neural network, combined with the multi-scale deep supervision mechanism, the shallow overfitting and overfitting of the fully convolutional neural network in retinal blood vessel segmentation are solved. It solves the problem of insufficient extraction of deep details and achieves higher accuracy and robustness of blood vessel segmentation.
Patent Information
- Application Number
- CN202311542338.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-11-17
AI Technical Summary
Existing fully convolutional neural networks have problems such as overfitting in shallow layers, inability to extract details in deep layers, insufficient capture of semantic gaps, and network degradation in retinal blood vessel segmentation, resulting in poor capillary segmentation results.
The structure adaptive layer, hole residual path and adaptive feature fusion module are used, combined with a multi-scale deep supervision mechanism, to dynamically adjust the network structure and feature extraction to improve the ability to capture blood vessel details and multi-scale information.
It significantly improves the accuracy and robustness of retinal blood vessel segmentation, enhances the prediction ability of capillaries, and improves the network's processing capabilities in complex backgrounds.
Smart Images

Figure CN117689669B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image feature extraction and segmentation methods, and in particular to a semantic segmentation method of retinal vascular medical images based on a structure-adaptive context-sensitive network. Background Art
[0002] Fully convolutional neural networks (FCNs) have dominated the field of image segmentation, especially semantic segmentation, because they can accept input images of any size, have high computing speed, and can achieve pixel-level image segmentation effects.
[0003] A lot of experiments have been done on fully convolutional neural networks. Since FCN in 2015, a number of classic models have been produced, such as UNet and UNet-like structures. These models are based on FCN and continuously deepen the number of network layers to improve the segmentation accuracy of the network. Although the above models have gradually improved the quality of blood vessel segmentation, for capillaries, problems such as vascular breakpoints, missing bifurcations, and structural misprediction are still challenges.
[0004] In order to achieve high-precision retinal blood vessel segmentation, a large number of existing segmentation models were analyzed, studied and compared. It was found that there are generally three limitations: 1) Codecs at different layers need to extract or restore features from feature maps with different resolutions and semantic depths. Using the same structure for all layers may result in shallow codecs being overfitted, while deep codecs still cannot extract or restore enough details, which ultimately leads to poor local blood vessel prediction. 2) The high-level feature maps output by the encoder often contain rich location information, but existing models do not extract enough features. Although the jump connection compensates for the loss of spatial information caused by downsampling to a certain extent, it ignores the semantic gap between high- and low-level features, and connecting the underlying features will introduce inaccurate spatial information. The network fails to extract sufficient and accurate information, and its sensitivity decreases, resulting in misjudgment of blood vessel prediction. 3) As the number of network layers increases, the network feature extraction capability increases, but at the same time, the network may also degenerate, and the deep network no longer plays its due role, which ultimately leads to a decrease in the model's ability to predict capillaries. Therefore, if a segmentation model can be designed to address the above limitations so that the fully convolutional network can segment retinal blood vessels more accurately, it will make it possible to further apply the fully convolutional network in the diagnosis and treatment of retinal diseases.
[0005] CN116205870A-A high-precision retinal blood vessel segmentation network structure and method, comprising the following steps: S1. Preprocessing the retinal blood vessel image to obtain preprocessed image information; S2. Slicing the preprocessed image information; S3. Dividing the sliced image information into labeled data and unlabeled data; S4. Constructing a convolutional neural network and training the convolutional neural network: S5. The retinal blood vessel image acquired in real time is processed through steps S1 and S2 and then input into the trained convolutional neural network for processing, and the blood vessel segmentation result is output.
[0006] The deformable convolution module is based on the classic codec architecture. The encoder uses a pre-trained resnet34 model, and the decoder performs upsampling layer by layer through transposed convolution. The advantage of this module is that it can learn receptive fields of different scales and adapt to blood vessels of different shapes and sizes, but it also has some disadvantages, such as:
[0007] o The pre-trained ResNet34 model may not be applicable to all retinal image datasets, because different datasets may have different characteristics such as resolution, contrast, noise, etc., resulting in a decrease in the generalization ability of the model.
[0008] oThe upsampling process of transposed convolution may produce checkerboard artifacts, affecting the quality of segmentation.
[0009] o Deformable convolution has more parameters and requires more computing resources and training time.
[0010] The multi-scale adaptive detail feature fusion module adaptively fuses multi-scale features before skip connection, fully captures detail features of different scales, and alleviates the loss of detail information. The advantage of this module is that it can improve the accuracy and robustness of segmentation, but it also has some disadvantages, such as:
[0011] oScaling operations, including upsampling, downsampling, and copying operations, may cause redundancy or distortion of some information.
[0012] oThe channel concat operation may increase the dimension of the feature map, resulting in increased computation.
[0013] o The 1×1 convolution operation may ignore some spatial information, resulting in discontinuity in segmentation.
[0014] The dual-path upsampling module captures high-resolution feature maps in both space and channels, and uses deformable convolution to learn the fused high-resolution feature maps to reduce the loss of spatial and channel information during the upsampling process. The advantage of this module is that it can restore image resolution and improve segmentation clarity.
[0015] But there are also some disadvantages, such as:
[0016] o The PixelShuffle operation may cause confusion of some detail information and affect the accuracy of segmentation.
[0017] The disadvantages of deformable convolution also exist here, such as many parameters, large amount of calculation, and long training time.
[0018] In the present invention,
[0019] As the basic unit of the network, the structured adaptive layer (SAL) uses the residual structure to deepen the number of network layers and extract more detailed features of retinal blood vessels. It has a certain degree of adaptability and can choose whether to skip the residual layer according to the training effect of each layer, thereby achieving autonomous adjustment of the network structure.
[0020] As a module added in the skip layer, the AR Path uses dilated convolution to fill the semantic gap and improve the fusion of high-level and low-level features. Dilated convolution can expand the receptive field and capture multi-scale retinal vascular feature information without increasing the amount of calculation and parameters. In this way, the network can better handle blood vessels of different sizes and shapes, and improve the detail and completeness of segmentation.
[0021] Adaptive feature fusion (AFF) is a module used in the feature fusion stage. It obtains the weight vector by applying the attention mechanism to the feature map after the high-level features and low-level features are concatenated, and then redistributes the pixel weights of the low-level features and performs additive fusion with the high-level features. This module can effectively combine the advantages of additive fusion and concatenated fusion, while realizing dynamic screening of vascular and non-vascular areas. In this way, the network can better utilize the feature information at different levels and improve the accuracy and robustness of segmentation.
[0022] Multi-scale deep supervision (MDS) is a module introduced on the output side. It takes each layer of the decoder as output and includes it in the loss function with a certain weight. You use Dice Loss as the loss function to effectively deal with the problem of severe imbalance between positive and negative samples.
[0023] This module can greatly improve the learning effect of deep networks through deep supervised training techniques, thereby achieving an overall improvement in the accuracy of retinal vessel segmentation. Summary of the invention
[0024] The present invention aims to solve the above problems of the prior art. A retinal blood vessel segmentation method based on structure-adaptive context-sensitive is proposed. The technical solution of the present invention is as follows:
[0025] A retinal blood vessel segmentation method based on structure-adaptive context-sensitive includes the following steps:
[0026] First, the dataset is preprocessed including grayscale, normalization, contrast-limited adaptive histogram equalization, and gamma correction. Then, the training set is segmented to complete data enhancement. The segmented dataset is randomly shuffled and divided into training set, validation set, and test set in a ratio of 8:1:1. Then, a fully convolutional neural network architecture consisting of a left-side contraction path and a right-side expansion path is built. Finally, a structure-adaptive layer is used to replace the convolution layer to replace the ordinary convolution, the jump layer introduces the proposed hole residual path, and an adaptive feature fusion module is added to the decoder. In addition, a multi-scale deep supervision mechanism is introduced to obtain a structure-adaptive context-sensitive network, and the test data is input into the network for fast testing to complete image segmentation.
[0027] Furthermore, the preprocessing of the data set, including grayscale conversion, normalization, contrast-limited adaptive histogram equalization, and gamma correction, specifically includes:
[0028] The first algorithm used is the weighted average algorithm of R, G, and B components, and its expression is:
[0029] Gray(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j)
[0030] Among them, R(i,j), G(i,j), and B(i,j) represent the values of the red, green, and blue channels of the pixel with coordinates (i,j), respectively, and Gray(i,j) represents the gray value of the pixel with coordinates (i,j) after weighted average calculation;
[0031] Then, the z-score standardization method is used to standardize the grayscale image and scale the image data, which is expressed as:
[0032]
[0033] Among them, μ represents the mean value of the pixel point in each dimension, and σ represents the mean square error of the pixel point in each dimension;
[0034] Next, for the standardized image, under the premise of ensuring that the histogram distribution can be transformed into an approximately uniform distribution, a threshold δ is set to limit the histogram distribution to restrictively enhance the image contrast; at the same time, bilinear interpolation is used to speed up the histogram equalization process in the pixel mapping process; then the image V after CLAHE is continued inThe gamma curve is used for nonlinear tone editing to identify the foreground and background parts of the image signal and increase the ratio between the two, thereby improving the contrast of the image. Finally, in order to avoid negative, excessive, and nan loss values during network training, the pixel values on the image are normalized and mapped to between 0 and 1.
[0035] Furthermore, the image size segmentation of the training set to complete data enhancement is specifically as follows:
[0036] For the training set, first set the width and height of the patch image, patch_width and patch_height, as well as the image segmentation step length, stride_height and stride_width, to satisfy the following relationship:
[0037]
[0038] Among them, a data image patch with a size of 64×64 is cut from the original image with a step size of 16; finally, starting from the upper left corner of the input original image, the patch image is extracted cyclically according to the principle of "from top to bottom and from left to right".
[0039] Furthermore, the construction of a fully convolutional neural network architecture consisting of a left contraction path and a right expansion path is specifically:
[0040] A structural adaptation layer with a residual structure as the core is proposed, which consists of a residual part and a mapping part; the residual part contains two layers of convolution with a kernel size of 3×3. There is a BN layer after each convolution to normalize the input distribution. A Dropout layer is added after the BN layer. The activation function of the first convolution layer is after the Dropout layer, and the activation function of the second convolution layer is added after the feature image fusion as the activation function of the entire residual network. The activation function uses ReLu; the expression of the residual part is:
[0041]
[0042] Where x∈R H×W×C Represents the input feature image, y∈R H×W×C Represents the output feature image, Conv 3×3 represents a convolution operation with a convolution kernel size of 3×3, Represents the batch normalization operation, γ and β represent two trainable parameters in the batch normalization layer; δ represents the nonlinear activation function ReLu, represents the random dropout layer, .
[0043] The mapping part uses a direct mapping method to transfer the feature image before the input residual network to the end of the residual structure and fuse it to realize the residual block structure; the residual block is expressed as:
[0044] y Res =F{δ(D(F(x)))}
[0045] Finally, the expression of the structure adaptation layer is:
[0046] y SAL =δ(Conv 3×3 (x0)+y Res )
[0047] The obtained structure adaptation layer is applied to the constructed full convolutional neural network architecture to replace the convolution layer to replace the ordinary convolution. According to the training results of each round, the network gradually learns the encoder and decoder structures that are more suitable for the task.
[0048] Furthermore, the proposed hole residual path is introduced in the skip layer to dynamically adjust the receptive field, specifically:
[0049] A dilated residual path is proposed, which is composed of a convolution with a kernel size of 1×1 and a dilated convolution with a kernel size of 3×3 and a dilation rate of 2. The dilated residual path is expressed as:
[0050]
[0051] Where x∈R H×W×C represents the input feature image, y ARPath ∈R H×W×C Represents the output feature image, Conv 3×3,r=2 represents the convolution operation with a kernel size of 3×3, and r represents the expansion rate of 2; Represents the batch normalization operation, γ and β represent two trainable parameters in the batch normalization layer; Conv 1×1 Represents a convolution operation with a convolution kernel size of 1×1; the atrous residual path replaces ordinary convolution with atrous convolution, which deepens the semantics of shallow features and expands the receptive field, while capturing multi-scale retinal vascular feature information.
[0052] Furthermore, the step of adding an adaptive feature fusion module to the expansion path is as follows:
[0053] An adaptive feature fusion module is added to the expansion path to receive feature images from the void residual connection and upsampling respectively, and perform feature screening and fusion on them. The key lies in the Squeeze-and-Excitation compression and excitation operation and the acquisition of weight vectors. In the Squeeze operation, the network encodes each pixel space feature value into a global feature through global average pooling. Secondly, in Excitation, the network will restore the channel features by compressing and tiling the obtained global features twice and stretching them again. Specifically, the network uses the first fully connected layer to reduce the dimension, and then restores the dimension through the second fully connected layer. Finally, the learned feature relationship is activated with Sigmoid to obtain the weight coefficient. It is multiplied element by element with the original feature image so that the network can obtain the feature relationship of each channel.
[0054] Further, the Squeeze-and-Excitation is expressed as:
[0055]
[0056] Among them, σ represents the nonlinear activation function Sigmoid; It represents two fully connected layers with different number of channels; represents global average pooling;
[0057] Furthermore, when obtaining the weight vector, in order to include multi-scale information in the weight vector, the high-level feature image after upsampling of the output of the higher-level decoder in the expansion path and the low-level feature image output by the hole residual path are first concatenated into a new feature image, which is then sent to the Squeeze-and-Excitation module. Its output passes through the convolution adjustment channel of the 1×1 convolution kernel, performs global average pooling (GAP), and then passes through Sigmoid activation to form a weight vector. The whole process of obtaining the weight vector is expressed by the equation:
[0058]
[0059] Among them, x high,low Represents the high-level features from upsampling and the low-level features output by the hole residual path. It represents the Squeeze-and-Excitation operation. ⊙ represents the concatenation of feature images;
[0060] Finally, the weight vector is multiplied element by element with the low-level feature image, and then added and fused with the high-level feature image to achieve adaptive feature fusion. The final adaptive feature fusion module can be specifically expressed as follows:
[0061]
[0062] in, Represents the element-by-element multiplication of two feature information matrices.
[0063] Furthermore, the multi-scale deep supervision mechanism is introduced. The multi-scale deep supervision module first restores the output of each encoder layer to the original resolution by upsampling and channel change once or multiple times, which is expressed as:
[0064]
[0065] Among them, x i ,y i Represents the feature image of the i-th layer of the decoder and the predicted image of the i-th layer output; Conv 1×1 Represents a convolution operation with a convolution kernel size of 1×1; Indicates n consecutive upsamplings, where n is the number of upsamplings required to restore to the original resolution;
[0066] Finally, all side branch outputs participate in the calculation of the final loss function to achieve the purpose of effectively training the deep network; Dice Loss is used as the loss function during training, and its calculation formula and the final loss function L total Specifically expressed as:
[0067]
[0068] Where pred, true, and smooth represent the set of model prediction values, the set of true values corresponding to the model prediction results, and a very small value, whose main function is to prevent the denominator from being zero; a i Indicates the weight of the loss of the i-th layer; L i Dice represents the loss of the i-th layer; n represents that there are n layers of side branch outputs in the model;
[0069] The obtained structure-adaptive context-sensitive network is input with the image data to be tested, and finally high-precision segmentation of retinal vascular medical images is achieved.
[0070] The advantages and beneficial effects of the present invention are as follows:
[0071] The present invention utilizes a high-performance and lightweight fully convolutional neural network as the basic network model, and proposes an improved structural adaptive context-sensitive network model, thereby effectively improving the segmentation accuracy of retinal blood vessels.
[0072] Compared with the original structure, the present invention uses the proposed structural adaptive layer to replace the convolution layer, uses the residual structure to deepen the number of layers of the network, extracts more retinal vascular detail features, and has a certain degree of adaptability. According to the training effect of each layer, it can choose whether to skip the residual layer, thereby realizing the autonomous adjustment of the network structure; adding a hole residual path in the jump layer to realize the extraction of multi-scale information, while not increasing the network calculation amount and parameter amount, reducing the semantic gap with the lower layer, and improving the meticulousness and completeness of the segmentation; the introduced adaptive feature fusion module suppresses redundant noise by screening low-level information, fully integrates low-level semantic information and high-level spatial information, effectively combines the advantages of additive fusion and splicing fusion, and realizes dynamic screening of blood vessels and non-vascular areas at the same time; introduces multi-scale deep supervision in the decoder layer, incorporates each layer of the decoder into the calculation of the loss function, improves the deeper learning effect of the model, and realizes the overall improvement of the retinal vascular segmentation accuracy. The above improvement measures enable the present invention to effectively improve the segmentation accuracy of retinal blood vessels, and the structure is reasonable, and improves the ability of the network to process blood vessels with large morphological differences under complex backgrounds and the accuracy of terminal capillary segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 It is a flow chart of a retinal vessel segmentation method based on a structure-adaptive context-sensitive network according to a preferred embodiment of the present invention.
[0074] Figure 2 The overall structure diagram of the structure adaptation layer of the structure adaptive context sensitive network.
[0075] Figure 3 The overall structure diagram of the hole residual path of the structure-adaptive context-sensitive network.
[0076] Figure 4 The overall structure diagram of the adaptive feature fusion module of the structure-adaptive context-sensitive network. Structure-adaptive context-sensitive network. DETAILED DESCRIPTION
[0077] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
[0078] The technical solution of the present invention to solve the above technical problems is:
[0079] like Figure 1 As shown, the retinal blood vessel segmentation method using a structure-adaptive context-sensitive network provided in this embodiment includes the following steps:
[0080] Step 1: First, perform a weighted average algorithm on the R, G, and B components of the image; then use the z-score standardization method to standardize the grayscale image and scale the image data; then, for the standardized image, set a threshold δ to limit the histogram distribution while ensuring that the histogram distribution can be transformed into an approximately uniform distribution to restrictively enhance the image contrast, thereby avoiding excessive enhancement of amplified noise and eliminating the imbalance of block edge transitions. At the same time, bilinear interpolation is used to speed up the histogram equalization process during the pixel mapping process. Then continue to perform nonlinear tone editing on the gamma curve of the image, identify the foreground and background parts of the image signal, and increase the ratio of the two, thereby improving the image contrast. Finally, in order to avoid negative, excessive, and nan loss values during network training, the pixel values on the image are normalized and mapped between 0 and 1. Among them, the formula of the weighted average algorithm is:
[0081] Gray(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j) (1)
[0082] The formula for z-score is:
[0083]
[0084] Step 2: For the training set, first set the width and height of the patch image, patch_width and patch_height, as well as the image segmentation step length, stride_height and stride_width, to satisfy the following relationship:
[0085]
[0086] Among them, a data image patch with a size of 64×64 is cut from the original image with a step size of 16. Finally, starting from the upper left corner of the input original image, the patch image is extracted cyclically according to the principle of "from top to bottom and from left to right".
[0087] Step 3: Use the proposed structured adaptive layer to replace the convolution layer to replace the ordinary convolution, and build a fully convolutional neural network architecture consisting of a contraction path (left side) and an expansion path (right side) to improve the learning efficiency of the network. Specifically:
[0088] like Figure 2As shown in the figure, a structural adaptation layer with a residual structure as the core is proposed, which is mainly composed of a residual part and a mapping part. The residual part contains two layers of convolution with a kernel size of 3×3. There is a BN layer after each convolution to normalize the input distribution, so that the activation function can work better. A Dropout layer is added after the BN layer to avoid the problem of network overfitting. The activation function of the first layer of convolution is after the Dropout layer, and the activation function of the second layer of convolution is added after the feature image fusion as the activation function of the entire residual network. The activation function uses ReLu. The mapping part uses a direct mapping method to transfer the feature image before the input residual network to the end of the residual structure and fuse it to realize the residual block structure. Finally, the structural adaptation layer is obtained as shown in the equation expression:
[0089] y SAL =δ(Conv 3×3 (x0)+y Res )
[0090] Among them, δ represents the nonlinear activation function ReLu, y Res represents the residual structure function.
[0091] Step 4: In order to dynamically adjust the receptive field, the proposed hole residual path is introduced in the skip layer of the fully convolutional network constructed in step 3. Specifically:
[0092] like Figure 3 As shown in the figure, a dilated residual path consisting of a convolution with a kernel size of 1×1 and a dilated convolution with a kernel size of 3×3 and a dilation rate of 2 is proposed to obtain a better semantic gap processing effect. The dilated residual path can be expressed as:
[0093]
[0094] Among them, Conv 3×3,r=2 represents a convolution operation with a kernel size of 3×3, and r represents a dilation rate of 2. Represents the batch normalization operation, γ and β represent two trainable parameters in the batch normalization layer. Conv 1×1 Represents a convolution operation with a convolution kernel size of 1 × 1. The dilated residual path replaces ordinary convolution with dilated convolution, which deepens the semantics of shallow features and expands the receptive field, while capturing multi-scale retinal vascular feature information.
[0095] Step 5: Load the pre-trained network model obtained in step 4, add an adaptive feature fusion module to the expansion path, introduce a multi-scale deep supervision mechanism to complete the network construction, and obtain a structurally adaptive context-sensitive network. Specifically:
[0096] like Figure 4As shown in the figure, an adaptive feature fusion module is added to the expansion path to receive feature images from the hole residual connection and upsampling respectively, perform feature screening and fusion on them, and then introduce a multi-scale deep supervision mechanism. The multi-scale deep supervision module first restores the output of each layer of encoder to the original resolution by upsampling and channel change once or multiple times. The principle of the adaptive feature fusion module can be specifically expressed by the following expression:
[0097]
[0098] Among them, x high,low Represents the high-level features from upsampling and the low-level features output by the hole residual path. It represents the Squeeze-and-Excitation operation. ⊙ represents the concatenation of feature images.
[0099] The principle of the multi-scale deep supervision mechanism can be specifically expressed by the following expression:
[0100]
[0101] Among them, pred, true, and smooth represent the set of model prediction values, the set of true values corresponding to the model prediction results, and a very small value, whose main function is to prevent the denominator from being zero. i Indicates the weight of the i-th layer loss. i Dice Represents the loss of the i-th layer. n indicates that there are n layers of side branch outputs in the model.
[0102] Finally, a structure-adaptive context-sensitive network is obtained. Inputting the image data to be tested into the structure-adaptive context-sensitive network can complete image segmentation more efficiently and accurately.
[0103] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0104] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0105] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0106] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. A retinal vessel segmentation method based on structure-adaptive context-sensitive, It is characterized in that The following steps are involved: First, the dataset is preprocessed by grayscale, normalization, contrast-limited adaptive histogram equalization, and gamma correction. Then, the training set is segmented to complete data enhancement. The segmented dataset is randomly shuffled and divided into training set, validation set, and test set in a ratio of 8:1:
1. Then, a fully convolutional neural network architecture consisting of a left contraction path and a right expansion path is built. Finally, a structure-adaptive layer is used to replace the convolution layer to replace the ordinary convolution, the jump layer introduces the proposed hole residual path, and an adaptive feature fusion module is added to the decoder. In addition, a multi-scale deep supervision mechanism is introduced to obtain a structure-adaptive context-sensitive network, and the test data is input into the network for rapid testing to complete image segmentation. The described construction comprises a fully convolutional neural network architecture consisting of a left contraction path and a right expansion path; Specifically: A structural adaptation layer with a residual structure as the core is proposed, which consists of a residual part and a mapping part; the residual part contains two layers of convolution with a kernel size of 3×3. There is a BN layer after each convolution to normalize the input distribution. A Dropout layer is added after the BN layer. The activation function of the first convolution layer is after the Dropout layer, and the activation function of the second convolution layer is added after the feature image fusion as the activation function of the entire residual network. The activation function uses ReLu; the expression of the residual part is: Where x∈R H×W×C Represents the input feature image, y∈R H×W×C Represents the output feature image, Conv 3×3 represents a convolution operation with a convolution kernel size of 3×3, represents the batch normalization operation, γ and β represent two trainable parameters in the batch normalization layer; δ represents the nonlinear activation function ReLu, represents a random dropout layer; The mapping part uses a direct mapping method to transfer the feature image before the input residual network to the end of the residual structure and fuse it to realize the residual block structure; the residual block is expressed as: y Res =F{δ(D(F(x)))} Finally, the expression of the structure adaptation layer is: and SAL =δ(Conv 3×3 (x 0 )+y Res ) The obtained structure adaptation layer is applied to the constructed full convolutional neural network architecture to replace the convolution layer to replace the ordinary convolution. According to the training results of each round, the network gradually learns the encoder and decoder structures that are more suitable for the task.
2. The method for retinal blood vessel segmentation based on structure-adaptive context-sensitive according to claim 1, It is characterized in that The preprocessing of the data set, including grayscale conversion, normalization, contrast-limited adaptive histogram equalization, and gamma correction, specifically includes: The first algorithm used is the weighted average algorithm of R, G, and B components, and its expression is: Gray(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j) Among them, R(i,j), G(i,j), and B(i,j) represent the values of the red, green, and blue channels of the pixel with coordinates (i,j), respectively, and Gray(i,j) represents the gray value of the pixel with coordinates (i,j) after weighted average calculation; Then, the z-score standardization method is used to standardize the grayscale image and scale the image data, which is expressed as: y=x-μ σ Among them, μ represents the mean value of the pixel point in each dimension, and σ represents the mean square error of the pixel point in each dimension; Next, for the standardized image, under the premise of ensuring that the histogram distribution can be transformed into an approximately uniform distribution, a threshold δ is set to limit the histogram distribution to restrictively enhance the image contrast; at the same time, bilinear interpolation is used to speed up the histogram equalization process in the pixel mapping process; then the image V after CLAHE is continued in The gamma curve is used for nonlinear tone editing to identify the foreground and background parts of the image signal and increase the ratio between the two, thereby improving the contrast of the image. Finally, in order to avoid negative, excessive, and nan loss values during network training, the pixel values on the image are normalized and mapped to between 0 and 1.
3. The method for retinal blood vessel segmentation based on structure-adaptive context-sensitive according to claim 1, It is characterized in that The specific steps of performing image size segmentation on the training set to complete data enhancement are as follows: For the training set, first set the width and height of the patch image, patch_width and patch_height, as well as the image segmentation step length, stride_height and stride_width, to satisfy the following relationship: Among them, a data image patch with a size of 64×64 is cut from the original image with a step size of 16; finally, starting from the upper left corner of the input original image, the patch image is extracted cyclically according to the principle of "from top to bottom and from left to right".
4. The method for retinal blood vessel segmentation based on structure-adaptive context-sensitive according to claim 1, It is characterized in that The proposed hole residual path is introduced in the skip layer to dynamically adjust the receptive field, specifically: A dilated residual path is proposed, which is composed of a convolution with a kernel size of 1×1 and a dilated convolution with a kernel size of 3×3 and a dilation rate of 2. The dilated residual path is expressed as: Where x∈R H×W×C represents the input feature image, y ARPath ∈R H×W×C Represents the output feature image, Conv 3×3,r=2 represents the convolution operation with a kernel size of 3×3, and r represents the expansion rate of 2; Represents the batch normalization operation, γ and β represent two trainable parameters in the batch normalization layer; Conv 1×1 Represents a convolution operation with a convolution kernel size of 1×1; the atrous residual path replaces ordinary convolution with atrous convolution, which deepens the semantics of shallow features and expands the receptive field, while capturing multi-scale retinal vascular feature information.
5. The method for retinal blood vessel segmentation based on structure-adaptive context-sensitive according to claim 4, It is characterized in that Adding an adaptive feature fusion module in the expansion path is as follows: An adaptive feature fusion module is added to the expansion path to receive feature images from the void residual connection and upsampling respectively, and perform feature screening and fusion on them. The key lies in the Squeeze-and-Excitation compression and excitation operation and the acquisition of weight vectors. In the Squeeze operation, the network encodes each pixel space feature value into a global feature through global average pooling. Secondly, in Excitation, the network will restore the channel features by compressing and tiling the obtained global features twice and stretching them again. Specifically, the network uses the first fully connected layer to reduce the dimension, and then restores the dimension through the second fully connected layer. Finally, the learned feature relationship is activated with Sigmoid to obtain the weight coefficient. It is multiplied element by element with the original feature image so that the network can obtain the feature relationship of each channel.
6. The method for retinal blood vessel segmentation based on structure-adaptive context-sensitive according to claim 5, It is characterized in that The Squeeze-and-Excitation is expressed as: Among them, σ represents the nonlinear activation function Sigmoid; It represents two fully connected layers with different number of channels; Represents global average pooling.
7. The method for retinal blood vessel segmentation based on structure-adaptive context-sensitive according to claim 5, It is characterized in that When obtaining the weight vector, in order to include multi-scale information in the weight vector, the high-level feature image after upsampling of the output of the higher-level decoder in the expansion path and the low-level feature image output by the hole residual path are first concatenated into a new feature image, which is then sent to the Squeeze-and-Excitation module; its output passes through the convolution adjustment channel of the 1×1 convolution kernel, performs global average pooling (GAP), and then passes through Sigmoid activation to form a weight vector; the whole process of obtaining the weight vector is expressed by the equation: Among them, x high,low Represents the high-level features from upsampling and the low-level features output by the hole residual path; represents the Squeeze-and-Excitation operation, ⊙ represents the concatenation of feature images; Finally, the weight vector is multiplied element by element with the low-level feature image, and then added and fused with the high-level feature image to achieve adaptive feature fusion. The final adaptive feature fusion module can be specifically expressed as follows: in, Represents the element-by-element multiplication of two feature information matrices.
8. The method for retinal blood vessel segmentation based on structure-adaptive context-sensitive according to claim 7, It is characterized in that The multi-scale deep supervision mechanism is introduced. The multi-scale deep supervision module first restores the output of each encoder layer to the original resolution by upsampling and channel change once or multiple times, which is expressed as: Among them, x i ,y i Represents the feature image of the i-th layer of the decoder and the predicted image of the i-th layer output; Conv 1×1 Represents a convolution operation with a convolution kernel size of 1×1; Indicates n consecutive upsamplings, where n is the number of upsamplings required to restore to the original resolution; Finally, all side branch outputs participate in the calculation of the final loss function to achieve the purpose of effectively training the deep network; Dice Loss is used as the loss function during training, and its calculation formula and the final loss function L total Specifically expressed as: Where pred, true, and smooth represent the set of model prediction values, the set of true values corresponding to the model prediction results, and a very small value, whose main function is to prevent the denominator from being zero; a i represents the weight of the loss of the i-th layer; L i Dice represents the loss of the i-th layer; n represents that there are n layers of side branch outputs in the model; The obtained structure-adaptive context-sensitive network is input with the image data to be tested, and finally high-precision segmentation of retinal vascular medical images is achieved.
