An image segmentation method based on frequency domain enhancement and gated decoding
By employing an image segmentation method based on frequency domain enhancement and gated decoding, the problems of contrast imbalance, morphological changes, and noise interference in liver tumor image segmentation are solved, achieving more efficient and accurate liver tumor segmentation.
Patent Information
- Application Number
- CN202411211236.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-30
AI Technical Summary
Existing technologies face challenges in liver tumor image segmentation, including imbalance between background and liver tumor contrast, large variations in liver tumor morphology, blurred boundaries, and noise interference. These issues result in high segmentation difficulty, high computational costs, and inaccurate segmentation.
An image segmentation method based on frequency domain enhancement and gated decoding is adopted. Image features are extracted by a hybrid coding module, the feature information is enhanced by a frequency domain enhancement module, and the decoding is performed by a gated decoding module. Finally, the model parameters are optimized by a loss function.
It improves the accuracy of liver tumor image segmentation, reduces computational load, and enhances segmentation results.
Smart Images

Figure CN118710915B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of medical image segmentation, and in particular relates to an image segmentation method based on frequency domain enhancement and gated decoding. Background Art
[0002] The liver is the most prominent solid organ in the human abdomen, with a complex anatomical structure and a dense vascular system. After treatment, patients with liver tumors who have not fully recovered often have more subtle and complex lesions.
[0003] Therefore, accurate segmentation of liver tumors is a crucial task in the process of computer-assisted rehabilitation medicine diagnosis. However, liver tumor segmentation currently faces multiple difficulties, the most prominent of which is the significant contrast imbalance between the background and the liver tumor. Due to this problem, the CT slices containing the liver and tumor only account for a very small proportion of the overall CT volume, which undoubtedly increases the difficulty of liver tumor screening. In addition, liver tumor segmentation faces several other challenges.
[0004] First, the morphology, size, and location of liver tumors vary greatly between patients, making it difficult to apply a unified segmentation method. Second, the boundary between tumors and normal tissues is often blurred, which poses a great challenge to the accurate segmentation of tumors from rehabilitation medicine CT images. Finally, the strong noise that may exist in each slice will seriously interfere with the recognition of foreground objects, further complicating the segmentation process. Most existing technologies use complex neural network structures, and the large number of parameters will significantly increase the computational cost, and there are problems such as insufficient detail positioning and inaccurate segmentation. Summary of the invention
[0005] In view of the shortcomings of the prior art in the image segmentation of liver tumor images, the present invention provides an image segmentation method based on frequency domain enhancement and gated decoding.
[0006] An image segmentation method based on frequency domain enhancement and gated decoding comprises the following steps:
[0007] Step S1: constructing a data set, the data set including a number of liver tumor images;
[0008] Step S2: construct an image segmentation model consisting of a hybrid coding module, a frequency domain enhancement module and a gated decoding module, import the image in step S1 into the hybrid coding module, and obtain image feature information;
[0009] In the process of importing the image in step S1 into the hybrid coding module, the hybrid coding module The residual structure block of the encoding module downsamples the image in sequence to obtain residual extraction information;
[0010] Step S3: importing the image in step S1 into the frequency domain enhancement module to obtain enhanced feature information;
[0011] Step S4: importing the residual extraction information and image feature information in step S2 and the enhanced feature information in step S3 into the gated decoding module to obtain gated decoding information;
[0012] Step S5: Obtain the final predicted segmentation image by convolution on the gated decoding information, construct a loss function, and optimize the parameters of the image segmentation model by minimizing the loss function.
[0013] Further, the hybrid coding module in step S2 includes sequentially connected Coding module, Encoding module and Modules; The encoding module is composed of a first residual structure block including 3 convolutional layers, a second residual structure block including 4 convolutional layers, and a third residual structure block including 9 convolutional layers, which are connected in sequence;
[0014] Step S2 is specifically as follows:
[0015] Step S21: The first, second and third residual structure blocks of the encoding module process the image to obtain residual extraction information; extract local information of the image and reduce the data dimension of the input image to reduce the amount of calculation, which is expressed as:
[0016] ;
[0017] in, Residual extraction information, It means that the image is downsampled three times in sequence using the residual structure block. represents the input image;
[0018] Step S22: The encoding module processes the residual extraction information of step S21, captures the global features of the residual extraction information, and obtains the global feature information, which is expressed as:
[0019] ;
[0020] in, Represents global feature information, Indicates 12 layers The encoding module performs encoding operation on the extracted feature information;
[0021] Step S23: The module performs feature recovery on the global feature information of step S22 so that the image feature information is consistent with the residual extraction information format of step S21, which is expressed as:
[0022] ;
[0023] in, Represents image feature information, Indicates that the feature recovery operation is performed on the input features.
[0024] Furthermore, the frequency domain enhancement module in step S3 includes a format conversion layer, a DCT transformation layer, a high frequency layer, a multi-head attention block and a Reshape module;
[0025] Step S31: The format conversion layer converts the input image into yCbCr format;
[0026] Step S32: performing discrete cosine transform on the converted image through a DCT transform layer to obtain transformed image features;
[0027] Step S33: extracting high-frequency information of the transformed image features of step S32 through the high-frequency layer, extracting low-frequency information of the transformed image features of step S32 through the low-frequency layer, and then splicing the high-frequency information and the low-frequency information to obtain spliced image features;
[0028] During the extraction process, the first 32 channels of each color channel of the transformed image feature are merged into a high-frequency band, and the last 32 channels are merged into a low-frequency band to process high-frequency and low-frequency information respectively. The color channel includes the y channel, the Cb channel, and the Cr channel, which is expressed as:
[0029] ;
[0030] ;
[0031] in, represents the high-frequency information obtained, represents the obtained low-frequency information, Represents a splicing operation, It means taking the first 32 channels of the input features. It means taking the last 32 channels of the input features. Indicates DCT transformation of input features. Respectively represent the characteristics of the y channel, Cb channel, and Cr channel of the image converted to yCbCr format;
[0032] Step S34: Then, the obtained high-frequency information and low-frequency information are respectively enhanced by the multi-head attention block to obtain the high-frequency features of the enhanced image and the low-frequency features of the enhanced image, and then spliced to obtain the spliced image enhanced features, and then the spliced image enhanced features are further enhanced by the multi-head attention block to obtain the image enhanced features, which are expressed as:
[0033] ;
[0034] in, represents the image enhancement feature, represents the multi-head self-attention block enhancement operation, It means to concatenate the y channel, Cb channel and Cr channel of the feature respectively;
[0035] Step S35: Perform feature recovery on the image enhancement feature through the Reshape module to obtain a first restored image feature, then perform feature enhancement on the first restored image feature through the multi-head attention block to obtain a first enhanced image feature, then perform feature recovery on the first enhanced image feature through the Reshape module to obtain an enhanced feature representation;
[0036] ;
[0037] in, represents enhanced feature information, Indicates feature recovery operation. Represents a multi-head self-attention block enhancement operation.
[0038] Further, the gated decoding module in step S4 includes a first gated decoding unit, a second gated decoding unit and a third gated decoding unit. The first gated decoding unit, the second gated decoding unit and the third gated decoding unit have the same structure and are all used for gated decoding. The gated decoding operation is specifically as follows:
[0039] Step S41A: Perform 1*1 convolution on the jump input feature, and then perform feature recovery;
[0040] Step S42A: Perform 1*1 convolution on the original input features;
[0041] Step S43A: performing data splicing on the jump input feature processed in step S41A and the original input feature processed in step S42A to obtain a spliced feature;
[0042] Step S44A: Perform 1*1 convolution on the concatenated features of step S43A, perform weighted connection on the concatenated features and the original input features of step S42A, then perform 1*1 convolution again, and finally perform upsampling to obtain gated decoding information;
[0043] The process of steps S41A to S44A is expressed as follows:
[0044] ;
[0045] in, represents the weighted weight of the original input feature in the gated decoding unit, Represents a splicing operation, Represents a 1*1 convolution operation, represents the original input features, represents the jump input feature, Represents gated decoding information, Represents an upsampling operation.
[0046] Furthermore, step S4 is specifically as follows:
[0047] Step S41: importing the image feature information as the original input feature and the enhanced feature information of step S3 as the skip input feature into the first gated decoding unit to obtain a first decoded feature representation;
[0048] Step S42: performing a jump connection between the enhanced feature information and the first decoded feature representation to obtain a first jump image feature;
[0049] Step S43: inputting the second residual extraction information as the skip input feature and the first skip image feature as the original input feature into the second gated decoding unit to obtain a second decoded feature representation;
[0050] Step S44: performing a jump connection between the second residual extraction information and the second decoding feature representation to obtain a second jump feature representation;
[0051] Step S45: inputting the first residual extraction information as a skip input feature and the second skip image feature as an original input feature into a third gated decoding unit to obtain a third decoded feature representation;
[0052] Step S46: perform a jump connection between the first residual extraction information and the third decoding feature representation to obtain the third jump feature representation, that is, the final gated decoding information.
[0053] Furthermore, the loss function in step S5 is specifically:
[0054] ;
[0055] ;
[0056] ;
[0057] in, represents the true segmentation map, represents the predicted segmentation map, represents the Dice loss function, represents the cross entropy loss function, represents the total loss function, and Respectively represent the preset parameters.
[0058] The positive and progressive effects of the present invention are:
[0059] The present invention makes full use of the frequency domain information of the liver tumor image by setting a hybrid coding module and a frequency domain enhancement module, and uses the gating mechanism in the gated decoding module to guide the decoding process, making full use of the low-level features from the liver tumor image, thereby improving the accuracy of liver tumor image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 The present invention is a flowchart of an image segmentation method based on frequency domain enhancement and gated decoding. DETAILED DESCRIPTION
[0061] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0062] Reference Figure 1 In one example, an image segmentation method based on frequency domain enhancement and gated decoding includes the following steps:
[0063] Step S1: constructing a data set, the data set including a number of liver tumor images;
[0064] Step S2: construct an image segmentation model consisting of a hybrid coding module, a frequency domain enhancement module and a gated decoding module, import the image in step S1 into the hybrid coding module, and obtain image feature information;
[0065] In the process of importing the image in step S1 into the hybrid coding module, the hybrid coding module The residual structure block of the encoding module downsamples the image in sequence to obtain residual extraction information;
[0066] Step S3: importing the image in step S1 into the frequency domain enhancement module to obtain enhanced feature information;
[0067] Step S4: importing the residual extraction information and image feature information in step S2 and the enhanced feature information in step S3 into the gated decoding module to obtain gated decoding information;
[0068] Step S5: Obtain the final predicted segmentation image by convolution on the gated decoding information, construct a loss function, and optimize the parameters of the image segmentation model by minimizing the loss function.
[0069] Further, in one example, the hybrid coding module in step S2 includes sequentially connected Coding module, Encoding module and Modules; The encoding module is composed of a first residual structure block including 3 convolutional layers, a second residual structure block including 4 convolutional layers, and a third residual structure block including 9 convolutional layers, which are connected in sequence;
[0070] Step S2 is specifically as follows:
[0071] Step S21: The first, second and third residual structure blocks of the encoding module process the image to obtain residual extraction information; extract local information of the image and reduce the data dimension of the input image to reduce the amount of calculation, which is expressed as:
[0072] ;
[0073] in, Residual extraction information, It means that the image is downsampled three times in sequence using the residual structure block. represents the input image;
[0074] Step S22: The encoding module processes the residual extraction information of step S21, captures the global features of the residual extraction information, and obtains the global feature information, which is expressed as:
[0075] ;
[0076] in, Represents global feature information, Indicates 12 layers The encoding module performs encoding operation on the extracted feature information;
[0077] Step S23: The module performs feature recovery on the global feature information of step S22 so that the image feature information is consistent with the residual extraction information format of step S21, which is expressed as:
[0078] ;
[0079] in, Represents image feature information, Indicates that the feature recovery operation is performed on the input features.
[0080] Further, in one example, the frequency domain enhancement module in step S3 includes a format conversion layer, a DCT transformation layer, a high frequency layer, a multi-head attention block and a Reshape module;
[0081] Step S31: The format conversion layer converts the input image into yCbCr format;
[0082] Step S32: performing discrete cosine transform on the converted image through a DCT transform layer to obtain transformed image features;
[0083] Step S33: extracting high-frequency information of the transformed image features of step S32 through the high-frequency layer, extracting low-frequency information of the transformed image features of step S32 through the low-frequency layer, and then splicing the high-frequency information and the low-frequency information to obtain spliced image features;
[0084] During the extraction process, the first 32 channels of each color channel of the transformed image feature are merged into a high-frequency band, and the last 32 channels are merged into a low-frequency band to process high-frequency and low-frequency information respectively. The color channel includes the y channel, the Cb channel, and the Cr channel, which is expressed as:
[0085] ;
[0086] ;
[0087] in, represents the high-frequency information obtained, represents the obtained low-frequency information, Represents a splicing operation, It means taking the first 32 channels of the input features. It means taking the last 32 channels of the input features. Indicates DCT transformation of input features. Respectively represent the characteristics of the y channel, Cb channel, and Cr channel of the image converted to yCbCr format;
[0088] Step S34: Then, the obtained high-frequency information and low-frequency information are respectively enhanced by the multi-head attention block to obtain the high-frequency features of the enhanced image and the low-frequency features of the enhanced image, and then spliced to obtain the spliced image enhanced features, and then the spliced image enhanced features are further enhanced by the multi-head attention block to obtain the image enhanced features, which are expressed as:
[0089] ;
[0090] in, represents the image enhancement feature, represents the multi-head self-attention block enhancement operation, It means to concatenate the y channel, Cb channel and Cr channel of the feature respectively;
[0091] Step S35: Perform feature recovery on the image enhancement feature through the Reshape module to obtain a first restored image feature, then perform feature enhancement on the first restored image feature through the multi-head attention block to obtain a first enhanced image feature, then perform feature recovery on the first enhanced image feature through the Reshape module to obtain an enhanced feature representation;
[0092] ;
[0093] in, represents enhanced feature information, Indicates feature recovery operation. Represents a multi-head self-attention block enhancement operation.
[0094] Further, in an example, the gated decoding module in step S4 includes a first gated decoding unit, a second gated decoding unit and a third gated decoding unit, the first gated decoding unit, the second gated decoding unit and the third gated decoding unit have the same structure and are all used for gated decoding, and the gated decoding operation is specifically:
[0095] Step S41A: Perform 1*1 convolution on the jump input feature, and then perform feature recovery;
[0096] Step S42A: Perform 1*1 convolution on the original input features;
[0097] Step S43A: performing data splicing on the jump input feature processed in step S41A and the original input feature processed in step S42A to obtain a spliced feature;
[0098] Step S44A: Perform 1*1 convolution on the concatenated features of step S43A, perform weighted connection on the concatenated features and the original input features of step S42A, then perform 1*1 convolution again, and finally perform upsampling to obtain gated decoding information;
[0099] The process of steps S41A to S44A is expressed as follows:
[0100] ;
[0101] in, represents the weighted weight of the original input feature in the gated decoding unit, Represents a splicing operation, Represents a 1*1 convolution operation, represents the original input features, represents the jump input feature, Represents gated decoding information, Represents an upsampling operation.
[0102] Furthermore, in one example, step S4 is specifically as follows:
[0103] Step S41: importing the image feature information as the original input feature and the enhanced feature information of step S3 as the skip input feature into the first gated decoding unit to obtain a first decoded feature representation;
[0104] Step S42: performing a jump connection between the enhanced feature information and the first decoded feature representation to obtain a first jump image feature;
[0105] Step S43: inputting the second residual extraction information as the skip input feature and the first skip image feature as the original input feature into the second gated decoding unit to obtain a second decoded feature representation;
[0106] Step S44: performing a jump connection between the second residual extraction information and the second decoding feature representation to obtain a second jump feature representation;
[0107] Step S45: inputting the first residual extraction information as a skip input feature and the second skip image feature as an original input feature into a third gated decoding unit to obtain a third decoded feature representation;
[0108] Step S46: perform a jump connection between the first residual extraction information and the third decoding feature representation to obtain the third jump feature representation, that is, the final gated decoding information.
[0109] Furthermore, the loss function in step S5 is specifically:
[0110] ;
[0111] ;
[0112] ;
[0113] in, represents the true segmentation map, represents the predicted segmentation map, represents the Dice loss function, represents the cross entropy loss function, represents the total loss function, and Respectively represent the preset parameters.
[0114] The present invention is described in detail above in conjunction with the embodiments of the accompanying drawings. A person skilled in the art can make various variations of the present invention according to the above description. Therefore, some details in the embodiments should not be construed as limiting the present invention, and the present invention shall be protected by the scope defined by the attached claims.
Claims
1. An image segmentation method based on frequency domain enhancement and gated decoding, characterized in that: The following steps are involved: Step S1: constructing a data set, the data set including a number of liver tumor images; Step S2: construct an image segmentation model consisting of a hybrid coding module, a frequency domain enhancement module and a gated decoding module, import the image in step S1 into the hybrid coding module, and obtain image feature information; In the process of importing the image in step S1 into the hybrid coding module, the hybrid coding module The residual structure block of the encoding module downsamples the image in sequence to obtain residual extraction information; Step S3: importing the image in step S1 into the frequency domain enhancement module to obtain enhanced feature information; Step S4: importing the residual extraction information and image feature information in step S2 and the enhanced feature information in step S3 into the gated decoding module to obtain gated decoding information; Step S5: Obtain the final predicted segmentation image by convolution on the gated decoding information, construct a loss function, and optimize the parameters of the image segmentation model by minimizing the loss function.
2. The image segmentation method based on frequency domain enhancement and gated decoding as claimed in claim 1, characterized in that: The hybrid coding module in step S2 includes sequentially connected Coding module, Encoding module and Modules; The encoding module is composed of a first residual structure block including 3 convolutional layers, a second residual structure block including 4 convolutional layers, and a third residual structure block including 9 convolutional layers, which are connected in sequence; Step S2 is specifically as follows: Step S21: The first, second and third residual structure blocks of the encoding module process the image to obtain residual extraction information; extract local information of the image and reduce the data dimension of the input image to reduce the amount of calculation, which is expressed as: ; in, Residual extraction information, It means that the image is downsampled three times in sequence using the residual structure block. represents the input image; Step S22: The encoding module processes the residual extraction information of step S21, captures the global features of the residual extraction information, and obtains the global feature information, which is expressed as: ; in, Represents global feature information, Indicates 12 layers The encoding module performs encoding operation on the extracted feature information; Step S23: The module performs feature recovery on the global feature information of step S22 so that the image feature information is consistent with the residual extraction information format of step S21, which is expressed as: ; in, Represents image feature information, Indicates that the feature recovery operation is performed on the input features.
3. The image segmentation method based on frequency domain enhancement and gated decoding as claimed in claim 1, characterized in that: The frequency domain enhancement module in step S3 includes a format conversion layer, a DCT transformation layer, a high frequency layer, a multi-head attention block and a Reshape module; Step S31: The format conversion layer converts the input image into yCbCr format; Step S32: performing discrete cosine transform on the converted image through a DCT transform layer to obtain transformed image features; Step S33: extracting high-frequency information of the transformed image features of step S32 through the high-frequency layer, extracting low-frequency information of the transformed image features of step S32 through the low-frequency layer, and then splicing the high-frequency information and the low-frequency information to obtain spliced image features; During the extraction process, the first 32 channels of each color channel of the transformed image feature are merged into a high-frequency band, and the last 32 channels are merged into a low-frequency band to process high-frequency and low-frequency information respectively. The color channel includes the y channel, the Cb channel, and the Cr channel, which is expressed as: ; ; in, represents the high-frequency information obtained, represents the obtained low-frequency information, Represents a splicing operation, It means taking the first 32 channels of the input features. It means taking the last 32 channels of the input features. Indicates DCT transformation of input features. Respectively represent the characteristics of the y channel, Cb channel, and Cr channel of the image converted to yCbCr format; Step S34: Then, the obtained high-frequency information and low-frequency information are respectively enhanced by the multi-head attention block to obtain the high-frequency features of the enhanced image and the low-frequency features of the enhanced image, and then spliced to obtain the spliced image enhanced features, and then the spliced image enhanced features are further enhanced by the multi-head attention block to obtain the image enhanced features, which are expressed as: ; in, represents the image enhancement feature, represents the multi-head self-attention block enhancement operation, It means to concatenate the y channel, Cb channel and Cr channel of the feature respectively; Step S35: Perform feature recovery on the image enhancement feature through the Reshape module to obtain a first restored image feature, then perform feature enhancement on the first restored image feature through the multi-head attention block to obtain a first enhanced image feature, then perform feature recovery on the first enhanced image feature through the Reshape module to obtain an enhanced feature representation; ; in, represents enhanced feature information, Indicates feature recovery operation. Represents a multi-head self-attention block enhancement operation.
4. The image segmentation method based on frequency domain enhancement and gated decoding as claimed in claim 1, characterized in that: The gated decoding module in step S4 includes a first gated decoding unit, a second gated decoding unit and a third gated decoding unit. The first gated decoding unit, the second gated decoding unit and the third gated decoding unit have the same structure and are all used for gated decoding. The gated decoding operation is specifically as follows: Step S41A: Perform 1*1 convolution on the jump input feature, and then perform feature recovery; Step S42A: Perform 1*1 convolution on the original input features; Step S43A: performing data splicing on the jump input feature processed in step S41A and the original input feature processed in step S42A to obtain a spliced feature; Step S44A: Perform 1*1 convolution on the concatenated features of step S43A, perform weighted connection on the concatenated features and the original input features of step S42A, then perform 1*1 convolution again, and finally perform upsampling to obtain gated decoding information; The process of steps S41A to S44A is expressed as follows: ; in, represents the weighted weight of the original input feature in the gated decoding unit, Represents a splicing operation, Represents a 1*1 convolution operation, represents the original input features, represents the jump input feature, Indicates the gated decoding information, Represents an upsampling operation.
5. The image segmentation method based on frequency domain enhancement and gated decoding as claimed in claim 4, characterized in that: Step S4 is specifically as follows: Step S41: importing the image feature information as the original input feature and the enhanced feature information of step S3 as the skip input feature into the first gated decoding unit to obtain a first decoded feature representation; Step S42: performing a jump connection between the enhanced feature information and the first decoded feature representation to obtain a first jump image feature; Step S43: inputting the second residual extraction information as the skip input feature and the first skip image feature as the original input feature into the second gated decoding unit to obtain a second decoded feature representation; Step S44: performing a jump connection between the second residual extraction information and the second decoding feature representation to obtain a second jump feature representation; Step S45: inputting the first residual extraction information as a skip input feature and the second skip image feature as an original input feature into a third gated decoding unit to obtain a third decoded feature representation; Step S46: perform a jump connection between the first residual extraction information and the third decoding feature representation to obtain the third jump feature representation, that is, the final gated decoding information.
6. The image segmentation method based on frequency domain enhancement and gated decoding as claimed in claim 1, characterized in that: The loss function in step S5 is specifically: ; ; ; in, represents the true segmentation map, represents the predicted segmentation map, represents the Dice loss function, represents the cross entropy loss function, represents the total loss function, and Respectively represent the preset parameters.
