Eye fundus image segmentation method and network based on image complexity
By introducing a complexity analysis module to dynamically adjust feature fusion, the problem of insufficient segmentation accuracy and robustness of the U-Net network in different scenarios is solved, realizing an adaptive fundus image segmentation method that improves segmentation accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 江苏富翰医疗产业发展有限公司
- Filing Date
- 2025-12-15
- Publication Date
- 2026-04-28
AI Technical Summary
When processing fundus image segmentation in different scenarios, the fixed parameters and skip connections of the U-Net network cannot adapt to the differences in image complexity, resulting in reduced segmentation accuracy and robustness, especially in low-contrast, complex noise, or high-noise images.
A complexity analysis module is introduced to generate a complexity parameter vector by analyzing the global features of fundus images. This dynamically adjusts the feature flow of skip connections, adaptively adjusts the feature fusion process, and generates adaptive fusion features to improve segmentation accuracy and robustness.
It improves the accuracy and robustness of fundus image segmentation, maintains stable segmentation performance under different image complexity conditions, reduces artifacts and glitch, and enhances the model's segmentation effect in complex images.
Smart Images

Figure CN121937469A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and in particular to a fundus image segmentation method and network based on image complexity. Background Technology
[0002] Medical image segmentation analyzes medical images to identify lesion regions, providing support for disease diagnosis and treatment planning. In fundus images, fundus structures include the retina, optic disc, macula, and blood vessels. White spots are abnormally bright lesions in fundus images, and accurate segmentation of these areas is crucial for disease diagnosis. The U-Net network (U-shaped network) employs an encoder-decoder structure, utilizing skip connections to fuse superficial detail features with deep semantic information, thereby improving the accuracy of lesion localization and achieving high-precision segmentation.
[0003] When processing images, the U-Net network uses fixed network parameters and skip connections for all inputs. The encoder path extracts multi-scale features through convolution and pooling operations, while the decoder path restores resolution through upsampling. Skip connections directly concatenate the features of each layer of the encoder with the corresponding layer of the decoder to achieve the fusion of details and semantics. This fixed architecture performs stably in standard scenarios.
[0004] However, fixed parameters and skip connections do not take into account differences in image complexity, such as variations in image quality, contrast, and noise. For simple images, this may introduce background noise; for complex images, it may fail to fully convey detailed information, resulting in reduced segmentation accuracy and robustness of the model in different scenarios. Summary of the Invention
[0005] This application provides a fundus image segmentation method and network based on image complexity to address the problem of reduced segmentation accuracy and robustness of the model in different scenarios.
[0006] In a first aspect, this application provides a fundus image segmentation method based on image complexity, comprising: Acquire the fundus image to be processed; The global features of the fundus image to be processed are analyzed by the complexity analysis module to generate a complexity parameter vector. The global features include at least contrast, texture complexity, and noise distribution. The encoder performs multi-level feature extraction on the fundus image to be processed to generate coded features at different levels. The decoder performs feature fusion based on the complexity parameter vector and the encoded features at different levels to generate fused features. Based on the fusion features, the segmentation result is output.
[0007] By using complexity parameter vectors to guide feature fusion, the segmentation method can adapt to fundus images of varying complexity, thereby improving the accuracy and robustness of the segmentation results.
[0008] In some feasible embodiments, the complexity analysis module includes a feature extraction layer, a global pooling layer, and a parameter mapping layer; The step of analyzing the global features of the fundus image to be processed through a complexity analysis module to generate a complexity parameter vector includes: The feature extraction layer performs feature transformation on the fundus image to be processed to extract a first feature map, which includes primary features related to the global features. The spatial dimension of the first feature map is compressed through the global pooling layer to obtain a global feature descriptor; The parameter mapping layer maps the global feature descriptor into a complexity parameter vector. The parameter mapping layer includes at least one fully connected layer.
[0009] Global features are extracted through feature extraction, pooling, and mapping layers, and a complexity parameter vector is generated to provide a quantification basis for subsequent adaptive fusion.
[0010] In some feasible embodiments, the encoder includes at least four coding blocks, each coding block including at least one convolutional layer, a batch normalization layer and an activation function, and each coding block is followed by a downsampling layer; The step involves performing multi-level feature extraction on the fundus image to be processed using an encoder to generate encoded features at different levels, including: The fundus image to be processed is subjected to convolution and downsampling through the first coding block to generate the first level coding features; The first-level encoded features are convolutionally processed and downsampled using the second encoding block to generate the second-level encoded features; The third-level encoded features are generated by performing convolution and downsampling on the second-level encoded features through the third encoded block; The fourth-level coding features are generated by performing convolution and downsampling on the third-level coding features through the fourth coding block.
[0011] By extracting and downsampling multi-level coding blocks layer by layer, multi-level coding features are generated, providing comprehensive feature information from details to semantics for fusion.
[0012] In some feasible embodiments, the method further includes: Based on the complexity parameter vector, a first weight, a second weight, a third weight, and a fourth weight are generated through a weight allocation network. The first weight, the second weight, the third weight, and the fourth weight correspond to the coding features at different levels. Multiply the first-level encoded feature by the first weight to obtain the first weighted feature; The second-level encoded features are multiplied by the second weight to obtain the second weighted features; The third-level encoded features are multiplied by the third weight to obtain the third weighted features; The fourth-level encoded feature is multiplied by the fourth weight to obtain the fourth weighted feature.
[0013] By generating adaptive weights corresponding to the encoded features through a weight allocation network and then weighting them, selective enhancement and suppression of features at different levels can be achieved.
[0014] In some feasible embodiments, the decoder includes at least four decoding blocks, each decoding block including at least an upsampling layer, a feature concatenation layer and a convolutional layer; The step of performing feature fusion based on the complexity parameter vector and the encoded features at different levels to generate fused features includes: The fourth-level encoded features are upsampled by the decoder to obtain the first upsampled features, and the first upsampled features are concatenated with the fourth weighted features to obtain the first-level fused features. Upsampling is performed on the first-level fusion feature to obtain the second upsampled feature, and the second upsampled feature is concatenated with the third weighted feature to obtain the second-level fusion feature; Upsampling is performed on the second-level fusion feature to obtain the third-level upsampled feature, and the third-level upsampled feature is concatenated with the second-level weighted feature to obtain the third-level fusion feature; Upsampling is performed on the third-level fusion feature to obtain a fourth upsampled feature, and the fourth upsampled feature is concatenated with the first weighted feature to obtain the fusion feature.
[0015] By upsampling multi-level decoding blocks and concatenating them with weighted encoded features, spatial details are gradually restored and semantic information is fused to generate fused features.
[0016] In some feasible embodiments, the step of outputting the segmentation result based on the fusion features includes: The fusion features are input into the segmentation head; After the number of channels is mapped to the number of segmentation categories by the convolutional layer in the segmentation head, the segmentation result is output through the activation function in the segmentation head. The segmentation result represents the probability that each pixel belongs to a specific category.
[0017] The segmentation head maps the fused features into a pixel-level probability map, directly outputting the class probability of each pixel to obtain the final segmentation result.
[0018] In some feasible embodiments, acquiring the fundus image to be processed includes: Acquire fundus images, wherein the fundus images are color fundus images; The fundus image is subjected to size normalization processing to obtain a first image; Perform contrast enhancement processing on the first image to obtain the second image; The second image is converted to grayscale to obtain the fundus image to be processed.
[0019] By performing size normalization, contrast enhancement, and grayscale preprocessing, the quality of the fundus images to be processed is improved, laying the foundation for subsequent complexity analysis and feature extraction.
[0020] Secondly, this application provides a fundus image segmentation network based on image complexity, comprising: The complexity analysis module is used to acquire the fundus image to be processed and analyze the global features of the fundus image to generate a complexity parameter vector. The global features include at least contrast, texture complexity, and noise distribution. The encoder, connected to the complexity analysis module, is used to perform multi-level feature extraction on the fundus image to be processed, so as to generate coded features at different levels. The decoder is used to perform feature fusion based on the complexity parameter vector and the encoded features at different levels to generate fused features; A segmentation head, connected to the decoder, is used to output segmentation results based on the fusion features.
[0021] Through the collaboration of various modules in the network, end-to-end fundus image segmentation is achieved, and the feature processing flow can be adaptively adjusted according to the complexity parameter vector.
[0022] In some feasible embodiments, it also includes: A weight allocation network, connected to the complexity analysis module, is used to generate multiple adaptive weights based on the complexity parameter vector; An adaptive skip connection mechanism is connected to the weight allocation network and the encoder respectively, and is used to multiply the encoded features of different levels with the corresponding adaptive weights to obtain weighted encoded features.
[0023] By using a weighted network and an adaptive skip connection mechanism, the complexity vector is converted into feature weights, and the transmission of encoded features to the decoder is dynamically adjusted.
[0024] In some feasible embodiments, the parameters of the network are obtained through end-to-end supervised training, the training process of which includes: Obtain a training set, which is a dataset of fundus images annotated with white spots; The fundus images in the training set are input into the segmentation network, and forward propagation is performed to output the training segmentation results; Calculate the difference between the trained segmentation results and the corresponding ground truth labels to construct a segmentation loss function; Based on the segmentation loss function, the error is backpropagated through the gradient descent algorithm to update the weight parameters of the complexity analysis module, encoder, weight allocation network, decoder and segmentation head; During the training process, the image complexity analysis module learns the mapping relationship from the global features of the fundus images in the training set to the complexity parameter vector based on the segmentation loss function.
[0025] End-to-end training allows the network parameters (especially the complexity analysis module) to be jointly optimized, enabling the network to autonomously learn the most effective complexity mapping relationship for the segmentation task.
[0026] As can be seen from the above technical solutions, this application provides a fundus image segmentation method and network based on image complexity. The method includes: acquiring a fundus image to be processed; analyzing the global features of the fundus image to be processed through a complexity analysis module to generate a complexity parameter vector, wherein the global features include at least contrast, texture complexity, and noise distribution; simultaneously, performing multi-level feature extraction on the processed fundus image through an encoder to generate encoded features at different levels; then performing feature fusion based on the complexity parameter vector and the encoded features at different levels through a decoder to generate fused features; and outputting the segmentation result based on the fused features. By guiding feature fusion with the complexity parameter vector, the segmentation method can adapt to fundus images of different complexities, improving the accuracy and robustness of the segmentation results. Attached Figure Description
[0027] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating the fundus image segmentation method based on image complexity provided in this application embodiment; Figure 2 A schematic diagram of the structure of a fundus image segmentation network based on image complexity provided in an embodiment of this application; Figure 3 Comparison of segmentation results for simple images with high quality and clear boundaries provided in the embodiments of this application; Figure 4 Comparison of low-contrast, blurred-border, highly complex image segmentation results provided in the embodiments of this application. Detailed Implementation
[0029] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application.
[0030] The fundus image segmentation method based on image complexity provided in this application is mainly applied in the field of medical image processing, especially in computer-aided diagnosis of ophthalmic diseases. In the screening and diagnosis of diseases such as diabetic retinopathy and retinal vein occlusion, accurate identification and segmentation of white spot lesions in fundus images are crucial. These white spot regions are key indicators for disease diagnosis, and their segmentation accuracy directly affects subsequent quantitative analysis and clinical decision-making.
[0031] U-Net is a deep convolutional neural network used for medical image segmentation. The U-Net network structure includes an encoder path and a decoder path. The encoder path is used for feature extraction and consists of multiple layers. Each layer contains convolution and pooling operations. Convolution operations are used to capture local feature patterns, and pooling operations are used to expand the receptive field. The encoder path progressively reduces the spatial resolution of the feature maps.
[0032] The decoder path is used to restore spatial resolution and also consists of multiple layers. Each layer contains upsampling and convolution operations. The upsampling operation gradually increases the feature map size. The skip connection concatenates the output feature map of each layer in the encoder path with the input feature map of the corresponding layer in the decoder path. This structural design aims to fuse shallow detail information with deep semantic information.
[0033] The U-Net network acquires multi-scale features of an image through the encoder path. The shallow convolutional layers of the encoder path extract local features such as edges and textures, while the deep convolutional layers of the encoder path extract more abstract semantic features. The decoder path gradually recovers the target boundary through upsampling operations, and the skip connections provide detailed information to help locate the lesion contour. This architecture can balance localization accuracy and semantic understanding to a certain extent when processing medical images.
[0034] Significant variations exist in fundus images acquired during actual clinical practice. Different imaging devices lead to differences in image resolution, ambient lighting conditions affect overall image brightness, and individual differences in patient eye structure cause variations in image contrast. Minor eye movements may introduce motion artifacts and noise. These factors collectively result in complex quality fluctuations in fundus images, leading to a continuous distribution of image complexity.
[0035] Fixed network parameters and skip connections cannot adapt to the above differences in image complexity. The convolutional kernel weights of the encoder path remain unchanged after training, the upsampling parameters of the decoder path do not change with the fundus image to be processed, and the feature splicing method of skip connections lacks selectivity. This static processing mode is insufficient when dealing with complex images.
[0036] In low-contrast images, it is difficult to distinguish lesions from the background. In high-noise images, useful signals are masked by random interference. In images with blurred boundaries, detailed features are lost during pooling operations. Encoder features passed by fixed skip connections contain noise, which is amplified in the decoder path, ultimately leading to errors and spurs in the segmentation boundaries.
[0037] For high-quality simple images, fixed skip connections may introduce background noise. Simple images themselves have clear lesion boundaries, and the shallow features of the encoder contain rich background textures. These background textures are directly transmitted through skip connections, making it difficult for the decoder to completely filter out noise during the fusion process. Unnecessary details interfere with the purity of high-level semantics, and the model output may contain artifacts and false positive regions.
[0038] For low-quality complex images, fixed skip connections cannot adequately transmit details. The boundaries of lesions in complex images are inherently blurred, the deep features of the encoder lose a large amount of spatial information, the shallow features provided by skip connections have a low signal-to-noise ratio, and the decoder lacks sufficient effective details to supplement them. As a result, the model has difficulty reconstructing accurate lesion contours, and the segmentation results may exhibit fragmentation and undersegmentation.
[0039] This application provides a fundus image segmentation method based on image complexity. By introducing image complexity analysis, the above-mentioned adaptability problem is solved. The complexity analysis module evaluates the attributes of the fundus image to be processed, and the generated complexity parameter vector quantifies the global features. This vector dynamically adjusts the feature flow of skip connections. This adjustment mechanism can achieve adaptive feature fusion. The network can adjust its behavior pattern according to the image state and maintain stable performance when facing diverse clinical data.
[0040] like Figure 1 As shown, the segmentation method includes the following steps: S100: Acquire the fundus image to be processed.
[0041] The fundus image to be processed is a color image of the human retina acquired by a fundus camera. This image serves as the input data for the segmentation method, containing the vitiligo lesion areas that need to be identified. In the segmentation task, real retinal images are required as the processing object; therefore, clinically acquired fundus color photographs are obtained.
[0042] During the acquisition of fundus images, variations in image quality, contrast, and noise levels can occur due to factors such as equipment and patient cooperation. Different models of fundus cameras employ different optical systems and image sensors, resulting in inconsistent resolution and color reproduction in the output images. For example, older fundus cameras used in some primary healthcare institutions, due to insufficient lens resolution and sensor performance limitations, produce images that are generally dark, with low contrast between blood vessels and the background, and blurred boundaries between vitiligo lesions and surrounding retinal tissue. In contrast, newer professional fundus cameras, equipped with high dynamic range sensors and adaptive illumination systems, can obtain images with uniform brightness and clear details, revealing more distinct texture features in lesion areas.
[0043] Patient cooperation directly affects image quality. Involuntary eye tremors during the examination can cause motion artifacts in the image, which manifest as double images of blood vessel outlines and blurring of local areas, disrupting the continuity of normal anatomical structures. In particular, when patients cannot keep their eyes open for extended periods, frequent eyelid tremors can create a band-like obstruction in the upper part of the image, completely obscuring part of the retina.
[0044] Changes in lighting conditions can alter the global characteristics of an image. Ambient light interference can cause local overexposure or underexposure in an image. Overexposed areas lose tissue details, while underexposed areas show a significant increase in noise levels. Improper flash intensity settings can cause reflective spots in the fovea of the macula, and these bright areas can mask potential micro-lesions.
[0045] The physical characteristics of optical devices can also introduce specific types of noise. When image sensors operate under low light conditions, they generate shot noise, which manifests as randomly distributed bright pixels. Dust or dirt on the lens surface can form fixed shadows on the image. These shadows have similar grayscale characteristics to pathological changes, which can easily lead to misjudgment.
[0046] Differences in transparency between the cornea and the lens can affect image clarity. In cataract patients, lens opacity can cause the entire image to appear hazy, increase background noise, and decrease the sharpness of tissue boundaries. Corneal scars can also create localized obstructions, hindering the normal passage of light and producing fixed shadow areas on the image.
[0047] These factors together lead to significant differences in the structure and quality of fundus images, making it difficult for image processing methods with fixed parameters to adapt to this diversity.
[0048] S200: The complexity analysis module analyzes the global features of the fundus image to be processed to generate a complexity parameter vector. The global features include at least contrast, texture complexity, and noise distribution.
[0049] Based on the obtained fundus images to be processed, a complexity analysis is performed using a complexity analysis model. The complexity analysis module is a neural network component used to evaluate the overall complexity of the fundus images to be processed. This module analyzes the global statistical characteristics of the image and outputs a quantified complexity parameter vector. The complexity analysis module runs in parallel with the initial layer of the encoder to independently and efficiently extract image complexity information relevant to the segmentation task.
[0050] The complexity analysis module is a neural network that processes the fundus images to be processed in parallel with the encoder. The reason for setting up this module is that different fundus images have significant differences in imaging quality, and a fixed processing mode is difficult to achieve the best results in all cases.
[0051] After receiving the fundus image to be processed, the complexity analysis module can be implemented in various ways. In one implementation, instead of relying on a trainable neural network, it directly calculates a set of statistical features from the fundus image to be processed using a predefined algorithm and combines these features into a complexity parameter vector.
[0052] Specifically, the complexity analysis module can directly calculate various statistical indicators on the input fundus image to be processed. It can calculate the global contrast of the image, for example, by calculating the standard deviation of the image gray levels. The larger the standard deviation, the stronger the image contrast.
[0053] Image entropy reflects the complexity and information richness of image texture; a higher entropy indicates a more complex texture. It can be used to assess image noise levels, for example, by calculating local variance in flat regions of the image and then averaging it as a global noise estimate. Gradient distribution can also be analyzed by calculating the average or histogram statistics of gradient magnitudes in the horizontal and vertical directions to characterize the richness of image edges and details. Finally, these calculated statistical indicators, such as contrast, entropy, noise level, and average gradient, are combined into a multidimensional vector and normalized to generate a complexity parameter vector.
[0054] In another implementation, a pre-trained convolutional neural network model on a large image dataset is used as a fixed feature extractor, and its output features are aggregated to generate a complexity vector.
[0055] Specifically, the complexity analysis module can include a pre-trained convolutional neural network model, such as a ResNet (Residual Network) or VGG (Visual Geometry Group) model pre-trained on the ImageNet dataset. The module resizes the input fundus image to be processed and feeds it into this pre-trained model. Instead of using the model's final classification layer, the module extracts a high-dimensional feature map from an intermediate layer, such as the last convolutional layer. This feature map contains general image attributes encoded by the pre-trained model. Subsequently, the module uses operations such as global average pooling or global max pooling to compress this high-dimensional feature map into a one-dimensional global feature vector. This global feature vector carries semantic-level global information about the fundus image to be processed. Finally, the module can reduce the dimensionality of this global feature vector and map it to the desired complexity parameter vector using a trainable fully connected layer or a fixed projection matrix. This approach leverages the powerful feature representation capabilities of the pre-trained model.
[0056] In other implementations, the complexity of an image can be comprehensively evaluated by analyzing its performance at different scales, capturing complex characteristics from local details to global context.
[0057] Specifically, the complexity analysis module first constructs a multi-scale pyramid by downsampling the fundus image to be processed multiple times, generating a series of images with progressively decreasing resolution. Then, the module calculates a set of local or global features at each level of the pyramid. At the highest resolution level, the module can calculate fine texture features such as local binary pattern variance. At intermediate resolution levels, the module can calculate structural features such as gradient histograms. At the lowest resolution level, the module can calculate macroscopic features such as global contrast and brightness distribution. Next, the module concatenates the features from all scales to form a comprehensive multi-scale feature descriptor. Finally, the module integrates and reduces the dimensionality of this comprehensive descriptor through a fully connected network or a feature selector, outputting the final complexity parameter vector. This multi-scale analysis can more comprehensively characterize the complexity of the image.
[0058] In another implementation, instead of treating all regions in the image equally, the module learns to automatically focus on those regions that are more critical to the complexity assessment.
[0059] Specifically, the complexity analysis module first uses a lightweight convolutional network to perform preliminary feature extraction on the fundus image to be processed, obtaining a basic feature map. Then, the module inputs this feature map into an attention sub-network, which can be a spatial attention module. This sub-network outputs an attention weight map of the same size as the basic feature map. Each pixel value in the weight map represents the importance of the corresponding spatial location in determining the image complexity. Subsequently, the module uses this attention weight map to weight the basic feature map, achieving selective feature enhancement and suppression. Finally, the module performs global average pooling on the weighted feature map and maps it through a fully connected layer to generate a complexity parameter vector. Under this architecture, the module learns to focus on typical high-complexity regions during training, such as low-contrast lesion boundaries, areas of dense noise, or areas with obvious motion artifacts.
[0060] The generated complexity parameter vector is a low-dimensional numerical vector generated by the complexity analysis module. Each element of this vector represents a quantized value of the fundus image to be processed in different complexity dimensions, and its numerical range is constrained to a predetermined interval through normalization. This vector characterizes the overall properties of the fundus image to be processed, such as contrast, texture complexity, and noise distribution. For example, for an image with low contrast and significant noise, the module will generate a parameter vector indicating high complexity; while for a clear, high-contrast image, it will generate a parameter vector indicating low complexity.
[0061] S300: Through the encoder, multi-level feature extraction is performed on the fundus image to be processed to generate coded features at different levels.
[0062] An encoder is a deep neural network structure used for feature extraction. It performs multi-level convolution and downsampling operations to abstract features from fine to coarse in the fundus image being processed. The encoder outputs a series of feature maps at different scales, containing rich information ranging from low-level details to high-level semantics.
[0063] The role of the encoder is to perform hierarchical feature abstraction on the fundus image to be processed. The reason for needing multiple levels of features is that a single scale feature cannot simultaneously meet the requirements of localization accuracy and semantic understanding. The encoder is usually composed of multiple cascaded blocks, each block containing convolution and non-linear activation operations, followed by downsampling.
[0064] Through this process, the encoder outputs a series of feature maps. Shallow feature maps are larger and contain more details, while deep feature maps are smaller and contain more abstract semantic information. These encoded features at different levels together constitute a multi-scale description of the original image.
[0065] S400: Through the decoder, based on the complexity parameter vector and the encoded features at different levels, feature fusion is performed to generate fused features.
[0066] The decoder is a deep neural network structure used for feature fusion and resolution restoration. It gradually recovers the spatial dimensions of the feature map through upsampling operations, fusing multi-level features from the encoder in the process. The decoder uses the fused features to reconstruct the precise spatial location and boundary details of the target.
[0067] The decoder is used to restore the spatial resolution of the feature map and integrate multi-scale information. The reason for fusing encoder features is that although the deep features of the encoder are semantically strong, they suffer from severe loss of spatial details, and direct upsampling will lead to blurred boundaries. The traditional fusion method is to directly concatenate, while this embodiment introduces a complexity parameter vector as a guide.
[0068] Specifically, after upsampling at each level, the decoder refers to the image complexity information carried by the complexity parameter vector, adaptively adjusts the encoded features of the corresponding level, and then fuses them. For example, for high-complexity images, the decoder will rely more on and retain the detailed features transmitted by the encoder; for low-complexity images, it will appropriately suppress details that may contain noise and rely more on high-level semantics.
[0069] This process proceeds gradually, ultimately outputting a fused feature that integrates multiple scales and undergoes adaptive complexity optimization. The fused feature retains both the spatial details from the shallow layers of the encoder and the semantic context from the deep paths of the decoder.
[0070] S500: Outputs segmentation results based on fusion features.
[0071] In some embodiments, the segmentation result is output based on fused features, including: Input the fused features into the segmentation head; After the number of channels is mapped to the number of segmentation categories by the convolutional layer in the segmentation head, the activation function in the segmentation head outputs the segmentation result, which represents the probability that each pixel belongs to a specific category.
[0072] The segmentation result is generated by a segmentation head, which can be a convolutional layer that maps the fused features to the final classification space. Since the fused features are still a high-dimensional feature representation, they need to be converted into the class probability of each pixel. The segmentation head performs a convolution operation on the fused features, mapping the number of channels to match the number of segmentation classes. An activation function then outputs the probability that each pixel belongs to either the white patch or the background, forming the final segmentation result image.
[0073] The segmentation result can be a pixel-level classification map with the same size as the fundus image to be processed. Each pixel in the segmentation result is assigned a category label to indicate whether the pixel location belongs to the background or the vitiligo lesion area, thereby achieving accurate division of the vitiligo area in the fundus image.
[0074] like Figure 2 As shown, in some embodiments, the complexity analysis module includes a feature extraction layer, a global pooling layer, and a parameter mapping layer, which is more suitable for the scenario of this application compared to the structures of the aforementioned complexity analysis modules.
[0075] Traditional image statistical feature-based computational methods rely on manually preset metrics, which have weak correlation with the segmentation task's objective and cannot learn a dedicated complexity metric for vitiligo segmentation. Pre-trained feature extraction methods are limited by the domain differences in the pre-training data; features learned from natural images struggle to accurately capture the unique pathological features of fundus medical images. Multi-scale analysis methods have high computational complexity, significantly increasing model inference time and hindering rapid clinical diagnosis. Attention-based methods require additional learning of attention maps, increasing the model's parameter count and training difficulty, potentially leading to overfitting on small-sample medical data.
[0076] In this embodiment, the complexity analysis module is a lightweight, trainable module that processes the fundus images to be processed in parallel with the main segmentation network. The module extracts basic features through convolutional layers, which capture local patterns related to image quality. Global average pooling layers compress spatial information into global descriptors, and fully connected layers map the descriptors into low-dimensional vectors. The core advantage of this module lies in its trainability. The module's parameters are optimized end-to-end along with the encoder and decoder. The optimization process is solely guided by the final segmentation accuracy. This means that the module is driven to learn a complexity representation that is most effective for the segmentation task. This complexity is not a typical image statistic, but rather an adaptive complexity strongly correlated with vitiligo boundary recognition.
[0077] During training, the gradient signal propagates backward through the entire network. The complexity analysis module adjusts its parameters according to the gradient direction. The module focuses on image attributes that truly affect segmentation performance. For example, the module may focus on the contrast-to-noise ratio of the white spot edge region and ignore overall brightness changes that are irrelevant to the segmentation task. This capability is not available in traditional statistical methods with fixed algorithms.
[0078] Furthermore, the complexity analysis module calculates the complexity in parallel with the first layer of the encoder. This design does not introduce excessive computational latency, and the small parameter size of the module avoids the risk of overfitting.
[0079] In summary, through an end-to-end training mechanism, the optimal match between complexity analysis and segmentation tasks is achieved. It can autonomously discover the image complexity features most relevant to white spot segmentation. This task-driven adaptive characteristic is something that other alternative solutions cannot achieve.
[0080] Specifically, the complexity analysis module analyzes the global features of the fundus image to be processed to generate a complexity parameter vector, including: The feature extraction layer performs feature transformation on the fundus image to be processed to extract a first feature map, which includes primary features related to global features. The spatial dimension of the first feature map is compressed through a global pooling layer to obtain a global feature descriptor; The global feature descriptor is mapped to a complexity parameter vector through a parameter mapping layer, which includes at least one fully connected layer.
[0081] The complexity analysis module receives the fundus image to be processed as input. The fundus image to be processed can be a pre-processed standardized image with uniform size and color channels.
[0082] In some embodiments, acquiring the fundus image to be processed includes: Acquire fundus images; the fundus images are color fundus images. The fundus image is size normalized to obtain the first image; Perform contrast enhancement processing on the first image to obtain the second image; The second image is converted to grayscale to obtain the fundus image to be processed.
[0083] Color fundus images are retinal images containing red, green, and blue information captured by a fundus camera. These images fully preserve the original color characteristics of biological tissues. Blood vessels appear as dark red veins, the optic disc area appears as orange-yellow tones, and possible lesion areas appear as white or yellow spots. Color information helps to distinguish different tissue structures.
[0084] Color fundus images are derived from raw data captured by fundus cameras used in clinical examinations. Color fundus images contain the most complete visual information of the retina and can accurately represent the color characteristics of various anatomical structures.
[0085] Size normalization uses a bilinear interpolation algorithm to calculate the new pixel value by weighted averaging of surrounding pixels. This can complete the size transformation while maintaining image continuity. The uniform input size also facilitates batch processing and multi-GPU parallel training.
[0086] Contrast enhancement is then applied to improve the quality of the size-normalized image using a histogram equalization algorithm. This algorithm redistributes the intensity values of image pixels to expand the dynamic range of the image. Histogram equalization maps pixel values that were originally concentrated in a narrow range to the entire usable range, making dark details clearer and bright features more prominent. Some fundus images may suffer from insufficient contrast due to limitations in shooting conditions; appropriate contrast enhancement can make the boundaries of vascular networks and potential lesions more prominent.
[0087] Grayscale conversion transforms a contrast-enhanced color image into a grayscale image. A weighted average method can be used, assigning appropriate weights to the red, green, and blue channels based on the human eye's varying sensitivity to different colors. The green channel is given the highest weight because the human eye is most sensitive to green, and the green channel often contains the richest detail information in fundus images. The reason for grayscale conversion is that while color information can help distinguish tissues in some cases, for vitiligo segmentation tasks, brightness information already contains sufficient structural features. Converting to a single-channel image significantly reduces computation and improves processing efficiency.
[0088] After this series of preprocessing steps, the original color fundus image is converted into a single-channel fundus image with uniform size and appropriate contrast. Then, histogram equalization is used to enhance the contrast between blood vessels and the background, and finally, it is converted into a single-channel grayscale image.
[0089] The preprocessed fundus image is input into the complexity analysis module, which works in parallel with the encoder. This parallel architecture allows complexity analysis to be independent of the main segmentation process, avoiding mutual interference.
[0090] In the complexity analysis module, the feature extraction layer first processes the fundus image to be processed. The 3×3 convolutional layer in the feature extraction layer uses multiple small convolutional kernels to perform sliding window computation on the image. Each kernel is used to detect a specific local feature pattern, such as edges, corners, or texture fragments. A batch normalization layer standardizes the convolutional output, stabilizing the data distribution by subtracting the mean and dividing the variance. The ReLU (Rectified Linear Unit) activation function then performs a non-linear transformation on the normalized result, increasing the model's expressive power. The combination of these three components enables the feature extraction layer to extract meaningful primary feature representations from the original pixels, forming the first feature map.
[0091] The global pooling layer employs the average pooling algorithm, averaging all activation values across each feature channel. This operation transforms the spatially dimensional feature map into a one-dimensional global feature descriptor. Global pooling eliminates spatial location information, focusing on the global statistical properties of the image. By aggregating information from the entire image, this descriptor comprehensively characterizes the image's contrast level, texture complexity, and noise distribution.
[0092] The fully connected layer in the parameter mapping layer maps the high-dimensional global feature descriptor to a low-dimensional space through the learned weight matrix. The neurons in the fully connected layer perform linear combination and non-linear transformation on the input features to capture the high-order interaction relationship between features. This mapping process realizes the transformation from the original image features to the task-related complexity representation. The final output complexity parameter vector is a low-dimensional real number vector, whose dimension is much smaller than that of the input global feature descriptor.
[0093] The weights of the parameter mapping layer, along with the rest of the segmentation network, are optimized through end-to-end supervised training. The training data consists of a dataset of fundus images with pixel-level white spot annotations, and the training objective is to minimize the difference between the network's final segmentation output and the ground truth annotations (i.e., the segmentation loss function).
[0094] Within this training framework, the image complexity analysis module does not rely on any predefined, explicit complexity labels. Instead, through gradient descent, the module is driven to learn an internal mapping—how to infer a task-related complexity beneficial to the final segmentation task from the global statistical features of the fundus image to be processed.
[0095] The generation of this complexity parameter vector lies in the dynamic coordination of the feature flow between the encoder and decoder to minimize the overall segmentation error, thereby indirectly and adaptively responding to the differences in contrast, noise, and boundary sharpness of the fundus image to be processed.
[0096] For example, when given a high-quality fundus image, the feature extraction layer generates highly active feature maps, indicating rich image detail. The descriptors produced by the global pooling layer have high average values across the corresponding channels. The parameter mapping layer maps these statistics into a parameter vector indicating low complexity. Conversely, when given a low-quality image, the feature extraction layer responds weakly, the global pooling yields a lower average value, and ultimately generates a parameter vector with high complexity.
[0097] In some embodiments, to constrain the value of the complexity parameter vector, the complexity parameter vector is normalized by the Sigmoid activation function, and its value is constrained to the range of (0, 1), so that it can be used as a weight later.
[0098] While the complexity analysis model processes the fundus image to be processed, the encoder also receives the fundus image to be processed, performs multi-level feature extraction and downsampling, and see again... Figure 2 In some embodiments, the encoder includes at least four coding blocks, each containing at least two consecutive 3×3 convolutional layers that extract local feature patterns through a filter bank. The coding blocks also include batch normalization layers that normalize the convolutional outputs to stabilize the training process. The coding blocks also include a ReLU activation function to introduce non-linear computational capabilities into the network.
[0099] Each encoding block is followed by a downsampling layer, which reduces the spatial size of the feature map through pooling operations. The downsampling layer uses max pooling operations, including a 2×2 max pooling layer, to retain the most significant feature responses in local regions. This operation gradually expands the receptive field of subsequent convolutional layers, enabling the network to capture a wider range of contextual information.
[0100] The encoder performs multi-level feature extraction on the fundus image to be processed to generate encoded features at different levels, including: The first-level coded features are generated by performing convolution and downsampling on the fundus image to be processed through the first coded block. The second-level encoded features are generated by performing convolution and downsampling on the first-level encoded features through the second encoded block; The third-level encoded features are generated by performing convolution and downsampling on the second-level encoded features through the third encoded block; The fourth-level coded features are generated by performing convolution and downsampling on the third-level coded features through the fourth coded block.
[0101] The encoder receives a preprocessed fundus image as input. The convolutional layers in the first coding block use small convolutional kernels for feature extraction, capturing basic edge and texture patterns. Batch normalization layers normalize the convolutional output, accelerating training convergence and improving model stability. The activation function then introduces a non-linear transformation to enhance the model's expressive power. After these operations, the downsampling layer halves the feature map size using max pooling, reducing computational complexity while preserving important features.
[0102] The feature map obtained after processing by the first coding block enters the second coding block. The second coding block adopts the same structure, but its convolutional layers can capture more complex feature combinations. Due to the expansion of the receptive field, the neurons in the second coding block can respond to a larger range of image regions. The spatial size of the feature map output by this coding block is further reduced, but the number of feature channels increases accordingly, thereby achieving feature compression while retaining the necessary information.
[0103] The third coding block processes the output of the second coding block at a deeper level. The feature map size in this stage is smaller, and each feature unit corresponds to a larger region in the original image. The convolutional layer can detect more abstract feature patterns at this stage, which are closely related to the semantic content of the image. The downsampling operation continues to expand the receptive field, enabling the network to understand a wider range of contextual relationships.
[0104] The fourth coding block, as the final stage of the encoder, receives the output of the third coding block and performs the final transformation. This stage has the smallest feature map size but the most channels, with each feature vector carrying rich semantic information. Through the continuous processing of these four coding blocks, the original image is transformed into a series of multi-scale feature representations ranging from detail to semantics. These different levels of coded features collectively provide a comprehensive image description for the subsequent decoder.
[0105] For example, when processing fundus images containing vitiligo lesions, first-level coding features may contain detailed information about the vessel edges and lesion contours. Second-level coding features may integrate these details to form a more complex structural representation. Third and fourth-level coding features can then understand the overall relationship between the lesion region and the surrounding tissue, providing a semantic basis for segmentation decisions.
[0106] After generating coded features at different levels, continue to see... Figure 2 In some embodiments, the method further includes: Based on the complexity parameter vector, a weight allocation network generates a first weight, a second weight, a third weight, and a fourth weight. The first weight a1, the second weight a2, the third weight a3, and the fourth weight a4 correspond to the coding features at different levels. a1, a2, a3, and a4 correspond to the feature maps of the shallow, middle, mid-high and high layers of the encoder, respectively. This weight allocation network learns the mapping relationship between the global complexity of the image and the importance of features at each level.
[0107] Multiply the first-level encoded feature by the first weight to obtain the first weighted feature; The second-level encoded features are multiplied by the second weights to obtain the second weighted features; Multiply the third-level encoded features by the third weight to obtain the third weighted features; The fourth-level encoded feature is multiplied by the fourth weight to obtain the fourth weighted feature.
[0108] The weight allocation network is used to generate adaptive weights. The network can be composed of fully connected layers and maps to generate multiple adaptive weights corresponding to the number of skip connection layers. The network takes a complexity parameter vector as input and performs non-linear transformation through the internal fully connected layers. Each scalar value output by the weight allocation network corresponds to a feature map weight of a specific layer.
[0109] Before feature stitching in the decoder, the feature maps of the corresponding layers in the encoder are multiplied channel-by-channel with adaptive weights to achieve dynamic scaling and selective enhancement of the encoder features. This process is called weighted fusion, and channel-by-channel multiplication is one of the effective means of implementing feature weighting in existing technologies. This application does not focus on the basic operation itself, but rather on the fact that the weights driving this operation are generated based on real-time, dynamic analysis of the complexity of the fundus image being processed, rather than fixed values or determined through other methods unrelated to the image content. This image-dependent feature fusion strategy is key to achieving adaptive performance improvement.
[0110] Through the above steps, the method provided in this application achieves adaptive feature fusion based on image complexity. When the image complexity analysis module determines that the fundus image to be processed has high complexity (e.g., low contrast, high noise, and blurred vitiligo boundaries), the generated weight vector will tend to amplify the detailed features transmitted by the encoder path (especially shallow and mid-level features) to compensate for the key boundary information that the decoder may lose due to pooling operations, thus assisting the network in making more accurate segmentation decisions in complex scenes. Conversely, for images with low complexity (high contrast, low noise, and clear boundaries), the weight vector will moderately suppress shallow features that may contain redundant details or noise, making the network more reliant on the high-level semantic information extracted by the encoder, thereby avoiding overfitting and noise interference, and improving the model's generalization ability and robustness.
[0111] See Figure 2 The encoder's low-level features are then upsampled by the decoder in the segmentation network and concatenated with the weighted encoder features. In some embodiments, the decoder includes at least four decoding blocks, which are used to perform feature fusion and resolution restoration. The decoder is composed of at least four cascaded decoding blocks, each containing a specific computational layer. This multi-level structure can progressively restore the spatial size of the feature map and integrate multi-source feature information.
[0112] The decoder path also consists of four cascaded decoding blocks, symmetrical to the encoder. Each decoding block includes at least an upsampling layer, which increases the spatial dimension of the feature map through interpolation. The decoding block also includes a feature concatenation layer, which merges feature maps from different sources along the channel dimension. Finally, the decoding block includes a convolutional layer, which refines and fuses the concatenated composite features.
[0113] Specifically, based on the complexity parameter vector and the encoded features at different levels, feature fusion is performed to generate fused features, including: The fourth-level encoded features are upsampled by the decoder to obtain the first upsampled features, and the first upsampled features are concatenated with the fourth weighted features to obtain the first-level fused features. Upsampling is performed on the first-level fusion feature to obtain the second upsampled feature, and the second upsampled feature is concatenated with the third weighted feature to obtain the second-level fusion feature; Upsampling is performed on the second-level fusion feature to obtain the third-level upsampled feature, and the third-level upsampled feature is concatenated with the second-level weighted feature to obtain the third-level fusion feature; Upsampling is performed on the third-level fusion feature to obtain the fourth upsampled feature, and the fourth upsampled feature is concatenated with the first weighted feature to obtain the fusion feature.
[0114] All decoding blocks follow the same processing flow, starting with a 2×2 transposed convolutional layer for upsampling, which doubles the size of the feature map. Then, the upsampled feature map is concatenated with the corresponding level encoder feature map weighted by an adaptive skip connection mechanism in the channel dimension. The concatenated composite feature map is then fused and refined by two 3×3 convolutional layers, a batch normalization layer, and a ReLU activation function to gradually restore the spatial resolution of the segmentation result.
[0115] The feature map output from the last decoded block is fed into a 1×1 convolutional layer, mapping the number of channels to the number of segmentation categories (e.g., 2, representing background and vitiligo). Finally, a sigmoid activation function is applied to output a pixel-level probability map of the same size as the fundus image to be processed, thus obtaining the final fundus vitiligo segmentation result. In this result, the value of each pixel represents its probability of being a vitiligo, and a binarized segmentation mask can be obtained by setting a threshold (e.g., 0.5).
[0116] like Figure 3 As shown in the image, the left side displays the segmentation result of the white spot on the fundus, while the right side shows the original fundus image to be processed. In such high-quality images, the boundary between the target region, i.e., the white spot, and the surrounding normal tissue is usually quite clear, and the image has little noise. This provides a relatively simple environment for the segmentation model.
[0117] As can be seen, the segmentation method provided in this application can segment the white patch region. The left side shows the result after obtaining a binarized segmentation mask by setting a threshold. The region inside the contour line represents the set of pixels the model determines as white patches, i.e., regions with a probability value greater than 0.5. The region outside the contour line represents the pixel region the model determines as background, i.e., regions with a probability value less than or equal to 0.5.
[0118] like Figure 4As shown in the image, the left side displays the segmentation result of leukoplakia in the fundus, while the right side shows the original fundus image to be processed. The image contrast is moderate to low, and the boundaries are not particularly sharp, especially in the edge areas and fine structures, appearing somewhat blurry and grainy. Faced with such low-quality images, the U-Net model struggles to extract effective features from the blurred boundaries and noise. Therefore, it cannot fully convey detailed information, resulting in an inability to accurately segment the contours of lesions, leading to decreased segmentation accuracy and potentially missing some lesions (false negatives).
[0119] The region inside the outline is the set of pixels that the model determines to be white spots, i.e., the region with a probability value greater than 0.5. The region outside the outline is the pixel region that the model determines to be background, i.e., the region with a probability value less than or equal to 0.5. The segmentation method provided in this application can also segment out the white spots.
[0120] In summary, the method provided in this application can adjust behavior patterns according to image status for different scenarios, maintaining stable performance when faced with diverse clinical data.
[0121] Based on the aforementioned image complexity-based fundus image segmentation method, this application provides an image complexity-based fundus image segmentation network, comprising: The complexity analysis module is used to acquire the fundus image to be processed and analyze the global features of the fundus image to generate a complexity parameter vector. The global features include at least contrast, texture complexity, and noise distribution. The encoder, connected to the complexity analysis module, is used to perform multi-level feature extraction on the fundus image to be processed, in order to generate encoded features at different levels. The decoder is used to perform feature fusion based on the complexity parameter vector and the encoded features at different levels to generate fused features; The segmentation head, connected to the decoder, is used to output segmentation results based on fused features.
[0122] In some embodiments, it also includes: A weighting network, connected to the complexity analysis module, is used to generate multiple adaptive weights based on the complexity parameter vector. An adaptive skip connection mechanism is connected to the weight allocation network and the encoder respectively. It is used to multiply the encoded features of different levels with the corresponding adaptive weights to obtain weighted encoded features.
[0123] In some embodiments, the network parameters are obtained through end-to-end supervised training, and the network training process includes: Obtain the training set, which is a dataset of fundus images annotated with white spots; The fundus images in the training set are input into the segmentation network, and forward propagation is performed to output the training segmentation results; The difference between the training segmentation results and the corresponding ground truth labels is calculated to construct the segmentation loss function; Based on the segmentation loss function, the error is backpropagated through the gradient descent algorithm to update the weight parameters of the complexity analysis module, encoder, weight allocation network, decoder and segmentation head; During the training process, the image complexity analysis module learns the mapping relationship from global features of fundus images in the training set to complexity parameter vectors based on the segmentation loss function.
[0124] The fundus images in the training set are input into the segmentation network. The images pass through the network components in sequence. The complexity analysis module first extracts the global features of the image and generates a complexity parameter vector. The encoder simultaneously performs multi-level feature extraction on the image, generating encoded features at different scales. The weight allocation network generates corresponding adaptive weights based on the complexity parameter vector. The adaptive skip connection mechanism multiplies the encoded features with the adaptive weights to generate weighted encoded features. The decoder gradually fuses the weighted encoded features through upsampling and feature concatenation operations, and finally outputs the fused features. The segmentation head converts the fused features into pixel-level prediction results. The entire forward propagation process completes the full computation from the fundus image to be processed to the segmentation result.
[0125] The segmentation loss function takes the network's predicted segmentation results and the ground truth labels as input. It calculates the degree of difference between the two by comparing them pixel by pixel. The commonly used cross-entropy loss function compares the predicted probability distribution of each pixel with the ground truth label, penalizing incorrect classification predictions. The Dice loss function evaluates the consistency between the predicted region and the ground truth region from the perspective of region overlap. The value of the loss function characterizes the accuracy of the current network prediction; the larger the value, the greater the prediction error.
[0126] Backpropagation error is calculated based on the segmentation loss function. The backpropagation algorithm starts from the loss function and calculates the gradient layer by layer in reverse according to the path of the computation graph. The chain rule is used to calculate the contribution of each network parameter to the final loss. The gradients are obtained for the fully connected layer parameters in the complexity analysis module, the gradients for the convolutional layer parameters in the encoder and decoder, and the gradients for the mapping parameters in the weight allocation network. These gradient values accurately describe the direction and magnitude of adjustment required for each parameter.
[0127] Finally, the weight parameters in the network are updated. The optimization algorithm updates all trainable parameters in the network based on the gradient values calculated by backpropagation. The commonly used stochastic gradient descent algorithm adjusts the parameter values in the reverse direction of the gradient according to the learning rate. Each parameter update makes the network's segmentation predictions closer to the true labels. The entire training process is repeated multiple times until the loss function converges to a stable value.
[0128] During training, the image complexity analysis module, guided by the segmentation loss function, autonomously learns the mapping relationship from global features of the fundus image to a complexity parameter vector. This learning process does not require pre-defined complex mathematical formulas or additional complexity labels. Through end-to-end training signals, the module automatically discovers the image features most helpful in improving segmentation accuracy and encodes these features into complexity parameter vectors. For example, the module might learn to focus on features such as the sharpness of blood vessel boundaries, the contrast of lesion areas, and the intensity of background noise, mapping combinations of these features to appropriate complexity representations.
[0129] Similar parts between the embodiments provided in this application can be referred to mutually. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods extended from the solution of this application without creative effort shall fall within the scope of protection of this application.
Claims
1. A fundus image segmentation method based on image complexity, characterized in that, include: Acquire the fundus image to be processed; The global features of the fundus image to be processed are analyzed by the complexity analysis module to generate a complexity parameter vector. The global features include at least contrast, texture complexity, and noise distribution. The encoder performs multi-level feature extraction on the fundus image to be processed to generate coded features at different levels. The decoder performs feature fusion based on the complexity parameter vector and the encoded features at different levels to generate fused features. Based on the fusion features, the segmentation result is output.
2. The fundus image segmentation method based on image complexity according to claim 1, characterized in that, The complexity analysis module includes a feature extraction layer, a global pooling layer, and a parameter mapping layer; The step of analyzing the global features of the fundus image to be processed through a complexity analysis module to generate a complexity parameter vector includes: The feature extraction layer performs feature transformation on the fundus image to be processed to extract a first feature map, which includes primary features related to the global features. The spatial dimension of the first feature map is compressed through the global pooling layer to obtain a global feature descriptor; The parameter mapping layer maps the global feature descriptor into a complexity parameter vector. The parameter mapping layer includes at least one fully connected layer.
3. The fundus image segmentation method based on image complexity according to claim 1, characterized in that, The encoder includes at least four coding blocks, each coding block including at least one convolutional layer, a batch normalization layer and an activation function, and each coding block is followed by a downsampling layer. The step involves performing multi-level feature extraction on the fundus image to be processed using an encoder to generate encoded features at different levels, including: The fundus image to be processed is subjected to convolution and downsampling through the first coding block to generate the first level coding features; The first-level encoded features are convolutionally processed and downsampled using the second encoding block to generate the second-level encoded features; The third-level encoded features are generated by performing convolution and downsampling on the second-level encoded features through the third encoded block; The fourth-level coding features are generated by performing convolution and downsampling on the third-level coding features through the fourth coding block.
4. The fundus image segmentation method based on image complexity according to claim 3, characterized in that, The method further includes: Based on the complexity parameter vector, a first weight, a second weight, a third weight, and a fourth weight are generated through a weight allocation network. The first weight, the second weight, the third weight, and the fourth weight correspond to the coding features at different levels. Multiply the first-level encoded feature by the first weight to obtain the first weighted feature; The second-level encoded features are multiplied by the second weight to obtain the second weighted features; The third-level encoded features are multiplied by the third weight to obtain the third weighted features; The fourth-level encoded feature is multiplied by the fourth weight to obtain the fourth weighted feature.
5. The fundus image segmentation method based on image complexity according to claim 4, characterized in that, The decoder includes at least four decoding blocks, and each decoding block includes at least an upsampling layer, a feature concatenation layer, and a convolutional layer. The step of performing feature fusion based on the complexity parameter vector and the encoded features at different levels to generate fused features includes: The fourth-level encoded features are upsampled by the decoder to obtain the first upsampled features, and the first upsampled features are concatenated with the fourth weighted features to obtain the first-level fused features. Upsampling is performed on the first-level fusion feature to obtain the second upsampled feature, and the second upsampled feature is concatenated with the third weighted feature to obtain the second-level fusion feature; Upsampling is performed on the second-level fusion feature to obtain the third-level upsampled feature, and the third-level upsampled feature is concatenated with the second-level weighted feature to obtain the third-level fusion feature; Upsampling is performed on the third-level fusion feature to obtain a fourth upsampled feature, and the fourth upsampled feature is concatenated with the first weighted feature to obtain the fusion feature.
6. The fundus image segmentation method based on image complexity according to claim 5, characterized in that, The segmentation result output based on the fusion features includes: The fusion features are input into the segmentation head; After the number of channels is mapped to the number of segmentation categories by the convolutional layer in the segmentation head, the segmentation result is output through the activation function in the segmentation head. The segmentation result represents the probability that each pixel belongs to a specific category.
7. The fundus image segmentation method based on image complexity according to claim 1, characterized in that, The acquisition of the fundus image to be processed includes: Acquire fundus images, wherein the fundus images are color fundus images; The fundus image is subjected to size normalization processing to obtain a first image; Perform contrast enhancement processing on the first image to obtain the second image; The second image is converted to grayscale to obtain the fundus image to be processed.
8. A fundus image segmentation network based on image complexity, characterized in that, include: The complexity analysis module is used to acquire the fundus image to be processed and analyze the global features of the fundus image to generate a complexity parameter vector. The global features include at least contrast, texture complexity, and noise distribution. The encoder, connected to the complexity analysis module, is used to perform multi-level feature extraction on the fundus image to be processed, so as to generate coded features at different levels. The decoder is used to perform feature fusion based on the complexity parameter vector and the encoded features at different levels to generate fused features; A segmentation head, connected to the decoder, is used to output segmentation results based on the fusion features.
9. The fundus image segmentation network based on image complexity according to claim 8, characterized in that, Also includes: A weight allocation network, connected to the complexity analysis module, is used to generate multiple adaptive weights based on the complexity parameter vector; An adaptive skip connection mechanism is connected to the weight allocation network and the encoder respectively, and is used to multiply the encoded features of different levels with the corresponding adaptive weights to obtain weighted encoded features.
10. The fundus image segmentation network based on image complexity according to claim 9, characterized in that, The parameters of the network are obtained through end-to-end supervised training, and the training process of the network includes: Obtain a training set, which is a dataset of fundus images annotated with white spots; The fundus images in the training set are input into the segmentation network, and forward propagation is performed to output the training segmentation results; Calculate the difference between the trained segmentation results and the corresponding ground truth labels to construct a segmentation loss function; Based on the segmentation loss function, the error is backpropagated through the gradient descent algorithm to update the weight parameters of the complexity analysis module, encoder, weight allocation network, decoder and segmentation head; During the training process, the image complexity analysis module learns the mapping relationship from the global features of the fundus images in the training set to the complexity parameter vector based on the segmentation loss function.