Color fundus image micro-hemangioma hyperfine segmentation method based on Transform

Through the ultra-fine segmentation method of microaneurysms in color fundus images based on Transformer, the problems of noise interference and uneven illumination in the early diagnosis of diabetic retinopathy are solved, efficient and accurate microaneurysm detection is achieved, and the diagnostic efficiency and accuracy are improved.

CN118537552APending Publication Date: 2024-08-23YANGTZE DELTA REGION INST (QUZHOU) UNIV OF ELECTRONIC SCI & TECH OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410623391.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing technology has problems such as noise interference, uneven illumination, and difficulty in identifying and segmenting small microaneurysm targets in the early diagnosis of diabetic retinopathy, resulting in low diagnostic efficiency and accuracy.

Method used

A Transformer-based ultra-fine segmentation method for microaneurysms in color fundus images is adopted. Through data preprocessing, multi-level encoder HVMT design, feature extraction module and Focal Tversky Loss function, ultra-fine semantic segmentation of color fundus images is achieved to improve microaneurysm detection. accuracy and efficiency.

Benefits of technology

It effectively reduces noise interference, improves the detection and recognition performance of microaneurysms, increases the fault tolerance and accuracy of segmentation results, solves the problem of class imbalance and boundary details, and improves the early diagnosis ability of diabetic retinopathy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537552A
    Figure CN118537552A
Patent Text Reader

Abstract

The invention belongs to the field of artificial intelligence and computer vision, provides a color fundus image micro-hemangioma hyperfine segmentation method based on Transform, and aims to solve the problems of micro-hemangioma detection and segmentation in medical images, in particular to early diagnosis of diabetic retinopathy. According to the main scheme, the method comprises the steps of data preprocessing, such as green channel extraction, adaptive histogram equalization and denoising; data enhancement and image segmentation; designing a multi-level encoder HVMT and VMT feature extraction module; feature fusion and generation of a microhemangioma probability graph; and a Focal Tversky Loss function is adopted to optimize a segmentation result. The kit is wide in application range, can remarkably improve the detection accuracy and efficiency especially in assisting early diagnosis of diabetic retinopathy, and has important significance on public health and scientific research.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the fields of artificial intelligence and computer vision, and relates to a Transformer-based ultra-fine segmentation method for microaneurysm in color fundus images. Background Art

[0002] With the surge in the number of diabetes patients and the lack of common sense about eye care, the number of people of all ages suffering from eye diseases has increased rapidly in recent years. According to statistics, the number of diabetes patients in my country has increased to 94.2 million, ranking first in the world. The main ocular hazard of diabetes is diabetic retinopathy (DR), with an incidence rate of up to 84%. The eye health problems caused by this disease cannot be ignored. The significance of studying diabetic retinopathy is multifaceted. First, by improving the early diagnosis rate and timely treatment of DR, the severe vision loss and blindness caused by this disease can be significantly reduced. This has an important impact on improving the quality of life of patients and reducing their emotional and economic burden. Secondly, the effective management of DR is an important challenge for the public health system. Early detection and treatment can not only help reduce the personal burden of patients, but also significantly reduce the economic pressure on the medical system. In addition, in-depth research on DR, especially in combination with the patient's genetic, metabolic and lifestyle factors, can promote the development of more accurate and personalized prevention and treatment strategies. This is not only of great significance to ophthalmology, but also has an impact on scientific research and technological innovation in related fields such as medical imaging and endocrinology. Especially in the application of artificial intelligence and big data, DR research has provided new ideas and methods for the diagnosis and treatment of ophthalmic diseases, and is expected to promote the overall progress of medical technology.

[0003] Microaneurysm (MA) is one of the earliest symptoms of diabetic retinopathy, and its detection is of great significance for early diagnosis and treatment. Traditional detection methods rely on the subjective judgment of professional doctors, which is not only time-consuming but also easily affected by personal experience. With the development of artificial intelligence and computer vision technology, automated image analysis methods have provided new possibilities for efficient and accurate detection of microaneurysms and blood vessels. The use of artificial intelligence technology can not only improve the accuracy and efficiency of diagnosis, but also promote personalized treatment, thereby promoting the advancement of scientific research. Especially for retinal problems caused by chronic diseases such as diabetes, early diagnosis and treatment can significantly reduce the risk of blindness in patients and reduce the social and economic burden caused by the disease.

[0004] Therefore, a set of ultra-fine segmentation methods for microaneurysms in color fundus images is urgently needed. This paper focuses on early lesions in DR color fundus images, namely microaneurysms, and completes ultra-fine semantic segmentation based on image processing and artificial intelligence technology. It can perfectly solve the problems faced by the above DR medical services and effectively assist doctors in reaching diagnosis and treatment conclusions. It deeply fits the current era and industry background and has important research significance and application value. Therefore, the study of ultra-fine semantic segmentation of ocular microaneurysms is not only of great value in the fields of medical imaging and ophthalmic diagnosis, but also has a profound impact on public health, scientific research, and the individual health of patients. The development of this research field is expected to bring new breakthroughs in the early diagnosis and treatment of ophthalmic diseases. Summary of the invention

[0005] In order to solve the problems of noise interference, uneven illumination, and difficulty in identifying and segmenting small targets that are common in medical images, this paper proposes a method for ultra-fine semantic segmentation of fundus MA microstructure based on artificial intelligence methods such as deep learning for the detection of microaneurysms in color fundus images. Specifically, a deep learning method is used to classify the color fundus images at the pixel level, thereby obtaining the microaneurysm area in the color fundus images for clinical disease analysis.

[0006] In order to achieve the above purpose, the present invention adopts the following technical means:

[0007] A Transformer-based ultra-fine segmentation method for microaneurysm in color fundus images, comprising the following steps:

[0008] Step 1, data preprocessing: For the color fundus image of the patient, first extract the green channel of the original image, then use adaptive histogram equalization to enhance the contrast and brightness of the color fundus image, and then perform image denoising;

[0009] Step 2, data enhancement and image segmentation: perform data enhancement and affine transformation, wherein the data enhancement method includes random horizontal / vertical flipping, random rotation and edge sharpening; then, segment the original image into images of size 512×512 as the input of the model;

[0010] Step 3: Design of multi-level encoder HVMT: Use the multi-level encoder HVMT to realize the feature extraction of different granularities in 5 stages, so as to complete the task of extracting ultra-fine semantic information of microvascular tumors in color fundus images;

[0011] Step 4: Design of feature extraction module: Use the VMT module of Transformer technology to complete the specific feature extraction tasks in each stage;

[0012] Step 5: By upsampling based on the U-Net model, the features of different stages are fused to obtain the fusion features of each stage, thereby generating a probability map of microvascular tumors in each stage;

[0013] Step 6: Combine the fusion features of each stage by weighting and splicing, and finally generate the final microaneurysm probability map, and obtain the microaneurysm area after screening;

[0014] Step 7: Use Focal Tversky Loss as the loss function;

[0015] Step 8: Application of segmented images: The segmentation results are filtered using digital processing methods to eliminate irrelevant noise. The final segmentation result is the DR intelligent grading information.

[0016] In the above technical solution, step 1 specifically includes the following steps:

[0017] Step 1.1, select the green channel of the image as the input for preprocessing;

[0018] Step 1.2: The adaptive light correction formula for the color fundus image is:

[0019] I illu =I ori +mI ori ×f ave1

[0020] Where m is the average intensity of the original image, f ave1 is a large mean filter, I ori The original color fundus image is represented;

[0021] Step 1.3: Use the following formula to denoise the image and convert the denoised image I denoi :

[0022] I denoi =I ori ±μ-I illu ×f ave2

[0023] Among them, μ is the pixel mean of the original image, f ave2 is a small mean filter.

[0024] In the above technical solution, step 3 specifically includes the following steps:

[0025] Step 3.1: Multi-layer encoder HVMT construction: Use a main branch module consisting of a single-stream deep network with multiple side output branch modules to extract the basic features of the image;

[0026] Step 3.2: Construct a 1×1 convolution in the encoder to adjust the number of channels in the input feature layer.

[0027] Step 3.3, decompose the input basic features into 5 scale feature maps;

[0028] Step 3.4: construct a 3×3 convolution for the multi-scale feature map for feature fusion processing to obtain a color fundus image MA feature map containing visual information of different scales, where MA represents microaneurysm.

[0029] In the above technical solution, step 4 specifically includes the following steps:

[0030] Step 4.1: Construction of VMT feature extraction module:

[0031] Step 4.1.1, use the main branch module of the feature extraction part of the VMT module to extract the basic features of the image, each main branch module includes a convolutional layer, a local perception unit, a lightweight multi-head self-attention mechanism, a layer normalization and a reverse residual feedforward neural network layer;

[0032] Step 4.1.2: The input processing part of the VMT module uses the stem framework, including a 3×3 convolution with a stride of 2 and an output channel of 32 to reduce the input image size, and also includes two 3×3 convolutions with a stride of 1;

[0033] Step 4.1.3: To produce a hierarchical representation, a patch embedding layer consisting of a convolutional layer and a layer normalization is placed before each stage to reduce the intermediate feature size and project it to a larger dimension, thereby generating a feature map containing information at different scales.

[0034] Step 4.2, position encoding:

[0035] Step 4.2.1: Apply position encoding technology to the feature map of each scale obtained in step 4.1.3 to introduce global context information;

[0036] Step 4.2.2: Position coding adopts absolute position coding. Absolute position coding uses sine and cosine functions to represent absolute position, and obtains relative position by multiplying the two. A unique coding value is assigned to each position, so that the position information in the feature map can be represented.

[0037] Step 4.3, Lightweight Transformer Encoder:

[0038] Step 4.3.1: Apply a lightweight Transformer encoder to the feature maps at each scale.

[0039] Step 4.3.2, the lightweight Transformer encoder consists of 6 attention mechanisms and feed-forward neural network layers;

[0040] Step 4.3.3, the lightweight multi-head self-attention mechanism is used to capture global context information, and interact and transfer information between different positions in the feature map obtained in step 4.2.2; each lightweight multi-head attention mechanism is used to model the relationship between features to capture global context information. Through the lightweight multi-head self-attention mechanism, each position in the feature map interacts and transfers information with other positions to obtain global semantic information;

[0041] Step 4.3.4: An inverted residual feedforward neural network layer is set after the lightweight multi-head self-attention mechanism. The inverted residual feedforward neural network layer is a fully connected layer, that is, a fully connected network with two linear layers, which is used to enhance the nonlinear representation ability of the MA features of the color fundus image.

[0042] In the above technical solution, step 6 specifically includes the following steps:

[0043] Step 6.1, the feature fusion module is used to fuse the output features provided by the main branch module and the side output branch module;

[0044] Step 6.2: The output features provided by the main branch module are extracted through a Concat layer, two 1×1 convolution layers, and a Sigmoid layer to obtain feature A, thereby refining and enhancing the features and realizing feature selection;

[0045] Step 6.3: After the output features provided by the side output branch module are extracted through two convolutional layers, they are superimposed with feature A to obtain feature B, thereby realizing feature combination.

[0046] Because the present invention adopts the above technical means, it has the following beneficial effects:

[0047] 1. Image preprocessing: In order to solve the problem of noise interference caused by uneven illumination, the present invention uses traditional adaptive histogram equalization (CLAHE) to solve the problem. For color fundus images, the green channel has an obvious contrast advantage and is directly used for image preprocessing to reduce noise interference.

[0048] 2. Model design: HVMT effectively solves the problem of small target area of ​​microaneurysm through multi-scale feature fusion and attention mechanism, and greatly improves the detection and recognition performance.

[0049] 3. Data fusion: Using the results obtained from the five channels, the features of the main branch and the side branch are weighted and fused to increase the fault tolerance of the segmentation results and improve the accuracy of the final recognition.

[0050] 4. Loss function: This algorithm uses Focal Tversky Loss as the loss function. Focal Tversky Loss is a loss function that combines Focal Loss and Tversky index. It is mainly used to deal with the problems of category imbalance and boundary details in image segmentation tasks. Because Focal Tversky Loss combines the ideas of Focal Loss and Tversky index, it can help the model pay more attention to difficult samples, solve the problems of category imbalance and uneven sample difficulty, thereby improving the performance and stability of the segmentation model.

[0051] 5. In order to solve the problems of small microaneurysm targets and easy missed or false detection in clinical practice, a multi-scale ultra-fine semantic segmentation algorithm HVMT based on Transformer is proposed. Its core hierarchical architecture can automatically learn rich hierarchical representations under the deep supervision and guidance of side responses, which is conducive to improving the detection capability of MA small targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is a flowchart of the color fundus image preprocessing process of the present invention;

[0053] Figure 2 The color fundus image, green channel image and CLAHE transformed image of the present invention;

[0054] Figure 3 This is a framework diagram of ultra-fine semantic segmentation of microaneurysm in color fundus images based on HVMT of the present invention;

[0055] Figure 4 A comparison of different multi-scale deep learning architectures in the present invention;

[0056] Figure 5 Schematic diagram of the VMT module in the present invention. DETAILED DESCRIPTION

[0057] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions made to the present invention should all be included in the scope of the claims of the present invention.

[0058] In addition, in order to better illustrate the present invention, numerous specific details are given in the following specific embodiments. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.

[0059] To this end, the present invention provides a dual-branch OCT blood vessel ultra-fine semantic segmentation method with an encoder-decoder structure, comprising the following steps:

[0060] Step 1, data preprocessing: For the color fundus images of patients, the green channel of the original images was first extracted to obtain clearer images with higher contrast and easier to extract the features of microaneurysm; then, adaptive histogram equalization (CLAHE) was used to enhance the contrast and brightness of the color fundus images; finally, the images processed by CLAHE were denoised.

[0061] Step 2, data enhancement and image segmentation: perform data enhancement and affine transformation, the data enhancement method includes random horizontal / vertical flipping, random rotation and edge sharpening; then, segment the original image into images of 512×512 size as the input of the model.

[0062] Step 3: Design of multi-level encoder HVMT: Using the improved U-Net model, we can realize the feature extraction of different granularities in five stages, so as to complete the task of extracting ultra-fine semantic information of microvascular tumors in color fundus images.

[0063] Step 4: Feature extraction module design: Based on the improved VGG and Transorfmer modules, a VMT (VGG Meet Vision Transformers) module is proposed to complete the specific feature extraction tasks in each stage;

[0064] Step 5: Through upsampling based on the U-Net model, the features of different stages are specially fused to generate the probability map of microvascular tumors in each stage;

[0065] Step 6: Fuse the features of different stages, and finally generate the final microaneurysm probability map by weighting and splicing, and obtain the microaneurysm area after screening;

[0066] Step 7. This algorithm uses Focal Tversky Loss as the loss function.

[0067] Step 8: Application of segmented images: The segmentation results can be filtered using digital processing methods to eliminate irrelevant noise; the final segmentation results can achieve intelligent DR grading and early DR diagnosis, etc.

[0068] In the above technical solution, step 1 specifically includes the following steps:

[0069] Step 1.1. First, select the green channel of the image as the input for preprocessing. By selecting the green channel as the input of the image, a clearer, more contrasty, and easier to extract microaneurysm features image can be obtained, which is helpful for the detection and diagnosis of eye diseases. The green channel performs well in showing the contrast of microaneurysms. The color of blood vessels is lighter, while the color of surrounding tissues and background is darker. This color difference makes blood vessels easier to distinguish and extract in the green channel. In addition, compared with the red and blue channels, the green channel has better resistance to illumination changes and noise. Illumination changes and noise may affect the quality of the image and the visibility of microaneurysms, and selecting the green channel can reduce the impact of these interference factors.

[0070] Step 1.2: Due to the influence of external factors such as light, images often have uneven brightness. Some images are exposed too strongly, resulting in high brightness, while others are exposed too weakly, resulting in low brightness. This will have a certain impact on subsequent experiments. Therefore, the adaptive light correction formula for color fundus images is firstly required:

[0071] I illu =I ori +mI ori ×f ave1

[0072] Where m is the average intensity of the original image, f ave1 is a large mean filter, I ori Represents the original color fundus image.

[0073] Step 1.3, in addition to being affected by external factors such as light, the interference of noise is also inevitable. Its existence will not only affect the imaging effect of the picture, but also may confuse the detected target MA, reduce the image quality and increase the false detection rate. Therefore, the following formula can be used to denoise the image:

[0074] I denoi =I ori ±μ-I illu ×f ave2

[0075] Among them, μ is the pixel mean of the original image, f ave2 is a small mean filter.

[0076] In the above technical solution, step 3 specifically includes the following steps:

[0077] Step 3.1: Multi-layer encoder HVMT construction: Use a main branch module consisting of a single-stream deep network with multiple side output branch modules to extract the basic features of the image;

[0078] Step 3.2: Construct a 1×1 convolution in the encoder to adjust the number of channels in the input feature layer.

[0079] Step 3.3, decompose the input basic features into 5 scale feature maps;

[0080] Step 3.4, constructing a 3×3 convolution for the multi-scale feature map for feature fusion processing, and obtaining a color fundus image MA feature map containing visual information of different scales;

[0081] In the above technical solution, step 4 specifically includes the following steps:

[0082] Step 4.1: Construction of VMT feature extraction module:

[0083] Step 4.1.1, use the main branch modules composed of the VMT network to extract the basic features of the image, each main branch module includes a convolutional layer, a local perception unit, a lightweight multi-head self-attention mechanism, a layer normalization and a reverse residual feedforward neural network layer;

[0084] Step 4.1.2, the VMT module uses the stem framework, which consists of a 3×3 convolution with a stride of 2 and an output channel of 32 to reduce the input image size, and two 3×3 convolutions with a stride of 1 to better extract local information, thereby overcoming the limitation of only being able to model structural information using linear projection.

[0085] Step 4.1.3: To produce a hierarchical representation, a patch embedding layer consisting of a convolutional layer and a layer normalization is placed before each stage to reduce the intermediate feature size and project it to a larger dimension, thereby generating a feature map containing information at different scales.

[0086] Step 4.2, position encoding:

[0087] Step 4.2.1: Apply position encoding technology to the feature map of each scale obtained in step 4.1.3 to introduce global context information;

[0088] Step 4.2.2: Position coding adopts absolute position coding. Absolute position coding uses sine and cosine functions to represent absolute position, and obtains relative position by multiplying the two. A unique coding value is assigned to each position, so that the position information in the feature map can be represented.

[0089] Step 4.3, Lightweight Transformer Encoder:

[0090] Step 4.3.1: Apply a lightweight Transformer encoder to the feature maps at each scale.

[0091] Step 4.3.2. The lightweight Transformer encoder consists of 6 attention mechanisms and feed-forward neural network layers.

[0092] Step 4.3.3, the lightweight multi-head self-attention mechanism is used to capture global context information, and interact and transfer information between different positions in the feature map obtained in step 4.2.2; each lightweight multi-head attention mechanism is used to model the relationship between features to capture global context information. Through the lightweight multi-head self-attention mechanism, each position in the feature map can interact and transfer information with other positions to obtain global semantic information;

[0093] Step 4.3.4: An inverted residual feedforward neural network layer is set after the lightweight multi-head self-attention mechanism. The feedforward neural network layer is a fully connected layer, that is, a fully connected network with two linear layers, which is used to enhance the nonlinear representation ability of the MA features of the color fundus image.

[0094] In the above technical solution, step 6 specifically includes the following steps:

[0095] Step 6.1, the feature fusion module is used to fuse the output features provided by the main branch module and the side output branch module. Since the five-way features are not the same, the two parts of the features cannot be simply weighted.

[0096] Step 6.2: The output features provided by the main branch are extracted through a Concat layer, two 1×1 convolution layers, and a Sigmoid layer to obtain feature A, thereby refining and enhancing the features and realizing feature selection;

[0097] Step 6.3: After the output features provided by other branches are extracted through two convolutional layers, they are superimposed with feature A (with different weights) to obtain feature B, thus realizing feature combination.

[0098] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described below in conjunction with the accompanying drawings and specific embodiments.

[0099] The equipment used for algorithm testing is: the hardware environment is GPU NVIDIA TITAN Xp, Intel(R) Xeon(R) CPUE5-1650 v4@3.60GHz, and the operating environment is python3.6 and related extension package Pytorch.

[0100] The deep convolutional neural network U-Net, HVMT hierarchical structure and VMT module are used as the core algorithms of the model.

[0101] The color fundus images are preprocessed to enhance the MA contrast, such as Figure 1 ,2 As shown, it lays the foundation for subsequent accurate identification and segmentation.

[0102] For the HVMT hierarchy, such as Figure 3 As shown in Figure 1, it includes a single-stream deep network with multiple side output branch modules. This architecture is similar to several previous works, especially the deep supervised network method, which supervises the hidden layers to improve the optimization effect of image segmentation tasks and the generalization ability to new samples. Multiple side outputs also provide flexibility for this model.

[0103] The HVMT hierarchy is inspired by the concept of multi-scale and multi-level learning, such as Figure 4 Some of these methods are implemented by multi-scale learning of the internal structure of the network, while others are implemented by scaling and distorting the image. Figure 4 Some existing multi-scale and multi-level learning neural networks are listed in the ad. Among them, Figure 4 In the figure, a is a multi-stream architecture. Figure 4 In the figure, b is the skip-layer net architecture. Figure 4 In c, a single model architecture is run on multi-scale input. Figure 4 In the figure d, different networks are trained separately. Figure 4 Element e in the figure is the overall nested architecture proposed by the present invention, in which multiple side output branch modules are added.

[0104] For the input processing part of the VMT module, it uses a stem framework, which consists of a 3×3 convolution with a stride of 2 and an output channel of 32 to reduce the input image size, and two 3×3 convolutions with a stride of 1 to better extract local information, thereby overcoming the limitation that only linear projection can be used to model structural information in the DeiT block, because DeiT directly divides the input image into non-overlapping blocks. According to the design of the convolutional neural network, the model includes four stages for generating feature maps of different scales, which is very important for ultra-fine semantic segmentation. In order to produce a hierarchical representation, there is a patch embedding layer consisting of a convolutional layer and a layer normalization before each stage to reduce the intermediate feature size and project it to a larger dimension to generate a feature map containing information of different scales. At each stage, 16 VMT blocks are stacked in sequence for feature transformation while keeping the resolution of the input unchanged, such as Figure 3 As shown, VMT is able to capture both local and remote dependencies.

[0105] The feature extraction part of the VMT module consists of a local perception unit (LPU), a lightweight multi-head self-attention (LMHSA) module and an inverted residual feed-forward network (IRFFN), such as Figure 5 shown.

[0106] Rotation and translation are two common data augmentation methods in visual tasks. These operations should not change the final result of the model, that is, to ensure translation invariance. However, the absolute position encoding used in the previous Transformer, which was originally designed to use token order, destroyed this invariance because it added a unique position encoding to each patch. In addition, the Transformer model failed to fully consider the local connections and the structural information within the block when processing information. In order to overcome these limitations, a local perception unit is proposed to extract local relationships:

[0107] LPU(X)=DWConv(X)+X (5-1)

[0108] in, H×W is the input resolution of the current stage, d represents the feature dimension. DWConv(·) represents the depthwise convolution.

[0109] In the original self-attention, the input is linearly transformed into and Where H×W is the number of patches, d, d k ,d v They are the dimensions of input, K, Q, and V. K represents the key information of the input data, which is used to model the relationship between the query and the value. Q represents the query information of the input data, which is used to match and associate with the key K and the value V. V represents the value information of the input data, providing detailed information related to the query Q. Then the self-attention module is applied:

[0110]

[0111] In order to reduce the computational overhead, a depth convolution with a step size of k is used to reduce the spatial size of K and V before the attention operation, as shown in formulas (5-3) and (5-4). In addition, a relative position deviation is added to each self-attention module. The corresponding lightweight attention definition is shown in formula (5-5):

[0112]

[0113]

[0114]

[0115] The fully connected feedforward network (FFN) consists of two linear layers separated by the GeLU activation function, where the first layer expands the feature dimension by 4 times, while the second layer compresses it back to the original dimension, as shown in formula (5-6):

[0116] FFN(X)=GeLU(XW1+b1)W2+b2 (5-6)

[0117] in, Represent the weights of the two linear layers, b1 and b2 are bias terms, GeLU(·) is the activation function, and X is the original feature map. The proposed IRFFN is similar to the reverse residual block, that is, it consists of an expansion layer, a deep convolution layer, and a projection layer. Specifically, by adjusting the position of the shortcut connection, better performance can be obtained, as shown in formulas (5-7) and (5-8):

[0118]

[0119]

[0120] The activation layer is omitted. The deep convolution includes batch normalization after the last linear layer, which is used to extract local information while ignoring the additional computational cost. The motivation for inserting shortcuts is similar to that of the classic residual network, which helps to improve the ability of gradient propagation across layers. Experimental results show that shortcuts help improve network performance.

[0121] Combining the above three components, the VMT module can be expressed as:

[0122] Y i =LRU(X i-1 ) (5-9)

[0123] Z i =LMHSA(LN(Y i ))+Y i (5-10)

[0124] X i =IRFFN(LN(Z i ))+Z i (5-11)

[0125] Among them, Y i , Z iThey represent the output features of the local perception unit LPU and the lightweight multi-head self-attention module LMHSA of the i-th block, respectively, and X i is the original feature, LN represents layer normalization, and several VMT blocks are stacked at each stage for feature transformation and aggregation.

[0126] This algorithm uses Focal Tversky Loss as the loss function. Focal Tversky Loss is a loss function that combines Focal Loss and Tversky exponent. It is mainly used to deal with the problems of class imbalance and boundary details in image segmentation tasks. Because Focal Tversky Loss combines the ideas of Focal Loss and Tversky exponent, it can help the model pay more attention to difficult samples, solve the problems of class imbalance and uneven sample difficulty, and thus improve the performance and stability of the segmentation model.

[0127] In the medical field, the Dice score coefficient (DSC) is a commonly used indicator to evaluate the accuracy of image segmentation results and the performance of segmentation algorithms. It measures the degree of overlap between the segmentation results and the true labels.

[0128] Among them, the real label and the predicted label are respectively represented by g i ∈{0,1},p i ∈[0, 1]. N represents the total number of pixels in the image. ∈ provides numerical stability and prevents division by zero.

[0129]

[0130] p ic is the predicted label, g ic The true label

[0131] The linear Dice loss (DL) is defined as minimizing the overlap between the predicted result and the actual label. To alleviate the impact of class imbalance, a weight w is set for each class c. c , which is inversely proportional to the label frequency.

[0132] DL c =∑ c 1-DSC c (5-20)

[0133] A limitation of the Dice loss function is that it treats false positive (FP) and false negative (FN) detections equally. In practice, this leads to segmentation maps with high precision but low recall. For highly imbalanced data and small regions of interest (such as skin lesions), it is necessary to weight false negative detections higher to improve recall. The Tversky similarity index is a generalization of the Dice score that allows for a flexible balance between FP and FN.

[0134]

[0135] Among them, p ic represents the probability of predicting that pixel i is classified as lesion category c, Indicates that the predicted pixel i is classified as non-lesion Similarly, g ic and Indicates that pixel i in the true label is classified as lesion category c and non-lesion category The hyperparameters a and β can be tuned to enhance recall in the presence of large class imbalances. The Tversky exponent is adapted as a loss function (TL) that minimizes ∑1-TI c accomplish.

[0136] Another problem with DL is that it has difficulty segmenting small regions of interest (ROIs) because their contribution to the loss is not significant. To address this issue, the present invention uses a focal Tversky loss function (FTL) parameterized by γ to control the balance between easy background and difficult ROI training samples. In , the focal parameter exponentiates the cross entropy loss in order to focus on difficult categories with lower probability. This idea has been extended in recent research, where the exponentiation is applied to the Dice score or a combination of Dice and cross entropy. Similarly, the focal Tversky loss (FTL) function is defined.

[0137] FTL c =∑ c (1-TI c ) 1 / γ (5-22)

[0138] where γ varies in the range [1, 3]. In practice, if a pixel is misclassified with a high Tversky exponent, FTL is unaffected. However, if the Tversky exponent is small and the pixel is misclassified, FTL will be significantly reduced. When γ>1, the loss function focuses more on inaccurate predictions that are misclassified. However, when the class accuracy is high, usually when the model is close to convergence, over-suppression of FTL is observed.

Claims

1. A Transformer-based ultra-fine segmentation method for microaneurysm in color fundus images, characterized in that: The following steps are involved: Step 1, data preprocessing: For the color fundus image of the patient, first extract the green channel of the original image, then use adaptive histogram equalization to enhance the contrast and brightness of the color fundus image, and then perform image denoising; Step 2, data enhancement and image segmentation: perform data enhancement and affine transformation, wherein the data enhancement method includes random horizontal / vertical flipping, random rotation and edge sharpening; then, segment the original image into images of size 512×512 as the input of the model; Step 3: Design of multi-level encoder HVMT: Use the multi-level encoder HVMT to realize the feature extraction of different granularities in 5 stages, so as to complete the task of extracting ultra-fine semantic information of microvascular tumors in color fundus images; Step 4: Design of feature extraction module: Use the VMT module of Transformer technology to complete the specific feature extraction tasks in each stage; Step 5: By upsampling based on the U-Net model, the features of different stages are fused to obtain the fusion features of each stage, thereby generating a probability map of microvascular tumors in each stage; Step 6: Combine the fusion features of each stage by weighting and splicing, and finally generate the final microaneurysm probability map, and obtain the microaneurysm area after screening; Step 7: Use Focal Tversky Loss as the loss function; Step 8: Application of segmented images: The segmentation results are filtered using digital processing methods to eliminate irrelevant noise. The final segmentation result is the DR intelligent grading information.

2. According to the Transformer-based ultra-fine segmentation method for microaneurysm in color fundus images according to claim 1, it is characterized in that: Step 1 specifically includes the following steps: Step 1.1, select the green channel of the image as the input for preprocessing; Step 1.2: The adaptive light correction formula for the color fundus image is: I illu =I ori +m-I ori ×f ave1 In the formula, m is the average intensity of the original image, f ave1 is a large mean filter, I ori The original color fundus image is represented; Step 1.3: Use the following formula to denoise the image and convert the denoised image I denoi : I denoi =I ori ±μ-I illu ×f ave2 Among them, μ is the pixel mean of the original image, f ave2 is a small mean filter.

3. According to the Transformer-based ultra-fine segmentation method for color fundus images of microaneurysm, step 3 specifically comprises the following steps: Step 3.1: Multi-layer encoder HVMT construction: Use a main branch module consisting of a single-stream deep network with multiple side output branch modules to extract the basic features of the image; Step 3.2: Construct a 1×1 convolution in the encoder to adjust the number of channels in the input feature layer. Step 3.3, decompose the input basic features into 5 scale feature maps; Step 3.4: construct a 3×3 convolution for the multi-scale feature map for feature fusion processing to obtain a color fundus image MA feature map containing visual information of different scales, where MA represents microaneurysm.

4. The method for ultra-fine segmentation of microaneurysm in color fundus images based on Transformer according to claim 1, characterized in that: Step 4 specifically includes the following steps: Step 4.1: Construction of VMT feature extraction module: Step 4.1.1, use the main branch module of the feature extraction part of the VMT module to extract the basic features of the image, each main branch module includes a convolutional layer, a local perception unit, a lightweight multi-head self-attention mechanism, a layer normalization and a reverse residual feedforward neural network layer; Step 4.1.2: The input processing part of the VMT module uses the stem framework, including a 3×3 convolution with a stride of 2 and an output channel of 32 to reduce the input image size, and also includes two 3×3 convolutions with a stride of 1; Step 4.1.3: To produce a hierarchical representation, a patch embedding layer consisting of a convolutional layer and a layer normalization is placed before each stage to reduce the intermediate feature size and project it to a larger dimension, thereby generating a feature map containing information at different scales. Step 4.2, position encoding: Step 4.2.1: Apply position encoding technology to the feature map of each scale obtained in step 4.1.3 to introduce global context information; Step 4.2.2: Position coding adopts absolute position coding. Absolute position coding uses sine and cosine functions to represent absolute position, and obtains relative position by multiplying the two. A unique coding value is assigned to each position, so that the position information in the feature map can be represented. Step 4.3, Lightweight Transformer Encoder: Step 4.3.1: Apply a lightweight Transformer encoder to the feature maps at each scale. Step 4.3.2, the lightweight Transformer encoder consists of 6 attention mechanisms and feed-forward neural network layers; Step 4.3.3, the lightweight multi-head self-attention mechanism is used to capture global context information, and interact and transfer information between different positions in the feature map obtained in step 4.2.2; each lightweight multi-head attention mechanism is used to model the relationship between features to capture global context information. Through the lightweight multi-head self-attention mechanism, each position in the feature map interacts and transfers information with other positions to obtain global semantic information; Step 4.3.4: An inverted residual feedforward neural network layer is set after the lightweight multi-head self-attention mechanism. The inverted residual feedforward neural network layer is a fully connected layer, that is, a fully connected network with two linear layers, which is used to enhance the nonlinear representation ability of the MA features of the color fundus image.

5. The method for ultra-fine segmentation of microaneurysm in color fundus images based on Transformer according to claim 1, characterized in that: Step 6 specifically includes the following steps: Step 6.1, the feature fusion module is used to fuse the output features provided by the main branch module and the side output branch module; Step 6.2: The output features provided by the main branch module are extracted through a Concat layer, two 1×1 convolution layers, and a Sigmoid layer to obtain feature A, thereby refining and enhancing the features and realizing feature selection; Step 6.3: After the output features provided by the side output branch module are extracted through two convolutional layers, they are superimposed with feature A to obtain feature B, thereby realizing feature combination.

Citation Information

Cited By

  • Visual conversion system, method and equipment for auxiliary diagnosis of eye diseases and storage medium

    CN120496813A