Eye ground color photo segmentation model construction method for pathological myopia intelligent diagnosis

By building a shared feature extractor and a scalable segmentation task head, multi-task collaborative learning is achieved, and the problems of task isolation and poor model scalability in pathological myopia fundus image segmentation are solved, and segmentation accuracy and model adaptability are improved.

CN119888232APending Publication Date: 2025-04-25CHINA UNIV OF MINING & TECH +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510066781.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art has problems of isolated segmentation tasks, inefficient and poor model scalability in fundus image segmentation for pathological myopia.

Method used

An intelligent diagnostic method for pathological myopia is adopted to build a shared feature extractor and an extensible segmentation task head, realize multi-task collaborative learning, share image features and dynamically expand the task head structure.

Benefits of technology

It improves segmentation accuracy, enhances the scalability and adaptability of the model, reduces the consumption of training time and computing resources, and improves the efficiency and accuracy of disease diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888232A_ABST
    Figure CN119888232A_ABST
Patent Text Reader

Abstract

The invention discloses a fundus color photo segmentation model construction method for intelligent diagnosis of pathological myopia. The method comprises the following steps: constructing an image preprocessing module by using an image enhancement unit, a size adjustment unit and a normalization unit; a convolutional neural network is adopted as a backbone network, and a shared feature extractor module is built in combination with cavity convolution, a multi-scale pyramid pooling module and a space attention mechanism; the design of dynamically expanding an output channel is adopted, and a task head segmentation module is built through the combination of an upper sampling layer, jump connection and an output convolution layer; sequentially connecting an image preprocessing module, a shared feature extractor module and a segmentation task head module to form a segmentation basic model; model training; and performing fine tuning on the new task to obtain a segmentation basic model of the newly-added task. According to the method, new tasks can be quickly adapted according to different requirements, the consumption of training time and computing resources can be effectively reduced, and the efficiency and accuracy of disease diagnosis can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing and computer vision, and in particular relates to a method for constructing a fundus color photograph segmentation model for intelligent diagnosis of pathological myopia. Background Art

[0002] In recent years, medical artificial intelligence has made significant progress in the fields of disease diagnosis and image analysis, especially in fundus image processing. Through deep learning technology, especially the widespread application of convolutional neural networks (CNNs), artificial intelligence has performed well in image classification, object detection and segmentation tasks, and has gradually reached or exceeded the diagnostic level of clinicians in medical applications. Automated analysis based on artificial intelligence not only improves diagnostic efficiency and accuracy, but also makes efficient disease screening possible.

[0003] Pathological myopia is an ophthalmic disease with high myopia accompanied by pathological changes. Its main features include retinal degeneration, macular atrophy, posterior scleral staphyloma, optic disc tilt, etc. These lesions seriously threaten the patient's visual health and have become one of the important causes of global visual impairment. Through color fundus photography (CFP), rich fundus image information can be obtained, and pathological myopia can be diagnosed early and analyzed based on the fundus image information. However, the manual interpretation of fundus color photos is labor-intensive, time-consuming and labor-intensive, and it is easy to cause inconsistent diagnostic results due to subjective differences between doctors. Therefore, the use of artificial intelligence technology to automatically segment and analyze lesions of fundus color photos has become an important technical guarantee for improving diagnostic results.

[0004] Fundus color photographs contain optic discs, blood vessels, macular areas, and lesion areas. The accurate segmentation of these areas is of great significance for the diagnosis and treatment of pathological myopia. For example, patients with pathological myopia often have tilted or enlarged optic discs. Accurate segmentation of the optic disc area can help evaluate pathological axial changes and optic nerve damage. Although deep learning methods have made significant progress in fundus image segmentation, there are still the following major problems in practical applications for pathological myopia: First, the segmentation task is isolated and single, lacking information sharing and collaboration between tasks, and unable to fully utilize the intrinsic connection between the optic disc, macula, and lesion areas, which affects the accuracy of segmentation to a certain extent; second, currently single-task models are mainly used, but pathological myopia requires reference to the segmentation results of multiple tasks, and multiple calls to different models are inefficient and have low feasibility in practical applications; finally, current models are mainly based on fixed segmentation tasks, with poor scalability. If new tasks need to be added, the entire model needs to be retrained. In view of the above problems, this paper studies a basic model for fundus color photo segmentation for intelligent diagnosis of pathological myopia, aiming to achieve multi-task collaborative learning by building a shared feature extractor and an extensible segmentation task head, so as to simultaneously process multiple pathological myopia-related segmentation tasks in a single model, such as optic disc, macula, blood vessels and lesion areas. By sharing the underlying feature extractor, this method enables different tasks to share image features in the same network, thereby reducing redundant calculations and effectively improving efficiency. At the same time, by dynamically expanding the task head structure, new tasks can be flexibly added without retraining the entire model, effectively solving the problems of information isolation between tasks and poor model scalability. Compared with the traditional single-task model, this method not only improves the segmentation accuracy, but also makes the model more scalable and adaptable in practical applications. It can quickly adapt to new tasks according to different needs, reduce training time and consumption of computing resources, and improve the efficiency and accuracy of disease diagnosis. In addition, the model can share knowledge between multiple tasks, thereby forming a synergistic effect between different tasks, further improving the overall performance of fundus image analysis, especially in the automatic diagnosis of complex diseases such as pathological myopia. It has great potential.

[0005] In summary, the main advantages of using the basic model for intelligent segmentation of fundus color photos are: improving computational efficiency, reducing the number of model parameters, sharing features to improve collaborative optimization between tasks, reducing training costs, improving model scalability, and reducing the risk of overfitting. These advantages make multi-task learning an effective strategy that can handle multiple segmentation tasks simultaneously within a unified framework, thereby saving resources and improving the collaborative effect between tasks. Therefore, using a basic model to handle multiple segmentation tasks is a very efficient, scalable and easy-to-manage option, which can help doctors provide faster, more accurate and efficient tools, provide a good basis for doctors to diagnose pathological myopia and other ophthalmic diseases, and provide patients with better medical care, thereby improving their quality of life and health. Research and application in this field are at a critical moment when they are urgently needed. Summary of the invention

[0006] In response to the problems existing in the above-mentioned prior art, the present invention provides a method for constructing a fundus color photograph segmentation model for intelligent diagnosis of pathological myopia. The method can quickly adapt to new tasks according to different needs, effectively reduce training time and consumption of computing resources, and can greatly improve the efficiency and accuracy of disease diagnosis, so that the model has higher scalability and stronger adaptability in practical applications. It can provide a scalable and high-performance solution for the intelligent segmentation of fundus images and has strong practical application value.

[0007] In order to achieve the above object, the present invention provides a method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia, which specifically comprises the following steps:

[0008] Step 1: Build the image preprocessing module;

[0009] An image preprocessing module is constructed using an image enhancement unit, a resizing unit and a normalization unit; wherein the image enhancement unit is used to perform data enhancement processing on the input fundus color photo image to simulate image changes under different acquisition conditions to obtain diversified image data; the resizing unit is used to crop and resize the input fundus color photo image to make the image size meet the input requirements; the normalization unit is used to perform normalization processing on the input fundus color photo image;

[0010] Step 2: Build a shared feature extractor module;

[0011] The convolutional neural network is used as the backbone network, and the shared feature extractor module is built by combining the dilated convolution, multi-scale pyramid pooling module and spatial attention mechanism. The specific process is as follows:

[0012] A1: Build the backbone network;

[0013] The basic convolution module is used as the backbone network. The basic convolution module is used to extract low-level features of the input image. It includes 4 convolution modules, each of which consists of several 3×3 convolution layers and a maximum pooling operation.

[0014] A2: Introducing the dilated convolution module;

[0015] A dilated convolution module is added to the 3rd and 4th layers of the basic convolution module to introduce holes in the pixel sampling interval of the standard convolution kernel and expand the area covered by the convolution kernel without changing the resolution of the input image. The dilated convolution module is used to expand the receptive field to capture a wide range of contextual information.

[0016] A3: Introduce multi-scale pyramid pooling module;

[0017] A multi-scale pyramid pooling module is introduced after the 4th layer of the basic convolution module to extract global context information through pooling operations at different scales; the multi-scale pyramid pooling module is used to extract multi-scale features;

[0018] A4: Add spatial attention mechanism;

[0019] A spatial attention mechanism is added after the multi-scale pyramid pooling module to highlight the feature expression of the segmentation target area and suppress background noise;

[0020] Step 3: Build the segmentation task head module;

[0021] The design of dynamically expanding the output channel is adopted, and the segmentation task head module is built by combining the upsampling layer, skip connection and output convolution layer; the upsampling layer is used to restore the spatial resolution of the feature map through upsampling operation; the skip connection is used to splice the encoded features of different layers in the shared feature extractor with the features in the decoder to supplement the detail information lost in the upsampling process; the output convolution layer adopts 1×1 convolution, and its output channel number is dynamically configured, supporting single-channel or multi-channel output, which is used to map the multi-channel feature map to the segmentation mask corresponding to the number of output channels and output it;

[0022] Step 4: Build a basic segmentation model;

[0023] The image preprocessing module, the shared feature extractor module and the segmentation task head module are sequentially connected to form a segmentation basic model;

[0024] Step 5: Model training;

[0025] B1: Construct multi-task segmentation loss;

[0026] Combining Dice loss and cross entropy loss, the segmentation loss function L is obtained according to formula (1): seg ;

[0027]

[0028] In the formula, C initial is the number of channels of the initial task; P c and G c are the prediction results and true annotations of the cth task respectively; L dice and L ce Represent Dice loss and cross entropy loss respectively;

[0029] B2: Construct the joint loss of the original task;

[0030] According to formula (2), the joint loss L of the original task is obtained old ;

[0031]

[0032] Where, L seg,i is the segmentation loss of the i-th task; i is the loss weight of each task, which is used to balance the optimization impact of each task; N is the total number of tasks;

[0033] B3: initial optimization strategy;

[0034] When training the initial shared feature extractor, an end-to-end optimization method is used to update the parameters of the shared feature extractor and the segmentation task head at the same time; specifically, the Adam optimizer is used and batch training is performed. In the process of optimizing the model parameters, the initial learning rate is set to 10 -3 , and the cosine annealing strategy is used to gradually decay the learning rate, as shown in formula (3); in the batch training process, each training uses a data batch containing multiple task annotations, the annotation of each task corresponds to the input image, and the unlabeled task channel is set to zero;

[0035]

[0036] Where η t is the learning rate of the tth round, η max and η min are the initial and minimum learning rates respectively, and T is the total number of training;

[0037] B4: The segmentation basic model of the original task is obtained after basic training;

[0038] Step 6: Fine-tune the new task;

[0039] By dynamically expanding the output channels of the model, new segmentation tasks can be seamlessly generated while maintaining the performance of the original tasks. The specific process is as follows:

[0040] C1: Extended output channel;

[0041] C11: According to the current number of task categories or the requirements of new tasks, the expanded number of output channels C is obtained by formula (4) new ;

[0042] C new =C old +C task (4);

[0043] In the formula, C old is the number of output channels of the original task, C task The number of output channels required for the new task;

[0044] C12: Add new convolution kernel weights to the output convolution layer of the segmentation task head module to achieve the expansion of the output channel, where the expanded convolution kernel weight W is obtained according to formula (5): new ;

[0045] W new =Concat(W old ,W extra )(5);

[0046] Where W old is the convolution kernel weight of the original segmentation task, which remains unchanged, W extra is the convolution kernel weight of the newly added task, W new is the weight of the expanded convolution kernel, and the feature map corresponding to the newly added task is represented by W extra Learning generation;

[0047] C2: Data integration;

[0048] The data of all tasks are integrated into a joint training dataset, and the integrated joint dataset D is obtained according to formula (6): train ;

[0049] D train ={(X i ,Y old,i ,Y new,i )}(6);

[0050] Where, X i is the input image, Y old,i and Y new,i They are the labels of the original tasks and the newly added tasks respectively;

[0051] C3: Constructing the joint loss function after adding new tasks;

[0052] According to formula (7), the connection loss function L after adding the task is obtained total ;

[0053] L total =L old +λ new L new (7);

[0054] Where, L new is the segmentation loss of the newly added task, L new =L dice (P new ,G new )+L ce (P new ,G new ), where P c and G c is the prediction result and true annotation of the original task channel, P new and G new is the prediction result and true label of the newly added task channel, λ new is the loss weight of the newly added task, which is used to dynamically adjust the optimization balance between the new task and the original task;

[0055] C4: New optimization strategy;

[0056] C41: Freeze the shared feature extractor, keep the parameters of the shared feature extractor frozen, and only optimize the convolution kernel weight W of the newly added task channel extra ;

[0057] C42: Joint optimization of the segmentation head, jointly optimize the extended segmentation head, including the original task channel weight W old and the newly added task channel weight W extra ;

[0058] C43: Data ratio adjustment. If the new task data is small, increase λ new The optimization priority of the newly added tasks is improved by using the value method, so as to dynamically adjust the proportion of training samples according to the data volume of the original tasks and the new tasks, and balance the data distribution of each task;

[0059] C44: Learning rate control, using a lower initial learning rate to ensure the gradual optimization of the weights of the newly added tasks while preventing large disturbances to the original task weights.

[0060] C5: By combining dataset D train Joint training is performed and the segmentation basic model for the newly added task is obtained after optimization through the new optimization strategy.

[0061] As a preference, in step 2 A2, the void ratio is set to {1, 2, 4, 8}.

[0062] As a preferred embodiment, in step 2 A2, when performing the dilated convolution, the value F at the position (x, y) in the convolution output feature map is obtained according to formula (8): atrous (x,y);

[0063]

[0064] Where w(i,j) is the weight of the convolution kernel, I(x,y) is the pixel value at position (x,y) of the input image, k is the size of the convolution kernel, and r is the dilation rate, which represents the interval between each sampling point in the convolution kernel.

[0065] As a preferred embodiment, in step 2 A3, during the pooling operation of the multi-scale pyramid pooling module, a fixed-size feature map is first generated, and then restored to the original feature map size using bilinear interpolation according to formula (9), to obtain the feature map P after the i-th pooling operation i Then, according to formula (10), all pooled features are concatenated into a unified multi-scale feature representation F PSP ;

[0066] P i =Upsample(Pool i (F))(9);

[0067] F PSP =Concat(P1,P2,P3,P4)(10);

[0068] Where i∈{1,2,3,4}.

[0069] As a preferred embodiment, in step 2 A4, the spatial attention mechanism generates an attention weight map S by calculating the importance distribution of the feature map at each spatial position, and multiplies it point by point with the input feature map to highlight the feature expression of the segmentation target area. The specific process is as follows:

[0070] A41: Input feature map F∈R H×W×C Apply global average pooling and generate the average single channel feature map F according to formula (11) avg ; At the same time, for the input feature map F∈R H×W×C Apply global maximum pooling and generate the maximum single-channel feature map F according to formula (12) max ;

[0071] F avg =AvgPool(F)(11);

[0072] F max =MaxPool(F)(12);

[0073] A42: Perform convolution to calculate the attention weight. According to formula (13), the pooled feature map is concatenated along the channel dimension and passed through a 7×7 convolution layer to generate the attention weight map S.

[0074] S = σ(Conv 7×7 ([F avg ,F max ]))(13);

[0075] Where σ represents the sigmoid activation function and the weight map S∈R H×W The value of is between [0, 1];

[0076] A43: Weight adjustment feature map. According to formula (14), the weight map S is multiplied point by point with the input feature map to generate and output the enhanced feature map F. attention ;

[0077] F attention =S·F(14).

[0078] As a preferred embodiment, in step 3, the segmentation task head module is used to gradually decode the high-level features output by the shared feature extractor into a segmentation mask consistent with the size of the input image, and provide an independent channel for each segmentation task. The specific process is as follows:

[0079] D1: Restore the spatial resolution of the feature map through a series of upsampling operations, from The shared feature map is gradually restored to; for the input image, up-sampled transposed convolution is performed according to formula (15) to obtain the height H of the output feature map out ;

[0080] H out =(H in -1)·s+k-2·padding(15);

[0081] In the formula, H out Represents the height of the output feature map, H in Represents the height of the input feature map, s represents the step size, k represents the convolution kernel size, and padding represents the padding size;

[0082] D2: Adjust the step size and kernel size of the transposed convolution to expand the size of the feature map layer by layer. At the same time, according to formula (16), the feature map is refined using 3×3 convolution after each upsampling to enhance the detail expression capability of the feature.

[0083] F out =σ(Conv 3×3 (F up ))(16);

[0084] In the formula, σ represents the ReLU activation function, Fup is the feature map after upsampling;

[0085] D3: For the features of the lth layer in the shared feature extractor and the features of the decoder layer l Perform skip connection and obtain the feature map after fusion of the lth layer according to formula (17)

[0086]

[0087] In the formula, is the feature of the lth layer in the shared feature extractor; is the feature of the decoder layer l;

[0088] D4: Dynamically adjust the number of output channels according to the current number of task categories or the requirements of new tasks, and obtain the final output feature map F according to formula (18) output ;

[0089] F output =Conv 1×1 (F fusion ,C new )(18).

[0090] As a preferred embodiment, in step 5 B1, the Dice loss L is obtained according to formula (19): dice .

[0091]

[0092] Where P c and G c are the prediction results and true annotations of the cth task respectively, and ε is a small positive value to prevent the denominator from being zero;

[0093] As a preferred embodiment, in step 5 B1, the cross entropy loss L is obtained according to formula (20): ce .

[0094]

[0095] Where N is the total number of pixels, G c (i) and P c (i) are the true value and predicted value of the i-th pixel respectively.

[0096] As a preference, in C44 in step 6, the lower initial learning rate is 10 -4 .

[0097] The present invention provides a method for constructing a basic model of fundus color photo segmentation for intelligent diagnosis of pathological myopia, which includes: a preprocessing module, which is used to standardize and perform data enhancement processing on the input fundus color photo images; a shared feature extractor, which is used to extract multi-scale global features through a backbone network; a segmentation task head, which gradually decodes the high-level features output by the shared feature extractor into a segmentation mask consistent with the input image size, and provides an independent channel for each segmentation task; model training, the initial shared feature extractor training is the key to the optimization of the entire model, and its purpose is to learn to extract high-quality features shared by multiple tasks from fundus images, while ensuring that the segmentation performance of each task is balanced; new task fine-tuning, the purpose is to achieve seamless generation of new segmentation tasks by dynamically expanding the output channels of the model, while keeping the performance of the original tasks unaffected. The network architecture flow chart of the present invention is as follows Figure 1 shown.

[0098] In one aspect of the present invention, the artificial neural network involved includes a preprocessing module, which is used to prepare the input fundus color photo image to improve the accuracy of the subsequent neural network in extracting image features, thereby optimizing the segmentation performance of the fundus color photo intelligent segmentation basic model. This preprocessing module includes the following three key units: an image enhancement unit, which is designed to perform data enhancement operations on the input fundus color photo image, simulate image changes under different acquisition conditions, and improve the model's adaptability to diversified data; a resizing unit, which is responsible for cropping and resizing the target fundus image to adapt to the network input; a normalization unit, which is used to normalize the target fundus image and the reference fundus image. These units work together to perform all-round optimization processing on the input fundus color photo image, ensuring that important areas and features in the image are retained and enhanced, thereby improving the accuracy of feature extraction of the subsequent neural network in the segmentation task, and ultimately improving the intelligent segmentation performance of the optic disc, macula, blood vessels and lesion areas.

[0099] The shared feature extractor involved in the present invention is different from the traditional single-task feature extraction method. The shared feature extractor can extract multi-scale global features shared by multiple tasks in the same backbone network, rather than just optimizing specific features for a single task. This shared feature extraction method helps to make full use of the global information in the input image, while providing unified basic feature support for different segmentation tasks (such as optic disc segmentation, macular area segmentation, blood vessel segmentation and lesion area segmentation). For example, in the fundus color image of pathological myopia, there is an anatomical correlation between the optic disc, macular area and vascular network, and the lesion area may be located around these structures. The shared feature extractor can extract unified multi-scale features for these structures through the backbone network, while capturing global contextual information and local details. This method can not only reduce the computational complexity of the model, but also promote information interaction between tasks through shared features, and improve the ability to understand each task. The advantage of the shared feature extractor is that it can not only provide high-quality input features for each task branch, but also improve the network's segmentation capability for complex lesions (such as posterior scleral staphyloma and macular hole) through unified modeling of global features and detail features, thereby providing more comprehensive and accurate feature support for subsequent task branch networks.

[0100] In addition, the segmentation task head involved in the present invention adopts a design of dynamically expanding output channels, and optimizes the segmentation effect through a combination of upsampling, convolution refinement and jump connections. The segmentation task head gradually restores the spatial resolution of high-level features output by the shared feature extractor through a series of transposed convolution operations, and splices features at different levels through jump connections, thereby restoring detail information and improving segmentation accuracy. After upsampling, the feature map is further enhanced through convolution refinement to further enhance its detail expression ability and avoid errors introduced by interpolation noise. In order to adapt to the seamless addition of future tasks, the segmentation task head is designed with a mechanism for dynamically adjusting the number of output channels, which can flexibly expand the output dimension according to the number of categories of the newly added tasks, ensuring that the newly added tasks will not affect the performance of the original tasks. Through this design, the segmentation task head can easily cope with the expansion requirements of tasks while ensuring the performance of multi-task segmentation, and realize efficient and scalable segmentation task processing.

[0101] In addition, the present invention adopts a joint multi-task training strategy, aiming to optimize the segmentation performance of multiple tasks simultaneously by sharing feature extractors. During the training process, the model uses a segmentation loss function that combines Dice loss and cross entropy loss. By optimizing these losses, it can accurately capture the segmentation boundaries of different regions and solve the problem of category imbalance. In addition, the joint multi-task loss further ensures information sharing and collaborative optimization between each segmentation task, avoids competition between tasks, and improves the segmentation accuracy of each task. During training, the model adopts an end-to-end optimization method, using the Adam optimizer combined with the cosine annealing learning rate strategy to ensure the stability and convergence of the optimization process. Through this training method, the model can efficiently learn multi-task shared features, so that it has good adaptability and scalability when dealing with different types of lesions, and can lay a solid foundation for the expansion of subsequent new tasks, reduce the computational burden of repeated training, and improve the overall training efficiency.

[0102] In addition, in the process of fine-tuning the new task in the present invention, by expanding the output channel of the model, the seamless addition of the newly added segmentation task can be achieved without affecting the performance of the original task. Specifically, by dynamically expanding the number of output channels of the segmentation task head, the model can directly add new tasks on the basis of existing tasks, avoiding the complexity of retraining the entire model. When expanding the output channel, it is only necessary to increase the convolution kernel weight for the new task, and the convolution kernel weight of the original task remains unchanged, which ensures that the segmentation performance of the original task is not affected in any way. At the same time, the data of the newly added task and the data of the original task participate in the training together, and the model optimizes the performance of all tasks through the joint loss function. The design of this module not only ensures the efficient training of the new task, but also avoids the interference of the new task training on the performance of the original task by freezing the shared feature extractor. By dynamically adjusting the loss weight, data ratio and learning rate and other strategies, the model can flexibly respond to the data volume and importance of different tasks, thereby realizing multi-task collaborative optimization. Finally, this fine-tuning method not only improves the scalability and flexibility of the model, but also significantly simplifies the process of task expansion and model update, providing an efficient and scalable solution for multi-task segmentation.

[0103] Compared with the prior art, the present invention has the following advantages:

[0104] 1) Multi-task collaborative segmentation: In the segmentation of fundus images of pathological myopia, each image usually contains multiple lesion areas (such as optic disc, macula, blood vessels and lesions), and there may be correlations between these areas. The present invention provides more comprehensive feature information support for the model through the collaborative design of shared feature extractors and segmentation task heads, which can not only uniformly optimize multiple tasks, but also capture the intrinsic connections between regions. This method significantly improves the segmentation performance of the model in complex lesion scenarios, and helps the model to more comprehensively and accurately identify and analyze fundus lesion areas.

[0105] 2) Sharing features to improve efficiency and segmentation accuracy: The present invention avoids the computational overhead of extracting features independently for each task by sharing the underlying feature extractor, thus reducing the consumption of computing power. Sharing features not only reduces redundant calculations, but also improves the synergy effect in multi-task learning, allowing the model to extract global information more efficiently when processing multiple lesion areas. This approach greatly improves the computing efficiency and the computing speed of the model, while reducing the consumption of processor memory.

[0106] 3) Strong model scalability: The segmentation task head designed in the present invention is highly flexible and can be dynamically expanded to cope with new segmentation tasks. This expansion method does not require retraining the entire model, and new task goals can be achieved by fine-tuning the newly added output channels. This design method makes the model more adaptable and scalable when facing new lesion tasks, while avoiding the tedious retraining process, greatly reducing the training time and consumption of computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0107] Figure 1 is a flow chart of the architecture of the present invention;

[0108] Figure 2 is a network architecture diagram of a shared feature extractor module in the present invention;

[0109] Figure 3 It is a network flow chart of the segmentation task head module in the present invention;

[0110] Figure 4 It is a flow chart of the segmentation basic model training in the present invention;

[0111] Figure 5 It is an architectural diagram of the new task fine-tuning process in the present invention. DETAILED DESCRIPTION

[0112] The present invention will be further described below.

[0113] The purpose of the present invention is to provide a method for constructing a basic model of fundus color photo segmentation for intelligent diagnosis of pathological myopia in view of the technical problems of insufficient detail segmentation, isolated task processing and poor model scalability in the existing technical methods in the segmentation of pathological myopia fundus images. First, the input fundus color photo image is preprocessed. On the one hand, the image is standardized and resized to adapt the image to the input requirements of the network. On the other hand, the adaptability of the model to diversified images is improved through data enhancement processing; then, the fundus image is subjected to multi-scale global feature extraction through a shared feature extractor to provide a unified basic feature for subsequent segmentation tasks; then, the segmentation task head can easily cope with the expansion requirements of the task while ensuring the multi-task segmentation performance, and realizes efficient and scalable segmentation task processing; then, through the model training module, a joint multi-task training strategy is adopted to optimize the segmentation performance of multiple tasks at the same time through a shared feature extractor; finally, when there is a new task segmentation requirement, the new task is fine-tuned, and by expanding the output channel of the model, the seamless addition of the newly added segmentation task can be realized without affecting the original task performance.

[0114] In order to more clearly illustrate the objectives, technical solutions and advantages of the present invention, the present invention will be further described comprehensively and clearly with reference to the accompanying drawings and implementation steps.

[0115] like Figure 1 As shown, the present invention provides a method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia, which specifically includes the following steps:

[0116] Step 1: Build an image preprocessing module; through image preprocessing, the input fundus color photo image can be prepared to improve the accuracy of image feature extraction by the subsequent neural network, thereby optimizing the segmentation performance of the basic model of fundus color photo intelligent segmentation.

[0117] An image preprocessing module is constructed using an image enhancement unit, a resizing unit and a normalization unit; wherein the image enhancement unit is used to perform data enhancement processing on the input fundus color photo image to simulate image changes under different acquisition conditions to obtain diversified image data, thereby improving the model's adaptability to diversified data; the resizing unit is used to crop and resize the input fundus color photo image to make the image size meet the input requirements; the normalization unit is used to perform normalization processing on the input fundus color photo image;

[0118] The image enhancement unit, resizing unit, and normalization unit work together to optimize the input fundus color images in an all-round way, ensuring that important areas and features in the image are preserved and enhanced, thereby improving the feature extraction accuracy of subsequent neural networks in segmentation tasks, and ultimately improving the intelligent segmentation performance of the optic disc, macula, blood vessels, and lesion areas.

[0119] Step 2: Build a shared feature extractor module; the network architecture of the shared feature extractor module is as follows Figure 2 As shown;

[0120] The shared feature extractor is the core module of the entire segmentation framework, responsible for extracting common multi-scale features in fundus images. The convolutional neural network (CNN) is used as the backbone network, and the shared feature extractor module is built in combination with dilated convolution, multi-scale pyramid pooling module (PSP) and spatial attention mechanism. The specific process is as follows:

[0121] A1: Build the backbone network;

[0122] The basic convolution module is used as the backbone network. The basic convolution module is used to extract low-level features of the input image. It includes 4 convolution modules, each of which consists of several 3×3 convolution layers and a maximum pooling operation. These modules gradually compress the spatial size of the image and extract deeper semantic features at the same time, so that the model has a stronger understanding of complex lesion morphology. The spatial size of the feature map is gradually reduced from the input H×W to The number of feature channels is gradually increased to 512 to ensure that the model can handle multi-scale objects.

[0123] The basic convolution module is the core part of the shared feature extractor, which is mainly used to extract multi-level features of fundus images, including low-level textures, high-level semantic information, and global structures. This part can help the model capture key structures such as vascular branches, optic disc areas, and macular lesions in fundus color photos, providing comprehensive feature support for subsequent segmentation tasks.

[0124] A2: Introducing the dilated convolution module;

[0125] A dilated convolution module is added to the 3rd and 4th layers of the basic convolution module to expand the receptive field to capture a wider range of contextual information while keeping the spatial resolution unchanged. This design has a significant effect on detecting small-scale vascular branches and large-scale optic disc boundaries in fundus images.

[0126] The dilated convolution module is an efficient way to expand the receptive field. It can capture a wider range of contextual information without increasing the number of convolution kernel parameters. It is particularly effective for the segmentation of multi-scale targets in fundus images. By introducing the dilated convolution module, the model can better capture the fine branches of fundus blood vessels while maintaining a global perception of the overall structure (such as the optic disc boundary and the macular area). The core idea of ​​the dilated convolution is to expand the area covered by the convolution kernel by introducing holes in the pixel sampling interval of the standard convolution kernel without changing the resolution of the input image.

[0127] As a preferred method, in the third and fourth convolution modules, the hole rates are set to {1, 2, 4, 8}, corresponding to the expansion of the receptive field from local to global, respectively. This multi-scale hole convolution design can capture image features at different scales, allowing the model to focus on the tiny blood vessels of the retina while also perceiving the overall morphology. It retains the original spatial resolution of the image while expanding the receptive field so that the model can perceive greater contextual information. This plays a key role in the simultaneous processing of small targets (such as microvessels) and large targets (such as optic discs and macular areas) in fundus image segmentation tasks. Combined with the feature map after the hole convolution, the model can capture rich information at multiple scales and provide high-quality input features for the subsequent segmentation head.

[0128] A3: Introduce multi-scale pyramid pooling module;

[0129] A multi-scale pyramid pooling module is introduced after the 4th layer of the basic convolutional module to extract global context information through pooling operations at different scales, thereby enhancing the model's ability to understand the overall structure of the retinal area; the multi-scale pyramid pooling module is used to extract multi-scale features;

[0130] The multi-scale pyramid pooling module (PSP) is a key module for enhancing global context information. It is particularly suitable for segmentation tasks with significant differences in target size in fundus images. Fundus color photos contain both small blood vessel branches and large optic disc and macula areas. The PSP module extracts pooling features at different scales to enhance the model's comprehensive perception of global and local information. The core of the PSP module lies in the multi-scale pooling operation. Specifically, it extracts global and local features from the input feature map by setting multiple pooling windows of different scales (such as 1×1, 2×2, 3×3, 6×6).

[0131] The role of the PSP module is to capture the global contextual information of the fundus image. For example, the branch with a larger pooling window can capture the overall morphology of the optic disc and macular area, while the branch with a smaller pooling window focuses on small vascular branches and texture features. This fusion of multi-scale features enables the model to take into account both the details and overall structural features of the fundus color photos, thereby improving the robustness and accuracy of the segmentation task. The PSP module is constructed after the output of the 4th convolution module of the shared feature extractor to provide global enhanced features for the subsequent spatial attention mechanism and segmentation head.

[0132] A4: Add spatial attention mechanism;

[0133] A spatial attention mechanism is added after the multi-scale pyramid pooling module to highlight the characteristic expression of the segmentation target area (such as blood vessels and macular lesions) and suppress background noise. This attention mechanism can improve the model's sensitivity and robustness to details.

[0134] The construction of the spatial attention mechanism aims to enhance the feature extraction of key areas (such as blood vessels, optic discs, and macular lesions) by focusing on the spatial distribution of feature maps, while suppressing background noise. This mechanism is of great significance for the refinement of target boundaries in fundus image segmentation tasks.

[0135] The spatial attention mechanism is added after the multi-scale pyramid pooling module to further refine key features. It can effectively highlight the areas that contribute to the segmentation target (such as blood vessel branches and lesion areas) while reducing the interference of background areas on the segmentation task. The feature map after the spatial attention mechanism is combined not only to retain important details, but also to strengthen the model's ability to segment boundary areas.

[0136] The shared feature extractor module integrates the basic convolution module, the dilated convolution module, the multi-scale pyramid pooling module and the spatial attention mechanism. Through the joint action of the basic convolution module, the dilated convolution module, the multi-scale pyramid pooling module and the spatial attention mechanism, the shared feature extractor finally outputs a high-quality multi-scale feature map with a size of This feature map has both global context information and detailed features, providing strong support for the subsequent segmentation task head. The integration of modules realizes the comprehensiveness and accuracy of feature extraction. The hole convolution module enhances the perception of multi-scale targets, the multi-scale pyramid pooling module (PSP) strengthens the global context expression, and the spatial attention mechanism highlights the features of key segmentation areas. Through the multi-module fusion of shared feature extractors, the model can simultaneously handle complex fundus lesion morphology and segmentation target size differences, thus providing a basic guarantee for high-precision segmentation.

[0137] Step 3: Build the segmentation task head module;

[0138] In order to support the seamless addition of future tasks, a design of dynamically expanding output channels is adopted, and the segmentation task head module is built by combining upsampling layers, skip connections, and output convolutional layers, such as Figure 3 As shown in the figure, in this way, the output dimension can be flexibly adjusted according to the number of categories of newly added tasks, ensuring that the performance of existing tasks is not affected while achieving lightweight expansion.

[0139] Among them, the upsampling layer is used to restore the spatial resolution of the feature map through upsampling operations; the jump connection is used to splice the encoded features of different layers in the shared feature extractor with the features in the decoder to supplement the detail information lost in the upsampling process; the output convolution layer adopts 1×1 convolution, and its output channel number is dynamically configured, supporting single-channel or multi-channel output, which is used to map the multi-channel feature map to a segmentation mask corresponding to the number of output channels and output it;

[0140] Through this design, the segmentation task head can dynamically adapt to the number of categories of different tasks and support single-channel (such as two-category segmentation) or multi-channel (such as multi-class segmentation) output. The segmentation task head can not only realize multi-task segmentation through existing channels, but also easily add new segmentation tasks in the future by expanding the number of output channels. For example, on the basis that the initial model already supports blood vessel and optic disc segmentation (two channels), if you need to add a macular area segmentation task, you only need to expand one output channel and optimize the parameters of the newly added channel through joint training, while the shared feature extractor and the original channel remain unchanged. This design method realizes the dynamic expansion of segmentation tasks, which not only avoids the overhead of retraining the model, but also ensures that the performance of the newly added tasks and the original tasks do not affect each other. At the same time, the segmentation task head combines upsampling, convolution refinement and jump connections, so that the model can better restore the spatial resolution and detail features of the feature map, providing strong support for multi-task segmentation.

[0141] Step 4: Build a basic segmentation model;

[0142] The image preprocessing module, the shared feature extractor module and the segmentation task head module are sequentially connected to form a segmentation basic model;

[0143] Step 5: Model training; the basic model training flow chart is as follows Figure 4 As shown in the figure, the training of the initial shared feature extractor is the key to the optimization of the entire model. Its purpose is to learn to extract high-quality features shared by multiple tasks from fundus images while ensuring balanced segmentation performance for each task. During the training process, the parameters of the shared feature extractor and the segmentation task head are optimized by combining the loss function of multiple tasks, so that they can adapt to multiple segmentation requirements (such as blood vessel and optic disc segmentation) at the same time.

[0144] The specific process of model training is as follows:

[0145] B1: Construct multi-task segmentation loss;

[0146] In order to optimize the performance of the shared feature extractor on the initial tasks (such as blood vessel segmentation and optic disc segmentation), the segmentation loss function L is obtained by combining Dice loss and cross entropy loss according to formula (1): seg ; These two losses complement each other and optimize the region overlap rate and pixel-level classification accuracy respectively.

[0147]

[0148] In the formula, C initial is the number of channels of the initial task; P c and G c are the prediction results and true annotations of the cth task respectively; L dice and L ceThey represent Dice loss and cross entropy loss respectively. The main function of Dice loss is to optimize the overlap rate of predicted and labeled regions, which is particularly suitable for dealing with class imbalance problems, such as small regions in blood vessel segmentation. Cross entropy loss optimizes the details of segmentation boundaries through pixel-level classification, enabling the model to accurately capture the contours of the target area.

[0149] B2: Construct the joint loss of the original task;

[0150] In the initial training stage, the model needs to learn multiple segmentation targets at the same time, such as blood vessels, optic disc, macular area, fovea, posterior scleral staphyloma, retinal peripheral area, choroid, leopard-shaped fundus, etc. Therefore, a joint multi-task loss is used to optimize the parameters of the shared feature extractor and the segmentation task head. To achieve this goal, the joint loss L of the original task is obtained according to formula (2): old ;

[0151]

[0152] Where, L seg,i is the segmentation loss of the i-th task; i is the loss weight of each task, which is used to balance the optimization impact of each task; the weights of different tasks can be adjusted according to the amount of data, task importance or priority; N is the total number of tasks; currently N = 8, which are eight tasks including blood vessels, optic disc, macular area, fovea, posterior scleral staphyloma, retinal peripheral area, choroid and leopard-shaped fundus.

[0153] Through the above design, the model can learn common features for multiple segmentation targets in the shared feature extractor, while refining them for different tasks in each segmentation task head. The use of joint loss can effectively optimize the performance of each task and ensure that the model can balance the learning progress and importance of each task when performing multiple tasks.

[0154] B3: initial optimization strategy;

[0155] When training the initial shared feature extractor, an end-to-end optimization method is used to update the parameters of the shared feature extractor and the segmentation task head at the same time; specifically, the Adam optimizer is used and batch training is performed. In the process of optimizing the model parameters, the initial learning rate is set to 10 -3 , and the cosine annealing strategy is used to gradually decay the learning rate, as shown in formula (3); in the batch training process, each training uses a data batch containing multiple task annotations. The annotation of each task corresponds to the input image, and the unlabeled task channel is set to zero to avoid interference;

[0156]

[0157] Where ηt is the learning rate of the tth round, η max and η min are the initial and minimum learning rates respectively, and T is the total number of training;

[0158] B4: The segmentation basic model of the original task is obtained after basic training;

[0159] In summary, the training of the initial shared feature extractor optimizes the segmentation performance of the model for blood vessels and optic discs by combining multi-task segmentation losses. The combination of Dice loss and cross entropy loss ensures the accuracy of regional overlap rate and boundary details, while the joint loss and optimization strategy enable the model to efficiently learn multi-task shared features, laying a solid foundation for subsequent task expansion.

[0160] Step 6: Fine-tune the new task;

[0161] The goal of fine-tuning the new task is to achieve seamless generation of new segmentation tasks by dynamically expanding the output channels of the model while keeping the performance of the original task unaffected. The new task fine-tuning architecture is shown in the figure below: Figure 5 As shown, the specific process is as follows:

[0162] C1: Expand output channels. Based on the original segmentation task of the model, the new task only requires expanding the number of output channels of the segmentation head.

[0163] C11: According to the current number of task categories or the requirements of new tasks, the expanded number of output channels C is obtained by formula (4) new ;

[0164] C new =C old +C task (4);

[0165] In the formula, C old is the number of output channels of the original task, C task The number of output channels required for the new task;

[0166] C12: Add new convolution kernel weights to the output convolution layer of the segmentation task head module to achieve the expansion of the output channel, where the expanded convolution kernel weight W is obtained according to formula (5): new ;

[0167] W new =Concat(W old ,W extra )(5);

[0168] Where W old is the convolution kernel weight of the original segmentation task, which remains unchanged, W extra is the convolution kernel weight of the newly added task, W newis the weight of the expanded convolution kernel, and the feature map corresponding to the newly added task is represented by W extra Learning to generate, pre-C old The weight of the channel is not affected, thus ensuring that the original task performance is not damaged;

[0169] By expanding the output channels, new tasks can be added efficiently without affecting the performance of the original tasks. This design not only improves the scalability of the model, but also significantly reduces the complexity of redesign and training, providing an elegant and efficient solution for dynamic multi-task segmentation.

[0170] C2: Data integration;

[0171] In order to take into account the performance of both the new task and the original task, the data of all tasks are integrated into a joint training dataset. The integrated joint dataset D is obtained according to formula (6): train ;

[0172] D train ={(X i ,Y old,i ,Y new,i )}(6);

[0173] Where, X i is the input image, Y old,i and Y new,i They are the labels of the original tasks and the newly added tasks respectively;

[0174] Because the task is not single, we further deal with the problem of incomplete task annotation. If a single image contains annotations for all tasks, the model will optimize all tasks at the same time. If some tasks are not labeled (such as blood vessels are labeled but the macula is not labeled), the channels corresponding to the unlabeled tasks will be set to all zeros to prevent erroneous updates.

[0175] C3: Constructing the joint loss function after adding new tasks;

[0176] During the training of the new task, the model needs to optimize the new task channel and the original task channel at the same time to ensure that the performance of the new task is improved without destroying the performance of the original task. Specifically, the connection loss function L after the new task is obtained according to formula (7): total ;

[0177] L total =L old +λ new L new (7);

[0178] Where, L new is the segmentation loss of the newly added task, L new =L dice (P new,G new )+L ce (P new ,G new ), where P c and G c is the prediction result and true annotation of the original task channel, P new and G new is the prediction result and true label of the newly added task channel, λ new is the loss weight of the newly added task, which is used to dynamically adjust the optimization balance between the new task and the original task;

[0179] C4: New optimization strategy;

[0180] C41: Freeze the shared feature extractor. In order to avoid the impact of the new task training on the original task performance, the parameters of the shared feature extractor are kept frozen, and only the convolution kernel weights W of the new task channel are optimized. extra ;

[0181] C42: Joint optimization of the segmentation head, jointly optimize the extended segmentation head, including the original task channel weight W old and the newly added task channel weight W extra ;This optimization method allows the original task and the newly added task to share the adjustment space of the segmentation head to a certain extent;

[0182] C43: Data ratio adjustment. If the new task data is small, increase λ new The optimization priority of the newly added tasks is improved by using the value method, so as to dynamically adjust the proportion of training samples according to the data volume of the original tasks and the new tasks, and balance the data distribution of each task;

[0183] C44: Learning rate control, using a lower initial learning rate to ensure the gradual optimization of the weights of the newly added tasks while preventing large disturbances to the original task weights.

[0184] C5: By combining dataset D train Joint training is performed and the segmentation basic model for the newly added task is obtained after optimization through the new optimization strategy.

[0185] As a preferred embodiment, in step 2 A2, when performing the dilated convolution, the value F at the position (x, y) in the convolution output feature map is obtained according to formula (8): atrous (x,y);

[0186]

[0187] Where w(i,j) is the weight of the convolution kernel, I(x,y) is the pixel value at position (x,y) of the input image, k is the size of the convolution kernel, and r is the dilation rate, which represents the spacing between each sampling point in the convolution kernel.

[0188] As a preferred embodiment, in step 2 A3, during the pooling operation of the multi-scale pyramid pooling module, a fixed-size feature map is first generated, and then restored to the original feature map size using bilinear interpolation according to formula (9), to obtain the feature map P after the i-th pooling operation i Then, according to formula (10), all pooled features are concatenated into a unified multi-scale feature representation F PSP ;

[0189] P i =Upsample(Pool i (F))(9);

[0190] F PSP =Concat(P1,P2,P3,P4)(10);

[0191] Where i∈{1,2,3,4}.

[0192] As a preferred embodiment, in step 2 A4, the spatial attention mechanism generates an attention weight map S by calculating the importance distribution of the feature map at each spatial position, and multiplies it point by point with the input feature map to highlight the feature expression of the segmentation target area. The specific process is as follows:

[0193] A41: Perform global pooling operation on the input feature map F∈R H×W×C Apply global average pooling and generate the average single channel feature map F according to formula (11) avg ; At the same time, for the input feature map F∈R H×W×C Apply global maximum pooling and generate the maximum single-channel feature map F according to formula (12) max ;

[0194] F avg =AvgPool(F)(11);

[0195] F max =MaxPool(F)(12);

[0196] A42: Perform convolution to calculate the attention weight. According to formula (13), the pooled feature map is concatenated along the channel dimension and passed through a 7×7 convolution layer to generate the attention weight map S.

[0197] S = σ(Conv 7×7 ([F avg ,F max ]))(13);

[0198] Where σ represents the sigmoid activation function and the weight map S∈R H×WThe value of is between [0, 1];

[0199] A43: Weight adjustment feature map. According to formula (14), the weight map S is multiplied point by point with the input feature map to generate and output the enhanced feature map F. attention ;

[0200] F attention =S·F(14).

[0201] As a preferred embodiment, in step 3, the segmentation task head module is used to gradually decode the high-level features output by the shared feature extractor into a segmentation mask consistent with the size of the input image, and provide an independent channel for each segmentation task. The specific process is as follows:

[0202] D1: Restore the spatial resolution of the feature map through a series of upsampling operations, from The shared feature map is gradually restored to; for the input image, up-sampled transposed convolution is performed according to formula (15) to obtain the height H of the output feature map out ;

[0203] H out =(H in -1)·s+k-2·padding(15);

[0204] In the formula, H out Represents the height of the output feature map, H in Represents the height of the input feature map, s represents the step size, k represents the convolution kernel size, and padding represents the padding size;

[0205] D2: Adjust the step size and kernel size of the transposed convolution to expand the size of the feature map layer by layer. At the same time, according to formula (16), the feature map is refined using 3×3 convolution after each upsampling to enhance the detail expression capability of the feature.

[0206] F out =σ(Conv 3×3 (F up ))(16);

[0207] In the formula, σ represents the ReLU activation function, F up is the feature map after upsampling;

[0208] D3: Add skip connections to concatenate the encoded features of different layers in the shared feature extractor with the features in the decoder to supplement the detailed information lost during the upsampling process; for the features of the lth layer in the shared feature extractor and the features of the decoder layer l Perform skip connection and obtain the feature map after fusion of the lth layer according to formula (17) Through skip connections, the model can restore key information such as edge features and small blood vessel branches during the decoding stage.

[0209]

[0210] In the formula, is the feature of the lth layer in the shared feature extractor; is the feature of the decoder layer l;

[0211] D4: Dynamically adjust the number of output channels according to the current number of task categories or the requirements of new tasks, and obtain the final output feature map F according to formula (18) output ;

[0212] F output =Conv 1×1 (F fusion ,C new )(18).

[0213] As a preferred embodiment, in step 5, in B1, the Dice loss L is obtained according to formula (19): dice .

[0214]

[0215] Where P c and G c are the prediction results and true labels of the cth task respectively, and ε is a small positive value to prevent the denominator from being zero;

[0216] As a preferred embodiment, in step 5 B1, the cross entropy loss L is obtained according to formula (20): ce .

[0217]

[0218] Where N is the total number of pixels, G c (i) and P c (i) are the true value and predicted value of the i-th pixel respectively.

[0219] As a preference, in C44 in step 6, the lower initial learning rate is 10 -4 .

[0220] In summary, the present invention proposes a method for constructing a basic model for fundus color photo segmentation for intelligent diagnosis of pathological myopia, aiming to solve the problems of insufficient detail segmentation, isolated task processing and poor model scalability in the existing technology in the segmentation of fundus images of pathological myopia. This method constructs an efficient and scalable segmentation framework through steps such as image preprocessing, shared feature extraction, segmentation task head design and new task fine-tuning. First, the input image is optimized by preprocessing techniques such as data enhancement and image normalization; then, a shared feature extractor is used in combination with convolutional neural network, hole convolution and multi-scale pooling to extract multi-level features; then, a segmentation task head that can expand the output channel is designed to achieve flexible response to multi-task segmentation and task expansion; finally, the model is optimized by joint multi-task training, and the addition of new tasks is supported by expanding the output channel, ensuring the efficiency and scalability of the model. The overall method provides a scalable and high-performance solution for the intelligent segmentation of fundus images, with strong practical application value.

Claims

1. A method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia, characterized in that: Specifically include the following steps: Step 1: Build an image preprocessing module; An image preprocessing module is constructed using an image enhancement unit, a resizing unit and a normalization unit; wherein the image enhancement unit is used to perform data enhancement processing on the input fundus color photo image to simulate image changes under different acquisition conditions to obtain diversified image data; the resizing unit is used to crop and resize the input fundus color photo image to make the image size meet the input requirements; the normalization unit is used to perform normalization processing on the input fundus color photo image; Step 2: Build a shared feature extractor module; The convolutional neural network is used as the backbone network, and the shared feature extractor module is built by combining the dilated convolution, multi-scale pyramid pooling module and spatial attention mechanism. The specific process is as follows: A1: Build the backbone network; The basic convolution module is used as the backbone network. The basic convolution module is used to extract low-level features of the input image. It includes 4 convolution modules, each of which consists of several 3×3 convolution layers and a maximum pooling operation. A2: Introducing the dilated convolution module; A dilated convolution module is added to the 3rd and 4th layers of the basic convolution module to introduce holes in the pixel sampling interval of the standard convolution kernel and expand the area covered by the convolution kernel without changing the resolution of the input image. The dilated convolution module is used to expand the receptive field to capture a wide range of contextual information. A3: Introduce multi-scale pyramid pooling module; A multi-scale pyramid pooling module is introduced after the 4th layer of the basic convolution module to extract global context information through pooling operations at different scales; the multi-scale pyramid pooling module is used to extract multi-scale features; A4: Add spatial attention mechanism; A spatial attention mechanism is added after the multi-scale pyramid pooling module to highlight the feature expression of the segmentation target area and suppress background noise; Step 3: Build the segmentation task head module; The design of dynamically expanding the output channel is adopted, and the segmentation task head module is built by combining the upsampling layer, skip connection and output convolution layer; the upsampling layer is used to restore the spatial resolution of the feature map through upsampling operation; the skip connection is used to splice the encoded features of different layers in the shared feature extractor with the features in the decoder to supplement the detail information lost in the upsampling process; the output convolution layer adopts 1×1 convolution, and its output channel number is dynamically configured, supporting single-channel or multi-channel output, which is used to map the multi-channel feature map to the segmentation mask corresponding to the number of output channels and output it; Step 4: Build a basic segmentation model; The image preprocessing module, the shared feature extractor module and the segmentation task head module are sequentially connected to form a segmentation basic model; Step 5: Model training; B1: Construct multi-task segmentation loss; Combining Dice loss and cross entropy loss, the segmentation loss function L is obtained according to formula (1): seg ; In the formula, C initial is the number of channels of the initial task; P c and G c are the prediction results and true annotations of the cth task respectively; L dice and L ce Represent Dice loss and cross entropy loss respectively; B2: construct the joint loss of the original task; According to formula (2), the joint loss L of the original task is obtained old ; Where, L seg,i is the segmentation loss of the i-th task; i is the loss weight of each task, which is used to balance the optimization impact of each task; N is the total number of tasks; B3: initial optimization strategy; When training the initial shared feature extractor, an end-to-end optimization method is used to update the parameters of the shared feature extractor and the segmentation task head at the same time; specifically, the Adam optimizer is used and batch training is performed. In the process of optimizing the model parameters, the initial learning rate is set to 10 -3 , and the cosine annealing strategy is used to gradually decay the learning rate, as shown in formula (3); in the batch training process, each training uses a data batch containing multiple task annotations, the annotation of each task corresponds to the input image, and the unlabeled task channel is set to zero; Where η t is the learning rate of the tth round, η max and η min are the initial and minimum learning rates respectively, and T is the total number of training; B4: The segmentation basic model of the original task is obtained after basic training; Step 6: Fine-tune the new task; By dynamically expanding the output channels of the model, new segmentation tasks can be seamlessly generated while maintaining the performance of the original tasks. The specific process is as follows: C1: Extended output channel; C11: According to the current number of task categories or the requirements of new tasks, the expanded number of output channels C is obtained by formula (4) new ; C new =C old +C task (4); In the formula, C old is the number of output channels of the original task, C task The number of output channels required for the new task; C12: Add new convolution kernel weights to the output convolution layer of the segmentation task head module to achieve the expansion of the output channel, where the expanded convolution kernel weight W is obtained according to formula (5): new ; W new =Concat(W old ,W extra )(5); Where W old is the convolution kernel weight of the original segmentation task, which remains unchanged, W extra is the convolution kernel weight of the newly added task, W new is the weight of the expanded convolution kernel, and the feature map corresponding to the newly added task is represented by W extra Learning generation; C2: Data integration; The data of all tasks are integrated into a joint training dataset, and the integrated joint dataset D is obtained according to formula (6): train ; D train ={(X i ,AND old,i ,AND new,i )}(6); Where, X i is the input image, Y old,i and Y new,i They are the labels of the original tasks and the newly added tasks respectively; C3: Constructing the joint loss function after adding new tasks; According to formula (7), the connection loss function L after adding the task is obtained total ; L total =L old +λ new L new (7); Where, L new is the segmentation loss of the newly added task, L new =L dice (P new ,G new )+L ce (P new ,G new ), where P c and G c is the prediction result and true annotation of the original task channel, P new and G new is the prediction result and true label of the newly added task channel, λ new is the loss weight of the newly added task, which is used to dynamically adjust the optimization balance between the new task and the original task; C4: New optimization strategy; C41: Freeze the shared feature extractor, keep the parameters of the shared feature extractor frozen, and only optimize the convolution kernel weight W of the newly added task channel extra ; C42: Joint optimization of the segmentation head, jointly optimize the extended segmentation head, including the original task channel weight W old And the new task channel weight W extra ; C43: Data ratio adjustment. If the new task data is small, increase λ new The optimization priority of the newly added tasks is improved by using the value method, so as to dynamically adjust the proportion of training samples according to the data volume of the original tasks and the new tasks, and balance the data distribution of each task; C44: Learning rate control, using a lower initial learning rate to ensure the gradual optimization of the weights of the newly added tasks while preventing large disturbances to the original task weights. C5: By combining dataset D train Joint training is performed and the segmentation basic model for the newly added task is obtained after optimization through the new optimization strategy.

2. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 2 A2, the hole rate is set to {1, 2, 4, 8}.

3. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 2, A2, when performing the dilated convolution, the value F at the position (x, y) in the convolution output feature map is obtained according to formula (8): atrous (x,y); Where w(i,j) is the weight of the convolution kernel, I(x,y) is the pixel value at position (x,y) of the input image, k is the size of the convolution kernel, and r is the dilation rate, which represents the spacing between each sampling point in the convolution kernel.

4. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 2, in A3, during the pooling operation of the multi-scale pyramid pooling module, a fixed-size feature map is first generated, and then restored to the original feature map size using bilinear interpolation according to formula (9), to obtain the feature map P after the i-th pooling operation. i Then, according to formula (10), all pooled features are concatenated into a unified multi-scale feature representation F PSP ; P i =Upsample(Pool i (F))(9); F PSP =Concat(P1,P2,P3,P4)(10); Where i∈{1,2,3,4}.

5. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 2, A4, the spatial attention mechanism generates an attention weight map S by calculating the importance distribution of the feature map at each spatial position, and multiplies it point by point with the input feature map to highlight the feature expression of the segmentation target area. The specific process is as follows: A41: Input feature map F∈R H×W×C Apply global average pooling and generate the average single channel feature map F according to formula (11) avg ; At the same time, for the input feature map F∈R H×W×C Apply global maximum pooling and generate the maximum single-channel feature map F according to formula (12) max ; F avg =AvgPool(F)(11); F max =MaxPool(F)(12); A42: Perform convolution to calculate the attention weight. According to formula (13), the pooled feature map is concatenated along the channel dimension and passed through a 7×7 convolution layer to generate the attention weight map S. S=σ(Conv 7×7 ([F avg ,F max ]))(13); Where σ represents the sigmoid activation function and the weight map S∈R H×W The value of is between [0, 1]; A43: Weight adjustment feature map. According to formula (14), the weight map S is multiplied point by point with the input feature map to generate and output the enhanced feature map F. attention ; F attention =S·F(14)。 6. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 3, the segmentation task head module is used to gradually decode the high-level features output by the shared feature extractor into a segmentation mask consistent with the input image size and provide independent channels for each segmentation task. The specific process is as follows: D1: Restore the spatial resolution of the feature map through a series of upsampling operations, from The shared feature map is gradually restored to; for the input image, up-sampled transposed convolution is performed according to formula (15) to obtain the height H of the output feature map out ; H out =(H in -1)·s+k-2·padding(15); In the formula, H out Represents the height of the output feature map, H in Represents the height of the input feature map, s represents the step size, k represents the convolution kernel size, and padding represents the padding size; D2: Adjust the step size and kernel size of the transposed convolution to expand the size of the feature map layer by layer. At the same time, according to formula (16), the feature map is refined using 3×3 convolution after each upsampling to enhance the detail expression capability of the feature. F out =σ(Conv 3×3 (F up ))(16); In the formula, σ represents the ReLU activation function, F up is the feature map after upsampling; D3: For the features of the lth layer in the shared feature extractor and the features of the decoder layer l Perform skip connection and obtain the feature map after fusion of the lth layer according to formula (17) In the formula, is the feature of the lth layer in the shared feature extractor; is the feature of the decoder layer l; D4: Dynamically adjust the number of output channels according to the current number of task categories or the requirements of new tasks, and obtain the final output feature map F according to formula (18) output ; F output =Conv 1×1 (F fusion ,C new )(18)。 7. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 5, B1, the Dice loss L is obtained according to formula (19): dice . Where P c and G c are the predicted results and true labels of the cth task respectively, and ε is a small positive value used to prevent the denominator from being zero.

8. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 5, B1, the cross entropy loss L is obtained according to formula (20): ce . Where N is the total number of pixels, G c (i) and P c (i) are the true value and predicted value of the i-th pixel respectively.

9. The method for constructing a fundus color photo segmentation model for intelligent diagnosis of pathological myopia according to claim 1, characterized in that: In step 6, in C44, the lower initial learning rate is 10 -4 .

Citation Information

Cited By

  • Multi-task learning-based pathological myopia analysis method and system

    CN121053115A