An image segmentation method, apparatus, electronic device, and storage medium
By cutting and feature fusion of ultra-wide-angle fundus images, combined with self-attention and adversarial networks, the problems of inaccurate segmentation and weak migration in the existing technology are solved, and the accuracy and migration of blood vessel segmentation are significantly improved.
Patent Information
- Application Number
- CN202410675592.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-29
AI Technical Summary
The existing technology has problems of inaccurate segmentation and weak migration in ultra-wide-angle fundus image segmentation. In particular, patch-based methods ignore the global relationship between blood vessels and their surrounding tissues, resulting in inaccurate segmentation results.
By cutting the ultra-wide-angle fundus image, multiple images of different sizes are obtained, and the self-attention mechanism is used for feature fusion, and the segmentation network and adversarial network are combined to optimize the segmentation results.
It significantly improves the accuracy and migration of blood vessel segmentation, enhances the perception of the relationship between blood vessels and their surrounding tissues, and improves the overall accuracy of segmentation results.
Smart Images

Figure CN118279322B
Abstract
Description
Technical Field
[0001] The present application relates to the fields of image processing and deep learning, and in particular to an image segmentation method, device, electronic device and storage medium. Background Art
[0002] Fundus ultra-wide-angle photography technology is an imaging technology that can achieve a 200-degree fundus range. UWF images (ultra-wide-angle fundus images) are not easy to segment and observe, but they are simple to obtain and have a wide imaging angle. At present, deep learning methods have made remarkable achievements in the field of image segmentation, and their segmentation accuracy has far exceeded that of traditional segmentation methods. Earlier deep learning methods for image segmentation were mainly window-based, such as window-based and sliding window strategies for segmentation of nerve cell membranes in microscope images. With the emergence of end-to-end fully convolutional networks (FCNs), U-Net, a classic encoding-decoding architecture for biomedical image segmentation, emerged. Due to the effective fusion of multi-resolution features, U-Net has achieved good results in image segmentation, and a large number of improved versions of U-Net have subsequently appeared. In order to gradually improve the segmentation performance, some multi-stage models have also been proposed. For image data with relatively scarce annotations, some weakly supervised / semi-supervised methods have also emerged. The above methods have made some progress in the field of image segmentation, but there are still problems such as inaccurate segmentation and poor transferability, and there is little research on the segmentation problem of ultra-wide-angle modality.
[0003] The ultra-high resolution of UWF images poses a challenge to the performance of vessel segmentation. Currently, most segmentation networks use patch-based techniques to alleviate the computational requirements of high-resolution images. However, this approach mainly focuses on local features and may ignore the global relationship between blood vessels and their surrounding tissues, resulting in inaccurate segmentation results. Summary of the invention
[0004] The present application provides an image segmentation method, device, electronic device and storage medium.
[0005] An embodiment of the present application provides an image segmentation method, the method comprising:
[0006] Cutting the collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image, wherein the first image, the second image and the third image have different sizes;
[0007] Scaling the first image and the corresponding second image and third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image;
[0008] Using a segmentation network to perform feature extraction on the fourth image and the corresponding fifth image and sixth image to obtain first feature data and the corresponding second feature data and third feature data;
[0009] Using a self-attention mechanism, the first feature data and the corresponding second feature data are feature-fused with the third feature data to obtain first fused feature data;
[0010] The first fused feature data is segmented using a segmentation network to obtain a segmentation result of the UWF image.
[0011] The step of cutting the collected UWF image includes:
[0012] Determine a first size, a second size, and a third size based on the UWF image, wherein the third size is larger than the second size, and the second size is larger than the first size;
[0013] Cutting the UWF image based on the first size to obtain a plurality of first images;
[0014] A corresponding second image is determined based on the first image and the second size, and a corresponding third image is determined based on the first image and the third size.
[0015] The step of scaling the first image and the corresponding second image and third image to the same size includes:
[0016] Determine a fourth size based on the first size, wherein the fourth size is less than or equal to the first size;
[0017] The first image and the corresponding second image and third image are scaled to the fourth size to obtain a fourth image and the corresponding fifth image and sixth image.
[0018] The step of using the self-attention mechanism to perform feature fusion on the first feature data and the corresponding second feature data and third feature data includes:
[0019] Processing the first feature data with itself through a self-attention mechanism to obtain a first weight matrix corresponding to the first feature data;
[0020] Processing the first feature data and the second feature data with a self-attention mechanism to obtain a second weight matrix corresponding to the second feature data;
[0021] Processing the first feature data and the third feature data by a self-attention mechanism to obtain a third weight matrix corresponding to the third feature data;
[0022] The first feature data, the second feature data and the third feature data are weighted and summed based on the first weight matrix, the second weight matrix and the third weight matrix respectively to obtain the first fused feature data.
[0023] The method further comprises:
[0024] Cutting the UWF sample image to obtain a plurality of first sample images and a second sample image and a third sample image corresponding to each first sample image, wherein the first sample image, the second sample image and the third sample image have different sizes;
[0025] Scaling the first sample image and the corresponding second sample image and third sample image to the same size to obtain a fourth sample image and the corresponding fifth sample image and sixth sample image;
[0026] Using a segmentation network to perform feature extraction on the fourth sample image and the corresponding fifth sample image and sixth sample image to obtain fourth feature data and the corresponding fifth feature data and sixth feature data;
[0027] Using a self-attention mechanism, the fourth feature data and the corresponding fifth feature data and the sixth feature data are feature-fused to obtain second fused feature data;
[0028] Determine target feature data based on the second fused feature data and seventh feature data, wherein the seventh feature data is obtained by extracting features from the UWF image using an adversarial network;
[0029] Using the segmentation network to segment the target feature data, and obtaining a segmentation result of the UWF sample image;
[0030] Determining a loss value based on the segmentation result and the label of the UWF sample image;
[0031] Parameters of the segmentation network are optimized based on the loss value.
[0032] Wherein, determining the target feature data based on the second fused feature data and the seventh feature data includes:
[0033] determining a first correlation coefficient based on the second fused feature data and the seventh feature data;
[0034] Cutting out at least one first test matrix from the second fused feature data;
[0035] Cutting a corresponding second test matrix from the seventh characteristic data based on the first test matrix, wherein the position and size of the first test matrix are the same as those of the second test matrix;
[0036] Determine a second correlation coefficient based on the at least one first test matrix and a second test matrix corresponding to each first test matrix;
[0037] Target feature data is determined based on the second fused feature data, the seventh feature data, the first correlation coefficient and the second correlation coefficient.
[0038] Wherein, the adversarial network is a FA image style transfer network, and the method further includes:
[0039] Processing the seventh feature data using the FA image style transfer network to obtain a FA image corresponding to the UWF sample image;
[0040] Determining a loss value based on the labels of the FA image and the UWF sample image;
[0041] Optimizing the parameters of the FA image style transfer network based on the loss value.
[0042] Another aspect of the present application provides an image segmentation device, the device comprising:
[0043] A processing module is used to cut the collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image, wherein the first image, the second image and the third image have different sizes; and scale the first image and the corresponding second image and the third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image;
[0044] A computing module is used to use a segmentation network to extract features from the fourth image and the corresponding fifth image and sixth image to obtain first feature data and corresponding second feature data and third feature data; use a self-attention mechanism to perform feature fusion on the first feature data and the corresponding second feature data and third feature data to obtain first fused feature data; and use a segmentation network to segment the first fused feature data to obtain a segmentation result of the UWF image.
[0045] Another aspect of the present invention provides an electronic device, comprising: a processor;
[0046] The processor cuts the collected UWF image to obtain multiple first images and the second image and the third image corresponding to each first image; scales the first image and the corresponding second image and the third image to the same size to obtain a fourth image and the corresponding fifth image and the sixth image; extracts features from the fourth image and the corresponding fifth image and the sixth image to obtain first feature data and the corresponding second feature data and the third feature data; performs feature fusion on the first feature data and the corresponding second feature data and the third feature data to obtain first fused feature data; and segments the first fused feature data to obtain a segmentation result of the UWF image.
[0047] On the other hand, the present invention provides a computer-readable storage medium, which stores a computer program, and the computer program is used to cut the collected UWF image to obtain multiple first images and the second image and the third image corresponding to each first image; scale the first image and the corresponding second image and the third image to the same size to obtain a fourth image and the corresponding fifth image and the sixth image; extract features from the fourth image and the corresponding fifth image and the sixth image to obtain first feature data and the corresponding second feature data and the third feature data; perform feature fusion on the first feature data and the corresponding second feature data and the third feature data to obtain first fused feature data; segment the first fused feature data to obtain the segmentation result of the UWF image. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:
[0049] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0050] Figure 1 A flowchart of an image segmentation method according to an embodiment of the present application is shown;
[0051] Figure 2 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0052] Figure 3 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0053] Figure 4 A schematic diagram of cutting a UWF image according to an embodiment of the present application is shown;
[0054] Figure 5A schematic diagram of cutting a UWF image according to another embodiment of the present application is shown;
[0055] Figure 6 A schematic diagram of cutting a UWF image according to another embodiment of the present application is shown;
[0056] Figure 7 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0057] Figure 8 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0058] Fig. 9 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0059] Fig.10 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0060] Fig.11 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0061] Fig.12 A flowchart of an image segmentation method according to another embodiment of the present application is shown;
[0062] Fig.13 A schematic diagram of the structure of an image segmentation device according to an embodiment of the present application is shown;
[0063] Fig.14 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0064] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0065] In order to focus on the global relationship between blood vessels and surrounding tissues while paying attention to local features, thereby improving the accuracy of segmentation results, an embodiment of the present application provides an image segmentation method, such as Figure 1 As shown, the method includes:
[0066] Step 101 , cutting the collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image, wherein the sizes of the first image, the second image and the third image are different.
[0067] UWF images can provide a wider field of view than traditional fundus imaging technology, usually reaching more than 200 degrees. In the field of fundus imaging, traditional fundus imaging technology can only cover the central retinal area, while UWF images can capture a wider area of the retina, including the distal and peripheral areas of the retina. UWF images therefore have ultra-high resolution, and when segmenting UWF images, the segmentation performance requirements are very high. Currently, most segmentation networks use patch-based technology to reduce the need for high-resolution image calculations. However, this method focuses mainly on local features and may ignore the global relationship between blood vessels and their surrounding tissues, resulting in inaccurate segmentation results.
[0068] In this embodiment, the UWF image also needs to be cut first, but it is different from the traditional method. Figure 2 As shown, after the UWF image is cut to obtain multiple first images, the UWF image is further cut based on the first image to obtain the second image and the third image corresponding to the first image, and the corresponding second image and the third image have different sizes from the first image. The size of the first image is usually the smallest among the first image, the second image and the third image.
[0069] For example, the size of the UWF image is 3800×3072. The UWF image is cut into multiple first images with a size of 256×256. The UWF image is cut based on the first images to obtain a second image with a size of 512×512 and a third image with a size of 768×768 corresponding to each first image.
[0070] It should be noted that before cutting the UWF image, the UWF image can also be registered. In this embodiment, the ICP algorithm (iterative closest point algorithm) can be used to accurately register the UWF image to minimize the spatial position difference between the point clouds in the UWF image and obtain a more accurate rotation and translation transformation matrix. Generally speaking, it can be divided into four stages: sampling the original point cloud data, determining the initial corresponding point set, removing the wrong corresponding point set and solving the coordinate transformation.
[0071] Step 102: scaling the first image and the corresponding second image and third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image.
[0072] like Figure 2As shown, after cutting to obtain a plurality of first images and the second image and the third image corresponding to each first image, each first image and the corresponding second image and the third image need to be scaled to the same size. In this embodiment, the first image and the corresponding second image and the third image are usually scaled to a size smaller than the size of the first image.
[0073] For example, the size of the first image is 256×256, the size of the second image is 512×512, and the size of the third image is 768×768. The first image is scaled to a fourth image with a size of 200×200, the corresponding second image is scaled to a fifth image with a size of 200×200, and the corresponding third image is scaled to a sixth image with a size of 200×200.
[0074] Step 103: Use a segmentation network to perform feature extraction on the fourth image and the corresponding fifth image and sixth image to obtain first feature data and the corresponding second feature data and third feature data.
[0075] like Figure 2 As shown, the fourth image and the corresponding fifth image and sixth image are respectively input into three feature extractors in the segmentation network to perform feature extraction to obtain first feature data of the fourth image, second feature data of the fifth image, and third feature data of the sixth image.
[0076] In this embodiment, ResNet (Residual Network) is selected as the feature extractor.
[0077] Step 104: Use a self-attention mechanism to perform feature fusion on the first feature data and the corresponding second feature data and third feature data to obtain first fused feature data.
[0078] like Figure 2 As shown, the first feature data and the corresponding second feature data and third feature data are input into the self-attention layer in the segmentation network for feature fusion to obtain first fused feature data.
[0079] Step 105: Use a segmentation network to segment the first fused feature data to obtain a segmentation result of the UWF image.
[0080] like Figure 2 As shown, after the first fusion feature data is obtained, it passes through a layer of decoder and is input into a PRM (Partially Recurrent Model) for processing. Then, after passing through another layer of encoder and decoder, the segmentation result of the UWF image is obtained.
[0081] In the above scheme, by cutting the UWF image to obtain different images of multiple scales, and then fusion of the feature data of the multi-scale images through the self-attention mechanism, the local related features of the image in the first fused feature data can be effectively enhanced, the blood vessel edge can be refined, and the ability to perceive the local context in the blood vessel segmentation process can be improved. In addition, the image feature data at a larger scale is fused, so that the first fused feature data contains the global relationship between the blood vessel and its surrounding tissues, thereby significantly improving the accuracy of the segmentation results.
[0082] In an example of the present application, an image segmentation method is also provided. Figure 3 As shown, the cutting of the collected UWF image includes:
[0083] Step 201: determine a first size, a second size, and a third size based on the UWF image, wherein the third size is larger than the second size, and the second size is larger than the first size.
[0084] Based on the size of the UWF image, a first size of the first image, a second size of the second image, and a third size of the third image to be cut out are determined. The first size is smaller than the second size, and the second size is smaller than the third size.
[0085] Step 202: Cut the UWF image based on the first size to obtain a plurality of first images.
[0086] The UWF image is cut based on the first size.
[0087] Typically, the size of the UWF image is an integer multiple of the first size, and in this case, the UWF image can be evenly divided based on the first size. Figure 4 As shown, the size of the UWF image is 1024×1024, the first size is 256×256, and the UWF image is evenly divided into 16 first images based on the first size.
[0088] When the size of the UWF image is not an integer multiple of the first size, when the UWF image is cut based on the first size, the remaining part will be smaller than the first size. Figure 5 As shown, the boundary of the remaining part is used as the boundary of the first image, and there is an overlapping part with the adjacent first image, and the first image of the first size is cut out.
[0089] Step 203: determine a corresponding second image based on the first image and the second size, and determine a corresponding third image based on the first image and the third size.
[0090] Based on the position of the first image, the UWF image is cut again to obtain the second image and the third image corresponding to the first image. In this embodiment, the corresponding second image and the third image are cut with the center position of the first image as the center.
[0091] It should be noted that when the first image is located at the edge of the UWF image, the second image and the third image corresponding to the first image may exceed the edge of the UWF image. Figure 6 As shown, the edge of the first image is used as the edge of the second image and the third image, and there is an overlapping portion with the adjacent second image or third image, and a second image of a second size and a third image of a third size are cut out.
[0092] In the above scheme, the second image and the third image are cut out to be larger than the first image, so that in the subsequent feature fusion, image feature data at a larger scale can be fused, so that the first fused feature data contains the global relationship between the blood vessel and its surrounding tissue, thereby significantly improving the accuracy of the segmentation result.
[0093] In an example of the present application, an image segmentation method is also provided. Figure 7 As shown, scaling the first image and the corresponding second image and third image to the same size includes:
[0094] Step 301: determine a fourth size based on the first size, where the fourth size is smaller than or equal to the first size.
[0095] For example, the first size is 256×256, and the fourth size is determined to be 200×200.
[0096] Step 302: scaling the first image and the corresponding second image and third image to the fourth size to obtain a fourth image and the corresponding fifth image and sixth image.
[0097] For example, the first size is 256×256, the second size is 512×512, the third size is 768×768, and the fourth size is 200×200. The first image is scaled to a fourth image of 200×200, the second image is scaled to a fifth image of 512×512, and the third image is scaled to a sixth image of 768×768.
[0098] In the above scheme, images of different sizes are scaled to images of the same size, which makes it easier for subsequent networks to process them, effectively improving the efficiency of subsequent network data processing.
[0099] In an example of the present application, an image segmentation method is also provided. Figure 8As shown, the method of using the self-attention mechanism to perform feature fusion on the first feature data and the corresponding second feature data and the third feature data includes:
[0100] Step 401, performing a self-attention mechanism on the first feature data and itself to obtain a first weight matrix corresponding to the first feature data.
[0101] In the self-attention mechanism, the first feature data needs to be processed with the first feature data itself by the self-attention mechanism first to obtain a first weight matrix corresponding to the first feature data.
[0102] Step 402: Perform a self-attention mechanism on the first feature data and the second feature data to obtain a second weight matrix corresponding to the second feature data.
[0103] The first feature data and the second feature data are then processed by a self-attention mechanism to obtain a second weight matrix corresponding to the second feature data.
[0104] Step 403: Perform a self-attention mechanism on the first feature data and the third feature data to obtain a third weight matrix corresponding to the third feature data.
[0105] The first feature data and the third feature data are then processed by a self-attention mechanism to obtain a third weight matrix corresponding to the third feature data.
[0106] Step 404: Perform weighted summation on the first feature data, the second feature data, and the third feature data based on the first weight matrix, the second weight matrix, and the third weight matrix, respectively, to obtain the first fused feature data.
[0107] Specifically, the first fusion feature data can be determined based on the following formula :
[0108]
[0109] in, is the first feature data, is the first weight matrix, is the second feature data, is the second weight matrix of u, The third characteristic data, is the third weight matrix.
[0110] In the above scheme, the first weight matrix of the first feature data itself, the second weight matrix of the second feature data relative to the first feature data, and the third weight matrix of the third feature data relative to the first feature data are determined through the self-attention mechanism, so that the first fused feature data obtained after feature fusion can contain image feature data on a larger scale, so that the first fused feature data contains the global relationship between the blood vessel and its surrounding tissues, thereby significantly improving the accuracy of the segmentation result.
[0111] In an example of the present application, an image segmentation method is also provided. Fig. 9 As shown, the method also includes:
[0112] Step 501 : cutting the UWF sample image to obtain a plurality of first sample images and a second sample image and a third sample image corresponding to each first sample image, wherein the sizes of the first sample image, the second sample image and the third sample image are different.
[0113] Similarly, when using the UWF sample image to train the segmentation network, the UWF sample image also needs to be cut into a plurality of first sample images, and corresponding second sample images and third sample images having different sizes from the first sample images.
[0114] Step 502: scaling the first sample image and the corresponding second sample image and third sample image to the same size to obtain a fourth sample image and the corresponding fifth sample image and sixth sample image.
[0115] Similarly, the first sample image and the corresponding second sample image and third sample image are scaled to the same size to obtain a fourth sample image and the corresponding fifth sample image and sixth sample image.
[0116] For example, the size of the first sample image is 256×256, the size of the second sample image is 512×512, and the size of the third sample image is 768×768. The first sample image is scaled to a fourth sample image with a size of 200×200, the corresponding second sample image is scaled to a fifth sample image with a size of 200×200, and the corresponding third sample image is scaled to a sixth sample image with a size of 200×200.
[0117] Step 503: Use a segmentation network to perform feature extraction on the fourth sample image and the corresponding fifth sample image and sixth sample image to obtain fourth feature data and the corresponding fifth feature data and sixth feature data.
[0118] like Fig.10As shown, the fourth sample image and the corresponding fifth sample image and sixth sample image are respectively input into three feature extractors in the segmentation network to perform feature extraction to obtain fourth feature data of the fourth sample image, fifth feature data of the fifth sample image, and sixth feature data of the sixth sample image.
[0119] In this embodiment, ResNet is selected as the feature extractor.
[0120] Step 504: Use a self-attention mechanism to perform feature fusion on the fourth feature data and the corresponding fifth feature data and sixth feature data to obtain second fused feature data.
[0121] like Fig.10 As shown, the fourth feature data and the corresponding fifth feature data and the sixth feature data are input into the self-attention layer in the segmentation network for feature fusion to obtain second fused feature data.
[0122] Step 505: determine target feature data based on the second fused feature data and the seventh feature data, where the seventh feature data is obtained by extracting features from the UWF image using an adversarial network.
[0123] In this embodiment, the adversarial network may select an image style transfer network.
[0124] like Fig.10 As shown, the adversarial network is used to extract features of the UWF image to obtain the seventh feature data.
[0125] In this embodiment, the target feature data can be determined based on the second fused feature data and the seventh feature data in the following three ways, namely, feature selection:
[0126] The first method is to determine the Pearson correlation coefficient between the second fused feature data and the seventh feature data. If the Pearson correlation coefficient is 0 or -1, the second fused feature data is determined as the target feature data. If the Pearson correlation coefficient is 1, the seventh feature data is determined as the target feature data.
[0127] The second method is to determine the distance correlation between the second fused feature data and the seventh feature data. If the distance correlation is 0, the second fused feature data is determined as the target feature data. If the distance correlation is 1, the seventh feature data is determined as the target feature data.
[0128] The third method is to determine the mean square error between the second fused feature data and the seventh feature data. A standard mean square error is preset, and if the mean square error is greater than a fixed ratio of the standard mean square error, the second fused feature data is determined as the target feature data. If the mean square error is less than a fixed ratio of the standard mean square error, the seventh feature data is determined as the target feature data.
[0129] Step 506: Use the segmentation network to segment the target feature data to obtain a segmentation result of the UWF sample image.
[0130] like Fig.10 As shown, after determining the target feature data, it also passes through a layer of decoder and then is input into the PRM for processing. Then, after passing through another layer of encoder and decoder, the segmentation result of the UWF sample image is obtained.
[0131] Step 507: Determine a loss value based on the segmentation result and the label of the UWF sample image.
[0132] In this embodiment, the loss function may be Dice loss.
[0133] Step 508: Optimize the parameters of the segmentation network based on the loss value.
[0134] After the loss value is determined, the parameters of the segmentation network are optimized based on the loss value.
[0135] In the above scheme, the adversarial network is used to extract feature data from the UWF sample image, and the fused feature data extracted and fused from the multi-scale image of the UWF sample image by the segmentation network is used for feature selection, and then the segmentation network is trained based on the selected feature data. This enables the segmentation network to fully learn the feature information extracted from the UWF sample image by the adversarial network, and further improves the accuracy of the trained segmentation network in segmenting the UWF image.
[0136] In an example of the present application, an image segmentation method is also provided. Fig.11 As shown, the determining target feature data based on the second fused feature data and the seventh feature data includes:
[0137] Step 601: determine a first correlation coefficient based on the second fused feature data and the seventh feature data.
[0138] Specifically, the first correlation coefficient may be determined based on the second fused feature data and the seventh feature data based on the following formula: :
[0139]
[0140] in, is the total number of feature data in the second fused feature data (the total number of feature data in the seventh feature data is the same as the total number of feature data in the second fused feature data), is the first feature data, The seventh feature data feature data.
[0141] Step 602: Cut out at least one first test matrix from the second fused feature data.
[0142] At least one region is randomly selected from the second fused feature data, and a corresponding first test matrix is cut out based on the selected region.
[0143] Step 603: Cut out a corresponding second test matrix from the seventh characteristic data based on the first test matrix, wherein the position and size of the first test matrix are the same as those of the second test matrix.
[0144] A second test matrix with the same position and the same size is cut out from the seventh feature data based on the first test matrix.
[0145] Step 604: determine a second correlation coefficient based on the at least one first test matrix and a second test matrix corresponding to each first test matrix.
[0146] Specifically, the second correlation coefficient may be determined based on the following formula based on at least one first test matrix and a second test matrix corresponding to each first test matrix. :
[0147]
[0148] in, is the total number of feature data in all first test matrices (the total number of feature data in all second test matrices is the same as the total number of feature data in all first test matrices), For all first test matrices feature data, For all the second test matrices feature data.
[0149] Step 605: determine target feature data based on the second fused feature data, the seventh feature data, the first correlation coefficient and the second correlation coefficient.
[0150] In this embodiment, the first correlation coefficient is used as the standard mean square error, and the fixed ratio is set to 80%. When the second correlation coefficient is less than 80% of the first correlation coefficient, the seventh feature data is determined as the target feature data. When the second correlation coefficient is greater than 80% of the first correlation coefficient, the second fused feature data is determined as the target feature data.
[0151] In the above scheme, the correlation between the second fusion feature data and the seventh feature data is determined by determining the overall mean square error between the second fusion feature data and the seventh feature data and the mean square error between the random region features, and then comparing them. If the correlation is high, the seventh feature data is determined as the target feature data for subsequent segmentation, so that the segmentation network can fully learn the feature information extracted by the adversarial network from the UWF sample image, and further improve the accuracy of the trained segmentation network in segmenting the UWF image.
[0152] At present, style transfer learning has been developed in related fields to promote the translation of samples between different fields, and has been proven to be useful for image enhancement and subsequent segmentation tasks. This technology has been applied to domain adaptation of multimodal images to help downstream tasks. FA images (fundus fluorescein angiography images) have the characteristics of high contrast. Therefore, an image segmentation method is also provided in an example of this application. The method uses the FA image style transfer network to transfer the UWF image to the FA image to enhance the vascular details, such as Fig.12 As shown, the method includes:
[0153] Step 701: Use the FA image style transfer network to process the seventh feature data to obtain a FA image corresponding to the UWF sample image.
[0154] In this embodiment, the adversarial network is a FA image style transfer network.
[0155] The FA image style transfer network is used to process the seventh feature data extracted from the UWF sample image to obtain the FA image corresponding to the UWF sample image.
[0156] Step 702: Determine a loss value based on the labels of the FA image and the UWF sample image.
[0157] In this embodiment, the loss function may be Dice loss.
[0158] Step 703: Optimize the parameters of the FA image style transfer network based on the loss value.
[0159] After determining the loss value, the parameters of the FA image style transfer network are optimized based on the loss value.
[0160] In the above scheme, due to the high contrast characteristics of FA images, by using the FA image style transfer network as an adversarial network, the segmentation network can learn the missing modality information from the FA images during the training process, and at the same time solve the problem of low accuracy of vascular segmentation due to low vascular contrast in UWF images. This further improves the accuracy of the segmentation model for UWF images.
[0161] In order to implement the above image segmentation method, Fig.13 As shown, an example of the present application provides an image segmentation device, comprising:
[0162] The processing module 10 is used to cut the collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image, wherein the first image, the second image and the third image have different sizes; and scale the first image and the corresponding second image and the third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image;
[0163] The computing module 20 is used to use a segmentation network to extract features from the fourth image and the corresponding fifth image and sixth image to obtain first feature data and corresponding second feature data and third feature data; use a self-attention mechanism to fuse the first feature data and the corresponding second feature data and third feature data to obtain first fused feature data; and use a segmentation network to segment the first fused feature data to obtain a segmentation result of the UWF image.
[0164] The calculation module 20 is further configured to determine a first size, a second size, and a third size based on the UWF image, wherein the third size is larger than the second size, and the second size is larger than the first size;
[0165] The processing module 10 is further used to cut the UWF image based on the first size to obtain multiple first images; and determine the corresponding second image based on the first image and the second size, and determine the corresponding third image based on the first image and the third size.
[0166] The calculation module 20 is further configured to determine a fourth size based on the first size, wherein the fourth size is smaller than or equal to the first size;
[0167] The processing module 10 is further configured to scale the first image and the corresponding second image and third image to the fourth size to obtain a fourth image and the corresponding fifth image and sixth image.
[0168] Among them, the calculation module 20 is also used to perform a self-attention mechanism on the first feature data and itself to obtain a first weight matrix corresponding to the first feature data; perform a self-attention mechanism on the first feature data and the second feature data to obtain a second weight matrix corresponding to the second feature data; perform a self-attention mechanism on the first feature data and the third feature data to obtain a third weight matrix corresponding to the third feature data; and perform weighted summation on the first feature data, the second feature data and the third feature data based on the first weight matrix, the second weight matrix and the third weight matrix respectively to obtain the first fused feature data.
[0169] The processing module 10 is further used to cut the UWF sample image to obtain a plurality of first sample images and a second sample image and a third sample image corresponding to each first sample image, wherein the first sample image, the second sample image and the third sample image have different sizes; and scale the first sample image and the corresponding second sample image and the third sample image to the same size to obtain a fourth sample image and the corresponding fifth sample image and sixth sample image;
[0170] The computing module 20 is also used to use a segmentation network to extract features from the fourth sample image and the corresponding fifth sample image and sixth sample image to obtain fourth feature data and the corresponding fifth feature data and sixth feature data; use a self-attention mechanism to fuse the fourth feature data and the corresponding fifth feature data and sixth feature data to obtain second fused feature data; determine target feature data based on the second fused feature data and the seventh feature data, and the seventh feature data is obtained by extracting features from the UWF image using an adversarial network; use the segmentation network to segment the target feature data to obtain a segmentation result of the UWF sample image; determine a loss value based on the segmentation result and the label of the UWF sample image; and optimize the parameters of the segmentation network based on the loss value.
[0171] Wherein, the calculation module 20 is further used to determine a first correlation coefficient based on the second fused feature data and the seventh feature data; determine a second correlation coefficient based on at least one first test matrix and a second test matrix corresponding to each first test matrix; and determine target feature data based on the second fused feature data, the seventh feature data, the first correlation coefficient and the second correlation coefficient;
[0172] The processing module 10 is also used to cut out the at least one first test matrix from the second fused feature data; based on the first test matrix, cut out a corresponding second test matrix from the seventh feature data, and the position and size of the first test matrix are the same as those of the second test matrix.
[0173] Among them, the calculation module 20 is also used to use the FA image style transfer network to process the seventh feature data to obtain the FA image corresponding to the UWF sample image; determine the loss value based on the labels of the FA image and the UWF sample image; and optimize the parameters of the FA image style transfer network based on the loss value.
[0174] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0175] Fig.14 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0176] like Fig.14 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0177] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0178] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the image segmentation method. For example, in some embodiments, the image segmentation method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the image segmentation method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the image segmentation method in any other appropriate manner (e.g., by means of firmware).
[0179] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), integrated systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0180] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0181] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0182] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0183] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0184] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0185] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0186] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0187] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An image segmentation method, the method include: Cutting the collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image, wherein the first image, the second image and the third image have different sizes; Scaling the first image and the corresponding second image and third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image; Using a segmentation network to perform feature extraction on the fourth image and the corresponding fifth image and sixth image to obtain first feature data and the corresponding second feature data and third feature data; Using a self-attention mechanism, the first feature data and the corresponding second feature data are feature-fused with the third feature data to obtain first fused feature data; Using a segmentation network to segment the first fused feature data to obtain a segmentation result of the UWF image; The step of training the segmentation network includes: Cutting the UWF sample image to obtain a plurality of first sample images and a second sample image and a third sample image corresponding to each first sample image, wherein the first sample image, the second sample image and the third sample image have different sizes; Scaling the first sample image and the corresponding second sample image and third sample image to the same size to obtain a fourth sample image and the corresponding fifth sample image and sixth sample image; Using a segmentation network to perform feature extraction on the fourth sample image and the corresponding fifth sample image and sixth sample image to obtain fourth feature data and the corresponding fifth feature data and sixth feature data; Using a self-attention mechanism, the fourth feature data and the corresponding fifth feature data and the sixth feature data are feature-fused to obtain second fused feature data; Determine target feature data based on the second fused feature data and seventh feature data, wherein the seventh feature data is obtained by extracting features from the UWF image using an adversarial network; Using the segmentation network to segment the target feature data, and obtaining a segmentation result of the UWF sample image; Determining a loss value based on the segmentation result and the label of the UWF sample image; Parameters of the segmentation network are optimized based on the loss value.
2. The method according to claim 1, wherein the collected UWF image is cut. include: Determine a first size, a second size, and a third size based on the UWF image, wherein the third size is larger than the second size, and the second size is larger than the first size; Cutting the UWF image based on the first size to obtain a plurality of first images; A corresponding second image is determined based on the first image and the second size, and a corresponding third image is determined based on the first image and the third size.
3. The method according to claim 2, wherein the first image and the corresponding second image and third image are scaled to the same size, include: Determine a fourth size based on the first size, wherein the fourth size is less than or equal to the first size; The first image and the corresponding second image and third image are scaled to the fourth size to obtain a fourth image and the corresponding fifth image and sixth image.
4. The method according to claim 1, wherein the first feature data and the corresponding second feature data and the third feature data are feature-fused using a self-attention mechanism. include: Processing the first feature data with itself through a self-attention mechanism to obtain a first weight matrix corresponding to the first feature data; Processing the first feature data and the second feature data with a self-attention mechanism to obtain a second weight matrix corresponding to the second feature data; Processing the first feature data and the third feature data by a self-attention mechanism to obtain a third weight matrix corresponding to the third feature data; The first feature data, the second feature data and the third feature data are weighted and summed based on the first weight matrix, the second weight matrix and the third weight matrix respectively to obtain the first fused feature data.
5. The method according to claim 1, wherein the target feature data is determined based on the second fused feature data and the seventh feature data. include: determining a first correlation coefficient based on the second fused feature data and the seventh feature data; Cutting out at least one first test matrix from the second fused feature data; Cutting out a corresponding second test matrix from the seventh characteristic data based on the first test matrix, wherein the position and size of the first test matrix are the same as those of the second test matrix; Determine a second correlation coefficient based on the at least one first test matrix and a second test matrix corresponding to each first test matrix; Target feature data is determined based on the second fused feature data, the seventh feature data, the first correlation coefficient and the second correlation coefficient.
6. The method according to claim 1, wherein the adversarial network is a FA image style transfer network, and the method further include: Processing the seventh feature data using the FA image style transfer network to obtain a FA image corresponding to the UWF sample image; Determining a loss value based on the labels of the FA image and the UWF sample image; Optimizing the parameters of the FA image style transfer network based on the loss value.
7. An image segmentation device, the device include: A processing module is used to cut the collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image, wherein the first image, the second image and the third image have different sizes; and scale the first image and the corresponding second image and the third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image; A computing module, configured to extract features from the fourth image and the corresponding fifth image and sixth image using a segmentation network to obtain first feature data and corresponding second feature data and third feature data; perform feature fusion on the first feature data and the corresponding second feature data and third feature data using a self-attention mechanism to obtain first fused feature data; and segment the first fused feature data using a segmentation network to obtain a segmentation result of the UWF image; The UWF sample image is cut to obtain a plurality of first sample images and a second sample image and a third sample image corresponding to each first sample image, wherein the sizes of the first sample image, the second sample image and the third sample image are different; the first sample image and the corresponding second sample image and the third sample image are scaled to the same size to obtain a fourth sample image and a corresponding fifth sample image and a sixth sample image; a segmentation network is used to perform feature extraction on the fourth sample image and the corresponding fifth sample image and the sixth sample image to obtain fourth feature data and corresponding fifth feature data and sixth feature data; a self-attention mechanism is used to perform feature fusion on the fourth feature data and the corresponding fifth feature data and the sixth feature data to obtain second fused feature data; Determine target feature data based on the second fused feature data and the seventh feature data, wherein the seventh feature data is obtained by extracting features from the UWF image using an adversarial network; segment the target feature data using the segmentation network to obtain a segmentation result of the UWF sample image; determine a loss value based on the segmentation result and the label of the UWF sample image; and optimize the parameters of the segmentation network based on the loss value.
8. An electronic device, include: processor; The processor cuts the collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image; Scaling the first image and the corresponding second image and third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image; Performing feature extraction on the fourth image and the corresponding fifth image and sixth image to obtain first feature data and the corresponding second feature data and third feature data; performing feature fusion on the first feature data and the corresponding second feature data and third feature data to obtain first fused feature data; Segmenting the first fusion feature data to obtain a segmentation result of the UWF image; The UWF sample image is cut to obtain a plurality of first sample images and a second sample image and a third sample image corresponding to each first sample image, wherein the sizes of the first sample image, the second sample image and the third sample image are different; the first sample image and the corresponding second sample image and the third sample image are scaled to the same size to obtain a fourth sample image and a corresponding fifth sample image and a sixth sample image; a segmentation network is used to perform feature extraction on the fourth sample image and the corresponding fifth sample image and the sixth sample image to obtain fourth feature data and corresponding fifth feature data and sixth feature data; a self-attention mechanism is used to perform feature fusion on the fourth feature data and the corresponding fifth feature data and the sixth feature data to obtain second fused feature data; Determine target feature data based on the second fused feature data and the seventh feature data, wherein the seventh feature data is obtained by extracting features from the UWF image using an adversarial network; segment the target feature data using the segmentation network to obtain a segmentation result of the UWF sample image; determine a loss value based on the segmentation result and the label of the UWF sample image; and optimize the parameters of the segmentation network based on the loss value.
9. A computer-readable storage medium storing a computer program, wherein the computer program is used to cut a collected UWF image to obtain a plurality of first images and a second image and a third image corresponding to each first image; scale the first image and the corresponding second image and third image to the same size to obtain a fourth image and the corresponding fifth image and sixth image ; Performing feature extraction on the fourth image and the corresponding fifth image and sixth image to obtain first feature data and the corresponding second feature data and third feature data; performing feature fusion on the first feature data and the corresponding second feature data and third feature data to obtain first fused feature data; Segmenting the first fusion feature data to obtain a segmentation result of the UWF image; The UWF sample image is cut to obtain a plurality of first sample images and a second sample image and a third sample image corresponding to each first sample image, wherein the sizes of the first sample image, the second sample image and the third sample image are different; the first sample image and the corresponding second sample image and the third sample image are scaled to the same size to obtain a fourth sample image and a corresponding fifth sample image and a sixth sample image; a segmentation network is used to perform feature extraction on the fourth sample image and the corresponding fifth sample image and the sixth sample image to obtain fourth feature data and corresponding fifth feature data and sixth feature data; a self-attention mechanism is used to perform feature fusion on the fourth feature data and the corresponding fifth feature data and the sixth feature data to obtain second fused feature data; Determine target feature data based on the second fused feature data and the seventh feature data, wherein the seventh feature data is obtained by extracting features from the UWF image using an adversarial network; segment the target feature data using the segmentation network to obtain a segmentation result of the UWF sample image; determine a loss value based on the segmentation result and the label of the UWF sample image; and optimize the parameters of the segmentation network based on the loss value.
Citation Information
Patent Citations
Image segmentation method, related device, equipment and storage medium
CN114549556A
SP-CTA image coronary artery segmentation method and device based on feature alignment domain
CN115063384A
