Image segmentation method and device, computer device and storage medium

By segmenting brain perfusion images using a V-shaped self-attention mechanism network model, the challenges of identifying cerebrospinal fluid and skull were solved, improving the accuracy of ischemic stroke diagnosis and the precision of core infarct region calculation.

CN114494144BActive Publication Date: 2026-03-27UNITED IMAGING RES INST OF INNOVATIVE MEDICAL EQUIP
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies have difficulty effectively identifying the location of cerebrospinal fluid and skull, resulting in a high false positive rate for lesion areas in CTP perfusion images, which affects the accuracy of ischemic stroke diagnosis.

Method used

A V-shaped self-attention mechanism network model is used to segment brain perfusion images. By acquiring images to be segmented in different modalities, the multi-head self-attention mechanism module of the encoding and decoding layers is used to enhance the target area and perform down/upsampling processing to generate hemispherical segmentation result images, thereby identifying the location of cerebrospinal fluid and skull.

Benefits of technology

It enables accurate segmentation of cerebrospinal fluid and skull in brain perfusion images, reduces false positive lesion areas, and improves the accuracy of ischemic stroke diagnosis and the precision of core infarction and penumbra volume calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494144B_ABST
    Figure CN114494144B_ABST
Patent Text Reader

Abstract

The application relates to an image segmentation method and device, computer equipment and a storage medium. At least two different modalities of to-be-segmented images are obtained according to a brain perfusion image; the at least two different modalities of to-be-segmented images are input into a preset V-shaped self-attention mechanism network model to obtain a cerebrospinal fluid segmentation image of the brain perfusion image; and a skull segmentation image of the brain perfusion image is determined according to the cerebrospinal fluid segmentation image. The preset segmentation neural network model can be used to segment the to-be-segmented brain perfusion image to obtain the cerebrospinal fluid segmentation image and the skull segmentation image, so that the infarction area and the cerebrospinal fluid part and the skull part in the brain perfusion image can be distinguished in the subsequent process, and the volume of the core infarction and the penumbra area can be accurately calculated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical imaging technology, and in particular to an image segmentation method, apparatus, computer device, and storage medium. Background Technology

[0002] Ischemic stroke, commonly known as apoplexy, is a common clinical condition. In recent years, the incidence of ischemic stroke has been rising continuously, the age of onset has been decreasing year by year, and the recurrence rate has also increased. Computed tomography perfusion (CTP) is highly effective in diagnosing ischemic stroke due to its short examination time, few contraindications, ability to detect changes in local cerebral blood flow perfusion, and ability to quantify the blood supply to the brain, thus accurately identifying the site of ischemia.

[0003] Currently, the main clinical analysis process for CTP imaging involves first using different mathematical models to calculate various perfusion parameter values. These parameters are then further combined with domestic and international diagnostic standards for a series of thresholding and image processing steps to ultimately obtain the core of the infarct area and the penumbra region. However, because the density of cerebrospinal fluid (CSF), skull, and the infarct area in CTP images is very similar, it is necessary to identify the locations of CSF and skull to remove interference from them and avoid false positives in the lesion areas displayed on CTP perfusion images.

[0004] Therefore, there is an urgent need for a method that can identify the location of cerebrospinal fluid and skull. Summary of the Invention

[0005] Therefore, it is necessary to provide an image segmentation method, apparatus, computer equipment, and storage medium capable of identifying the location of cerebrospinal fluid and skull, in order to address the aforementioned technical problems.

[0006] In a first aspect, this application provides an image segmentation method, the method comprising:

[0007] Obtain images of at least two different modalities from brain perfusion images;

[0008] At least two different modalities of images to be segmented are input into a pre-defined segmentation neural network model to obtain hemispherical segmentation results of brain perfusion images; the segmentation neural network model is a V-shaped self-attention mechanism network model.

[0009] The cerebrospinal fluid segmentation image of the brain perfusion image was determined based on the hemispherical segmentation result image;

[0010] The skull segmentation image of the brain perfusion image is determined based on the hemispherical segmentation result image and the brain perfusion image.

[0011] In one embodiment, the segmentation neural network model includes: an encoding layer, an input layer, and a decoding layer; the input layer includes at least one first multi-head self-attention mechanism module.

[0012] The coding layer is used to perform target region enhancement and downsampling processing on images to be segmented from at least two different modalities to obtain a first coded image;

[0013] The input layer is used to enhance the target region of the first encoded image to obtain the second encoded image;

[0014] The decoding layer is used to upsample and enhance the target area of ​​the second encoded image to obtain the hemispherical segmentation result image of the brain perfusion image.

[0015] In one embodiment, the first multi-head self-attention mechanism module includes: a first-layer normalization unit, a multi-head self-attention mechanism unit, a second-layer normalization unit, and a multilayer perceptron unit;

[0016] The first normalization unit is used to normalize the input image;

[0017] The multi-head self-attention mechanism unit is used to increase the weight of the target region in the normalized image and decrease the weight of the other regions to obtain the first intermediate feature block image. The intermediate feature block image is then fused with the input image to obtain the second intermediate feature block image.

[0018] The second normalization unit is used to normalize the second intermediate feature block image to obtain the third intermediate feature block image;

[0019] A multilayer perceptron is used to determine the weights of each block in the third intermediate feature block image to obtain the fourth intermediate feature block image. The fourth intermediate feature block image is then fused with the third intermediate feature block image to obtain the output image.

[0020] In one embodiment, the encoding layer includes a block partitioning module, a linear embedding module, and at least one first enhanced sampling module; the decoding layer includes at least one second enhanced sampling module, a block embedding module, and a linear projection module.

[0021] The slicing and partitioning module is used to slice the image to be segmented from at least two different modalities to obtain multiple first slice images;

[0022] The linear embedding module is used to linearly sort multiple first slice images to obtain a one-dimensional linear slice image;

[0023] The first enhancement sampling module is used to enhance the blocks of the target part in the one-dimensional linear block image to obtain the first enhanced block image, and to downsample the first enhanced block image to obtain the first encoded image;

[0024] The second enhancement sampling module is used to upsample the second coded block image to obtain an upsampled block image, and to enhance the target part in the upsampled block image to obtain a second enhanced block image.

[0025] The segmentation and embedding module is used to restore the second enhanced segmented image to obtain the restored segmented image;

[0026] The linear projection module is used to perform linear transformations on the restored segmented image to obtain a hemispherical segmentation result image.

[0027] In one embodiment, the first enhanced sampling module includes: at least one second multi-head self-attention mechanism module and a downsampling submodule; the second enhanced sampling module includes: at least one third multi-head self-attention mechanism module and an upsampling submodule;

[0028] The second multi-head self-attention mechanism module is used to enhance the blocks of the target part in the one-dimensional linear block image to obtain the enhanced block image, and then fuse the enhanced block image with the one-dimensional linear block image to obtain the first enhanced block image.

[0029] The downsampling submodule is used to downsample the first enhanced block image to obtain an enhanced sampled block image;

[0030] The upsampling submodule is used to upsample the second encoded block image to obtain an upsampled block image;

[0031] The third multi-head self-attention mechanism module is used to enhance the target area in the upsampled image slice, and then fuse the upsampled slice image and the enhanced slice image to obtain the second enhanced slice image.

[0032] In one embodiment, determining the cerebrospinal fluid segmentation image of the brain perfusion image based on the hemispherical segmentation result image includes:

[0033] The region corresponding to the target pixel value in the hemispherical segmentation result image is obtained and identified as the cerebrospinal fluid segmentation image of the brain perfusion image.

[0034] In one embodiment, determining a cranial segmentation image of the brain perfusion image based on the hemispherical segmentation result image and the brain perfusion image includes:

[0035] By replacing the pixel values ​​of the cerebrospinal fluid segmentation region with the pixel values ​​of other display regions, an image of the brain parenchyma is obtained.

[0036] Based on brain parenchyma images, determine the brain parenchyma regions in the brain perfusion map;

[0037] The pixel values ​​of the brain parenchyma region in the brain perfusion map are replaced with preset pixel values ​​to obtain a skull segmentation image.

[0038] In one embodiment, the process of constructing a segmentation neural network model includes:

[0039] Obtain brain perfusion images of multiple samples and corresponding hemispheric segmentation results images of the samples;

[0040] The brain perfusion image of the sample is input into the initial neural network model to segment the cerebrospinal fluid segmentation image, and the segmentation result image of the first hemisphere is obtained;

[0041] Based on the loss values ​​of the first hemisphere segmentation result image and the sample hemisphere segmentation result image, the parameters of the initial neural network model are adjusted until the preset convergence condition is met, thus obtaining the segmentation neural network model.

[0042] Secondly, this application provides an image segmentation apparatus, the apparatus comprising:

[0043] The acquisition module is used to acquire images of at least two different modalities to be segmented based on brain perfusion images;

[0044] The segmentation module is used to input at least two different modalities of images to be segmented into a preset segmentation neural network model to obtain cerebrospinal fluid segmentation images of brain perfusion images; the segmentation neural network model is a V-shaped self-attention mechanism network model;

[0045] The first determining module is used to determine the cerebrospinal fluid segmentation image of the brain perfusion image based on the hemispherical segmentation result image;

[0046] The second determining module is used to determine the skull segmentation image of the brain perfusion image based on the hemispherical segmentation result image and the brain perfusion image.

[0047] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in any of the method embodiments of the first aspect described above.

[0048] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in any of the method embodiments of the first aspect described above.

[0049] The aforementioned image segmentation method, apparatus, computer equipment, and storage medium acquire at least two different modalities of images to be segmented based on brain perfusion images; input the at least two different modalities of images to be segmented into a preset V-shaped self-attention mechanism network model to obtain a cerebrospinal fluid segmentation image of the brain perfusion image; and determine a skull segmentation image of the brain perfusion image based on the cerebrospinal fluid segmentation image. This allows for the segmentation of the brain perfusion image using a preset segmentation neural network model, obtaining both cerebrospinal fluid and skull segmentation images. This facilitates subsequent differentiation of infarct regions, penumbra regions, cerebrospinal fluid sites, and skull sites within the brain perfusion image, thereby accurately calculating the volume of the core infarct and penumbra regions. Attached Figure Description

[0050] Figure 1 This is a diagram illustrating the application environment of an image segmentation method in one embodiment;

[0051] Figure 2 This is a flowchart illustrating an image segmentation method in one embodiment;

[0052] Figure 3 This is a schematic diagram of the structure of a segmentation neural network model in one embodiment;

[0053] Figure 4 This is a flowchart illustrating the image segmentation method in another embodiment;

[0054] Figure 5 This is a flowchart illustrating the image segmentation method in another embodiment;

[0055] Figure 6 This is a flowchart illustrating the image segmentation method in another embodiment;

[0056] Figure 7 This is a flowchart illustrating the image segmentation method in another embodiment;

[0057] Figure 7-a This is a schematic diagram of the structure of a segmentation neural network model in one embodiment;

[0058] Figure 8 This is a structural block diagram of an image segmentation device in one embodiment;

[0059] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0061] Currently, the segmentation of cerebrospinal fluid (CSF) and skull in brain images is mostly achieved using different techniques. For CSF segmentation, traditional image segmentation methods such as comparative region generation and fuzzy C-means clustering are commonly used, while generative adversarial networks (GANs) are also employed. Skull segmentation primarily utilizes methods such as skull thresholding and Hessian matrix-enhanced thresholding.

[0062] Based on this, this application provides an image segmentation method that can segment cerebrospinal fluid and skull using the same technique, which can be applied to, for example... Figure 1 The application environment shown may include a terminal and a computer perfusion scanning device (CTP device). The terminal 102 communicates with the CTP device 104 via a network. The terminal acquires brain perfusion images obtained from the CTP device scan, and inputs these images into a preset segmentation neural network model for segmentation, obtaining cerebrospinal fluid segmentation images and skull segmentation images. The terminal 102 may be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Optionally, the image segmentation method provided in this application can also be applied to an application environment consisting of a terminal and a computed tomography (CT) device or an magnetic resonance imaging (MRI) device to acquire brain images scanned by the CT or MRI device; no limitation is imposed herein.

[0063] In one embodiment, such as Figure 2 As shown, an image segmentation method is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:

[0064] S202, Obtain at least two different modalities of images to be segmented based on brain perfusion images.

[0065] Specifically, after a CT scanner performs a brain scan on a target subject, it can generate brain perfusion images in DICOM format. Once the brain perfusion images are acquired, images to be segmented in different modalities are generated based on different modality settings. These modalities can include brain window modality, bone window modality, etc., and are not limited here.

[0066] Optionally, after obtaining the brain perfusion image, the DICOM format brain perfusion image can be anonymized and converted into a nii format brain perfusion image. Then, the validity of the nii format brain perfusion image is checked. If the image is valid, different window widths and window levels are used to obtain multimodal images to be segmented from the valid nii format brain perfusion image, and normalization processing is performed on the images to be segmented in different modalities respectively.

[0067] Furthermore, the effective images are normalized using the window width and window level of the brain window and bone window modalities, and the normalized images of different modalities to be segmented are input into a preset segmentation neural network model. Validity can include: whether the image is complete and whether the number of images reaches a preset threshold. The normalization formula can include: Where x is the image data to be normalized, μ is the mean, σ is the standard deviation, and x′ is the normalized image data.

[0068] S204, input at least two different modalities of the images to be segmented into a preset segmentation neural network model to obtain the hemispherical segmentation result image of the brain perfusion image; the segmentation neural network model is a V-shaped self-attention mechanism network model.

[0069] Specifically, images of different modalities to be segmented are input into a preset neural network model. The images of different modalities are segmented to obtain hemispherical segmentation results of the brain perfusion image. This hemispherical segmentation result image is a mask image. The hemispherical segmentation result image displays the brain parenchyma, which includes cerebrospinal fluid (CSF) and other related areas. In this hemispherical segmentation result image, CSF areas are displayed and labeled using a first pixel value, while brain parenchyma locations excluding CSF areas are displayed and labeled using a second pixel value. The CSF areas include ventricles and cisterns, which can be distinguished using different pixel values. This segmentation neural network model is a V-shaped self-attention mechanism network model. This segmentation neural network model may include convolutional layers, pooling layers, etc., without limitation.

[0070] Optionally, the preset segmentation neural network model can be a multi-channel V-shaped self-attention mechanism network model. The number of channels can be equal to the number of modes.

[0071] Optionally, the segmentation neural network model is a U-shaped self-attention mechanism network model.

[0072] S206, Determine the cerebrospinal fluid segmentation image of the brain perfusion image based on the hemispherical segmentation result image.

[0073] Specifically, when the hemispherical segmentation result image is obtained, the pixel value of each pixel in the hemispherical segmentation result image can be obtained. Then, the region corresponding to the preset target pixel value can be determined as the cerebrospinal fluid region, and only the cerebrospinal fluid region can be displayed to obtain the cerebrospinal fluid segmentation image of the brain perfusion image.

[0074] S208, Determine the skull segmentation image of the brain perfusion image based on the hemispherical segmentation result image and the brain perfusion image.

[0075] Specifically, this can be achieved by first replacing the pixel values ​​of the cerebrospinal fluid region in the hemispherical segmentation image with pixel values ​​of the brain parenchyma region other than the cerebrospinal fluid region. Then, the processed hemispherical segmentation image showing the brain parenchyma region is compared with the brain perfusion image to determine the brain parenchyma region in the brain perfusion image. The pixel values ​​of the brain parenchyma in the brain perfusion image are then set to preset background pixel values, which highlights the skull region and yields a skull segmentation image of the brain perfusion image.

[0076] In the aforementioned image segmentation method, at least two different modalities of images to be segmented are obtained based on brain perfusion images. These images are then input into a pre-defined V-shaped self-attention mechanism network model to obtain hemispherical segmentation results of the brain perfusion images. Cerebrospinal fluid segmentation images of the brain perfusion images are determined based on the hemispherical segmentation results. Finally, cranial segmentation images of the brain perfusion images are determined based on the hemispherical segmentation results and the brain perfusion images. This method utilizes a pre-defined segmentation neural network model to segment the brain perfusion images to obtain cerebrospinal fluid and cranial segmentation images, enabling subsequent differentiation of infarct regions, cerebrospinal fluid sites, and cranial sites within the brain perfusion images, thereby accurately calculating the volume of core infarcts and abnormal perfusion areas. Furthermore, the V-shaped self-attention mechanism network in this scheme is a dual-channel multimodal structure, capable of simultaneously inputting images of different modalities and simultaneously outputting segmentation results for different parts. This scheme segments the image into several non-overlapping image blocks, inputting them sequentially into the multi-head self-attention mechanism, which improves the model's ability to learn contextual semantic information.

[0077] Furthermore, such as Figure 3 As shown, the segmentation neural network model involved in the above embodiment includes: an encoding layer 301, an input layer 302, and a decoding layer 303; the input layer includes at least one first multi-head self-attention mechanism module; based on this, the above step S204, inputting at least two different modalities of the images to be segmented into the preset segmentation neural network model, to obtain a cerebrospinal fluid segmentation image of the brain perfusion image, includes:

[0078] The coding layer is used to perform target region enhancement and downsampling processing on images to be segmented from at least two different modalities to obtain a first coded image;

[0079] The input layer is used to enhance the target region of the first encoded image to obtain the second encoded image;

[0080] The decoding layer is used to upsample and enhance the target area of ​​the second encoded image to obtain a cerebrospinal fluid segmentation image of the brain perfusion image.

[0081] Specifically, when images of different modalities to be segmented are input to the coding layer, the coding layer can segment the images of different modalities into multiple segments, and add weights to the segments containing the target region to enhance the importance of the target region. Multiple segments are then combined and downsampled. The combined segments can be downsampled at least once to obtain the first coded image. Alternatively, after the coding layer segments the images of different modalities into multiple segments, these segments can be arranged linearly, and weights can be added to the segments containing the target region for enhancement processing; this is not limited. The target region can include cerebrospinal fluid, skull, etc., without limitation; different modalities can include brain window modalities, bone window modalities, etc., without limitation.

[0082] The input layer further enhances the segments of the target region in the first encoded image to obtain the second encoded image. The input layer includes at least one first multi-head self-attention mechanism module. Preferably, the input layer includes at least three first multi-head self-attention mechanism modules. The first multi-head self-attention mechanism modules in the input layer further enhance the segments of the target region in the first encoded image by adding weights to obtain the second encoded image; multiple first multi-head self-attention mechanism modules perform multiple enhancement processes on the target region in the first encoded image.

[0083] The decoding layer decodes the second encoded image, that is, it restores the second encoded image. First, it upsamples the second encoded image, and then restores each segment in the order of segmentation to obtain the cerebrospinal fluid segmentation image of the brain perfusion image.

[0084] Optionally, skip connections may also exist between the encoding layer and the decoding layer.

[0085] In this embodiment, the segmentation neural network model includes an encoding layer, an input layer including at least one multi-head self-attention mechanism module, and a decoding layer. The encoding layer performs target region enhancement and downsampling processing on at least two different modalities of the images to be segmented to obtain a first encoded image. The input layer enhances the target region of the first encoded image to obtain a second encoded image. The decoding layer upsampling and target region enhancement processing on the second encoded image yields a cerebrospinal fluid segmentation image of the brain perfusion image. This segmentation neural network model can segment images of different modalities, and it can quickly and accurately distinguish the locations of cerebrospinal fluid and skull using the neural network model. Furthermore, the skip connection between the encoding and decoding layers reduces image information loss in the perfusion image and improves the accuracy of the segmentation results.

[0086] The above embodiments illustrate the structure of the segmentation neural network model. In this model, a multi-head self-attention mechanism is employed to focus on target feature regions from a global perspective. An embodiment further illustrates this multi-head self-attention mechanism. In one embodiment, such as... Figure 3 As shown, the first multi-head self-attention mechanism module in the segmentation neural network model in the above embodiment includes: a first-layer normalization unit, a multi-head self-attention mechanism unit, a second-layer normalization unit, and a multilayer perceptron unit.

[0087] The first normalization unit is used to normalize the input image;

[0088] The multi-head self-attention mechanism unit is used to increase the weight of the target region in the normalized image and decrease the weight of the other regions to obtain the first intermediate feature block image. The intermediate feature block image is then fused with the input image to obtain the second intermediate feature block image.

[0089] The second normalization unit is used to normalize the second intermediate feature block image to obtain the third intermediate feature block image;

[0090] A multilayer perceptron is used to determine the weights of each block in the third intermediate feature block image to obtain the fourth intermediate feature block image. The fourth intermediate feature block image is then fused with the third intermediate feature block image to obtain the output image.

[0091] Specifically, if the input layer includes multiple first multi-head self-attention mechanism modules, the first-layer normalization unit in the first first multi-head self-attention mechanism module normalizes the first coding layer image output by the coding layer. Then, the multi-head self-attention mechanism unit increases the weight of the target region segments in the normalized image and decreases the weight of other region segments to obtain a first intermediate feature segment image. The intermediate feature segment image is fused with the first coding image to obtain a second intermediate feature segment image, which is then input to the second-layer normalization unit. The second intermediate feature segment image is normalized again to obtain a third intermediate feature segment image. At this time, the multilayer perceptron determines the weight of each segment in the third intermediate feature segment image to obtain a fourth intermediate feature segment image. The fourth intermediate feature segment image is then fused with the third intermediate feature segment image to obtain a first output image. This first input image is then used as a new input image and input to the next first first multi-head self-attention mechanism module. The first-layer normalization unit's step of normalizing the input image is executed again until a second coding image is output and input to the decoding layer.

[0092] The multi-head attention mechanism block operation logic may include: Let the input image be Z. l-1After layer normalization and multi-head self-attention mechanism, the output second intermediate feature block image is Z. l Z l After layer normalization and multilayer perceptron, the output image is Z. l+1 The above can be expressed by the following formula:

[0093] |Z l =MSA(LN(Z) l-1 )+Z l-1 ;

[0094] |Z l+1 =MLP(LN(Z) l ))+Z l ;

[0095] The formula for the self-attention mechanism in the multi-head self-attention mechanism is as follows: Here, Q, K, and V are three feature vectors that transform the input into three types of vectors, d is the dimension of Q divided by K, and B is the bias vector.

[0096] In this embodiment, the first multi-head self-attention mechanism module includes: a first-layer normalization unit, a multi-head self-attention mechanism unit, a second-layer normalization unit, and a multilayer perceptron unit. The first-layer normalization unit normalizes the input image. The multi-head self-attention mechanism unit increases the weight of the target region segments in the normalized image and decreases the weight of other region segments to obtain a first intermediate feature segment image. The intermediate feature segment image is then fused with the input image to obtain a second intermediate feature segment image. The second-layer normalization unit normalizes the second intermediate feature segment image to obtain a third intermediate feature segment image. The multilayer perceptron determines the weight of each segment in the third intermediate feature segment image to obtain a fourth intermediate feature segment image. The fourth intermediate feature segment image is then fused with the third intermediate feature segment image to obtain an output image. The segmentation neural network model, through the multi-head self-attention mechanism, can focus on the target feature region from a global perspective, thereby achieving more accurate segmentation.

[0097] The above embodiments have described the first multi-head self-attention mechanism module in the input layer. Now, an embodiment will be used to further describe the coding layer. In one embodiment, the coding layer in the segmented neural network model in the above embodiments includes: a block partitioning module, a linear embedding module, and at least one first augmented sampling module.

[0098] The slicing and partitioning module is used to slice the image to be segmented from at least two different modalities to obtain multiple first slice images;

[0099] The linear embedding module is used to linearly sort multiple first slice images to obtain a one-dimensional linear slice image;

[0100] The first enhancement sampling module is used to enhance the blocks of the target region in the one-dimensional linear block image to obtain the first enhanced block image, and then downsample the first enhanced block image to obtain the first encoded image.

[0101] Specifically, the patch partitioning module segments the image to be segmented into blocks of different modalities according to the formula N = (W*H) / (P*P), where W and H represent the width and length of the image to be segmented, respectively, P represents the width and length of the segmented image block, and N is the number of blocks. The linear embedding module segments N P×P image blocks and arranges them in sequence to obtain a one-dimensional linear patch image. The first enhancement sampling module enhances the blocks of the target region in the one-dimensional linear patch image by increasing the weight of the blocks of the target region to obtain a first enhanced patch image, and then downsamples the first enhanced patch image to obtain a first encoded image. The encoding layer may include at least one first enhancement sampling module. Preferably, the encoding layer includes three first enhancement sampling modules, which can perform three image enhancement processes and three downsampling processes. For example, the first enhancement sampling module can perform a first downsampling on the first enhanced block image with a resolution of 1024*1024 to obtain a first enhanced block image with a resolution of 512*512; the second enhancement sampling module can perform a second downsampling on the first enhanced block image with a resolution of 512*512 to obtain a first enhanced block image with a resolution of 256*256; and the third enhancement sampling module can perform a second downsampling on the first enhanced block image with a resolution of 256*256 to obtain a first enhanced block image with a resolution of 128*128.

[0102] Furthermore, in one embodiment, the first enhanced sampling module includes: at least one second multi-head self-attention mechanism module and a downsampling submodule;

[0103] The second multi-head self-attention mechanism module is used to enhance the blocks of the target part in the one-dimensional linear block image to obtain the enhanced block image, and then fuse the enhanced block image with the one-dimensional linear block image to obtain the first enhanced block image.

[0104] The downsampling submodule is used to downsample the first enhanced block image to obtain an enhanced sampled block image.

[0105] Specifically, the second multi-head self-attention mechanism module enhances the target region's segments in the linearly sorted one-dimensional linear segmented image by adding weights. The weights of the target segments in the linear segmented image are increased to obtain an enhanced segmented image. This enhanced segmented image is then fused with the one-dimensional linear segmented image to obtain the first segmented image. After obtaining the first segmented image, a downsampling submodule is used to downsample the first enhanced segmented image to obtain an enhanced sampled segmented image. For example, downsampling the first enhanced segmented image with a resolution of 1024*1024 yields a first enhanced segmented image with a resolution of 512*512. The internal structure of the second multi-head self-attention mechanism module is the same as that of the first multi-head self-attention mechanism module in the input layer, and the principle is the same; therefore, it will not be described again here.

[0106] Optionally, it may include at least one second multi-head self-attention mechanism module.

[0107] In this embodiment, the encoding layer includes a segmentation module, a linear embedding module, and at least one first enhancement sampling module. The segmentation module is used to segment the image to be segmented from at least two different modalities to obtain multiple first segmented images. The linear embedding module is used to linearly sort the multiple first segmented images to obtain a one-dimensional linear segmented image. The first enhancement sampling module is used to enhance the segments of the target region in the one-dimensional linear segmented image to obtain a first enhanced segmented image, and then downsamples the first enhanced segmented image to obtain a first encoded image. The encoding layer can perform downsampling operations, adjust the number of channels, and reduce the resolution, thereby realizing a hierarchical design. It also reduces the amount of computation to a certain extent and strengthens the weight of the target feature region to achieve more accurate segmentation of the target feature.

[0108] The above embodiments have described the encoding layer and the input layer. Now, the decoding layer will be described with reference to one embodiment. In one embodiment, the decoding layer includes at least one second enhanced sampling module, a block embedding module, and a linear projection module.

[0109] The second enhancement sampling module is used to upsample the second coded block image to obtain an upsampled block image, and to enhance the target part in the upsampled block image to obtain a second enhanced block image.

[0110] The segmentation and embedding module is used to restore the second enhanced segmented image to obtain the restored segmented image;

[0111] The linear projection module is used to perform linear transformations on the restored segmented image to obtain a hemispherical segmentation result image.

[0112] Specifically, the second enhancement sampling module upsamples the second coded block image output from the input layer to obtain an upsampled block image. The image resolution is then restored, and the weights of the target regions in the upsampled block image are increased to achieve enhancement processing, resulting in a second enhanced block image. At this point, the second enhanced block image is still a linearly arranged block image. The patch embedding module restores the linearly arranged second enhanced block image to obtain a restored block image. The linear projection module performs a linear transformation on the restored block image to obtain a hemispherical segmentation result image. The number of second enhancement modules in the decoding layer is the same as the number of first enhancement modules in the coding layer.

[0113] In this embodiment, the decoding layer includes at least one second enhancement sampling module, a block embedding module, and a linear projection module. The second enhancement sampling module is used to upsample the second coded block image to obtain an upsampled block image, and to enhance the target part in the upsampled block image to obtain a second enhanced block image. The block embedding module is used to restore the second enhanced block image to obtain a restored block image. The linear projection module is used to linearly transform the restored block image to obtain a hemispherical segmentation result image, which can restore the blocks after slicing and downsampling in the coding layer.

[0114] The above embodiments describe the decoding layer, which includes a second enhanced sampling module. The second enhanced sampling module is further described in one embodiment. In one embodiment, the second enhanced sampling module includes: at least one third multi-head self-attention mechanism module and an upsampling submodule.

[0115] The upsampling submodule is used to upsample the second encoded block image to obtain an upsampled block image;

[0116] The third multi-head self-attention mechanism module is used to enhance the target area in the upsampled image slice, and then fuse the upsampled slice image and the enhanced slice image to obtain the second enhanced slice image.

[0117] Specifically, the upsampling submodule upsamples the second encoded block image to obtain an upsampled block image; the third multi-head self-attention mechanism module adds weights to the target region blocks in the upsampled image blocks to achieve enhancement processing, and then fuses the upsampled block image and the enhanced block image to obtain the second enhanced block image. The number of upsampling submodules is the same as the number of downsampling submodules in the encoding layer, to achieve the restoration of the upsampled image after downsampling. The third multi-head self-attention mechanism module is used to enhance the target region blocks in the upsampled image blocks and fuse the upsampled block image and the enhanced block image to obtain the second enhanced block image.

[0118] Optionally, it may include at least one third multi-head self-attention mechanism module.

[0119] Optionally, in one embodiment, such as Figure 4 As shown, the first boost sampling module in the encoding layer and the corresponding second boost sampling module in the decoding layer of the above-mentioned segmentation neural network model are skip-connected; the image segmentation method also includes:

[0120] S402, the first enhanced sampling module transmits the first enhanced block image to the second enhanced sampling module;

[0121] S404, the second enhancement sampling module is used to fuse the first enhanced block image, the upsampled block image and the enhanced block image to obtain the second enhanced block image.

[0122] Specifically, the second multi-head self-attention mechanism module in the first enhancement sampling module and the third multi-head self-attention mechanism module in the corresponding second enhancement sampling module in the decoding layer are connected in a skip connection. The second multi-head self-attention mechanism module transmits the first enhanced block image to the third multi-head self-attention mechanism module. The third multi-head self-attention mechanism module fuses the first enhanced block image, the upsampled block image and the enhanced block image to obtain the second enhanced block image.

[0123] In this embodiment, the second enhancement sampling module includes at least one third multi-head self-attention mechanism module and an upsampling submodule. The upsampling submodule is used to upsample the second encoded block image to obtain an upsampled block image. The third multi-head self-attention mechanism module is used to enhance the blocks of the target region in the upsampled image blocks and fuse the upsampled block image and the enhanced block image to obtain the second enhanced block image. This can increase the weight of the target region to improve the accuracy of target region segmentation and restore resolution. Furthermore, if the first enhancement sampling module and the corresponding second enhancement sampling module in the decoding layer are skipped, the loss of image information can be reduced.

[0124] The above embodiments illustrate the segmentation neural network model. After segmenting the image to be segmented using this model, a hemispherical segmentation result image can be obtained. Based on the hemispherical segmentation result image, the method for determining the cerebrospinal fluid segmentation image and the skull segmentation image is explained. In one embodiment, determining the cerebrospinal fluid segmentation image of the brain perfusion image based on the hemispherical segmentation result image includes:

[0125] The region corresponding to the target pixel value in the hemispherical segmentation result image is obtained and identified as the cerebrospinal fluid segmentation image of the brain perfusion image.

[0126] Specifically, since the acquired hemispherical segmentation result image contains the pixel values ​​of each pixel, the region corresponding to the preset target pixel value can be identified as the cerebrospinal fluid region. Only the cerebrospinal fluid region can be displayed, resulting in a cerebrospinal fluid segmentation image of the brain perfusion. When displaying the cerebrospinal fluid region, the pixel values ​​of other brain parenchyma regions can be set to background pixel values, thus displaying only the cerebrospinal fluid region.

[0127] Furthermore, in one embodiment, such as Figure 5 As shown, the skull segmentation image for determining the brain perfusion image is determined based on the hemispherical segmentation result image and the brain perfusion image, including:

[0128] S502, replace the pixel values ​​of the cerebrospinal fluid segmentation area with the pixel values ​​of other display areas to obtain a brain parenchyma image;

[0129] S504, Based on brain parenchyma images, determine the brain parenchyma regions in the brain perfusion map;

[0130] S506, replace the pixel values ​​of the brain parenchyma region in the brain perfusion map with preset pixel values ​​to obtain a skull segmentation image.

[0131] Specifically, this can be achieved by first replacing the pixel values ​​of the cerebrospinal fluid region in the hemispherical segmentation image with pixel values ​​of the brain parenchyma region other than the cerebrospinal fluid region. Then, the processed hemispherical segmentation image displaying the brain parenchyma region is compared with a brain perfusion image to determine the brain parenchyma region in the brain perfusion image. The pixel values ​​of the brain parenchyma region in the brain perfusion image are then set to preset background pixel values, thus highlighting the skull region and obtaining a skull segmentation image from the brain perfusion image. For example, in the hemispherical segmentation image, the background pixel value is 0, the cerebrospinal fluid region pixel value is 1, and the pixel values ​​of other regions besides the cerebrospinal fluid region are 2. In this case, the pixel values ​​of the cerebrospinal fluid region can be replaced with 2. Since the brain parenchyma region includes the cerebrospinal fluid region, the hemispherical segmentation image at this point only displays the brain parenchyma region, with a pixel value of 2 for the brain parenchyma region and a background pixel value of 0. At this point, by comparing the hemispherical segmentation result image with the brain perfusion image, the corresponding region in the brain perfusion image can be directly determined. Then, the pixel value of the brain parenchyma region in the brain perfusion image can be set as the background pixel value, and the skull region in the brain perfusion image can be displayed, thus obtaining the skull segmentation image.

[0132] In this embodiment, a mask for a skull segmentation image is obtained by inverting the pixel values ​​of the mask image of the cerebrospinal fluid segmentation image and setting the pixel values ​​of the brain region to preset pixel values. This method is simple and effective and can obtain a mask image of the skull segmentation image.

[0133] The above embodiments illustrate an image segmentation method. This method requires the use of a pre-defined segmentation neural network model for segmentation. An embodiment will now be used to illustrate how to train this segmentation neural network model. In one embodiment, such as... Figure 6 As shown, the construction process of a segmentation neural network includes:

[0134] S602, acquire multiple brain perfusion images of samples and corresponding sample hemisphere segmentation result images;

[0135] S604, Input the sample brain perfusion image into the initial neural network model to segment the cerebrospinal fluid segmentation image and obtain the first hemisphere segmentation result image;

[0136] S606, Based on the loss values ​​of the first hemisphere segmentation result image and the sample hemisphere segmentation result image, adjust the parameters of the initial neural network model until the preset convergence condition is met, and obtain the segmentation neural network model.

[0137] Specifically, using common medical image annotation tools, multiple brain perfusion images can be labeled. The brain parenchyma is labeled as label1, the ventricle-related areas of CSF in cerebrospinal fluid are labeled as label2, and areas such as cisterns are labeled as label3, thus obtaining the gold standard image. Corresponding hemispherical segmentation results images are then obtained. Different modalities of the brain perfusion images are distinguished, resulting in different modalities of brain perfusion images. These different modalities are input into an initial neural network model for normalization and appropriate probability-based cropping, flipping, and other enhancement operations. Three-dimensional images with different modalities (i.e., different window widths and levels) are input into the network model at a preset specification for hemispherical image segmentation, resulting in the first hemispherical segmentation result image. For example, the preset specification is 192×192×32. The loss values ​​of the first hemispherical segmentation result image and the sample hemispherical segmentation result images are used to adjust the parameters of the initial neural network model until the preset convergence condition, i.e., the gold standard, is reached, resulting in the segmentation neural network model. The aforementioned label1-label2 is the gold standard for the model. The learning function for constructing a V-shaped self-attention mechanism network can include DoubleLoss, which is implemented as follows: DoubleLoss = FocalLoss + MultiDiceLoss. The formula for FocalLoss is as follows: Where α and γ are constants, usually set to 0.25 and 2, respectively. This represents the model's predicted value. The MultiDiceLoss formula is as follows: in, y is the model's predicted value. t As the gold standard, W i For each segmentation category, MultiDiceLoss assigns different weights to each category based on its learning difficulty. Optionally, a combination of Adam and weight decay can be used to train the model. Adam automatically adjusts the learning rate based on the model's learning progress, while weight decay is applied when the model iterates to a certain extent, primarily to prevent overfitting and provide a degree of regularization. An early stopping mechanism is also included, stopping model training when the learning function decreases to a point where it can no longer decrease.

[0138] In this embodiment, multiple sample brain perfusion images and corresponding sample hemispheric segmentation result images are acquired. The sample brain perfusion images are input into an initial neural network model to segment the cerebrospinal fluid image, obtaining a first hemispheric segmentation result image. Based on the loss values ​​of the first hemispheric segmentation result image and the sample hemispheric segmentation result images, the parameters of the initial neural network model are adjusted until a preset convergence condition is reached, resulting in a segmentation neural network model. This allows for the acquisition of a preset segmentation neural network model to segment the image to be segmented, obtaining cerebrospinal fluid segmentation images and skull segmentation images.

[0139] To facilitate understanding by those skilled in the art, the image segmentation method is further described below with reference to an embodiment. In one embodiment, such as... Figure 7 As shown, the image segmentation method includes:

[0140] S701, acquire multiple brain perfusion images of samples and corresponding sample hemisphere segmentation result images.

[0141] S702, the sample brain perfusion image is input into the initial neural network model to segment the hemispherical image, and the first hemispherical segmentation result image is obtained.

[0142] S703, based on the loss values ​​of the first hemisphere segmentation result image and the sample hemisphere segmentation result image, adjust the parameters of the initial neural network model until the preset convergence condition is met, and obtain the segmentation neural network model.

[0143] S704, acquire at least two different modalities of images to be segmented based on brain perfusion images.

[0144] S705, at least two different modalities of the images to be segmented are input into a preset segmentation neural network model to obtain a hemispherical segmentation result image; the segmentation neural network model is a V-shaped self-attention mechanism network model.

[0145] S706, Obtain the region corresponding to the target pixel value in the hemispherical segmentation result image and determine it as the cerebrospinal fluid segmentation image of the brain perfusion image.

[0146] S707, replace the pixel values ​​of the cerebrospinal fluid segmentation area with the pixel values ​​of other display areas to obtain a brain parenchyma image.

[0147] S708, Based on brain parenchyma images, determine the brain parenchyma regions in the brain perfusion map.

[0148] S709, replace the pixel values ​​of the brain parenchyma region in the brain perfusion map with preset pixel values ​​to obtain a skull segmentation image.

[0149] Specifically, the specific limitations of this image segmentation method are detailed in the above-mentioned limitations of image segmentation methods, and will not be repeated here. The structure of the segmentation application network model involved in this image segmentation method can be as follows: Figure 7-a As shown, the segmentation application network model includes an encoding layer 71, an input layer 72, and a decoding layer 73. The input layer 72 includes three first multi-head self-attention mechanism modules 721. Each first multi-head self-attention mechanism module 721 includes a first-layer normalization unit 7211, a multi-head self-attention mechanism unit 7212, a second-layer normalization unit 7213, and a multilayer perceptron unit 7214. The encoding layer 71 includes a block partitioning module 711, a linear embedding module 712, and three first enhanced sampling modules 713. Each first enhanced sampling module 713 includes a second multi-head self-attention mechanism module 7131 and a downsampling submodule 7132. The decoding layer 73 includes three second enhanced sampling modules 731, a block embedding module 732, and a linear projection module 733. Each second enhanced sampling module 731 includes a third multi-head self-attention mechanism module 7311 and an upsampling submodule 7312. The first enhanced sampling modules in the encoding layer and the corresponding second enhanced sampling modules in the decoding layer are connected in a skip connection.

[0150] The slicing and partitioning module is used to slice the image to be segmented from at least two different modalities to obtain multiple first slice images;

[0151] The linear embedding module is used to linearly sort multiple first slice images to obtain a one-dimensional linear slice image;

[0152] The second multi-head self-attention mechanism module is used to enhance the blocks of the target part in the one-dimensional linear block image to obtain the enhanced block image, and then fuse the enhanced block image with the one-dimensional linear block image to obtain the first enhanced block image.

[0153] The downsampling submodule is used to downsample the first enhanced block image to obtain an enhanced sampled block image.

[0154] The first normalization unit is used to normalize the input image;

[0155] The multi-head self-attention mechanism unit is used to increase the weight of the target region in the normalized image and decrease the weight of the other regions to obtain the first intermediate feature block image. The intermediate feature block image is then fused with the input image to obtain the second intermediate feature block image.

[0156] The second normalization unit is used to normalize the second intermediate feature block image to obtain the third intermediate feature block image;

[0157] A multilayer perceptron is used to determine the weights of each block in the third intermediate feature block image to obtain the fourth intermediate feature block image. The fourth intermediate feature block image is then fused with the third intermediate feature block image to obtain the output image.

[0158] The upsampling submodule is used to upsample the second encoded block image to obtain an upsampled block image;

[0159] The third multi-head self-attention mechanism module is used to enhance the target area in the upsampled image slices, and to fuse the upsampled slice image and the enhanced slice image. The second enhanced slice image is obtained by fusing the first enhanced slice image, the upsampled slice image and the enhanced slice image.

[0160] The segmentation and embedding module is used to restore the second enhanced segmented image to obtain the restored segmented image;

[0161] The linear projection module is used to perform linear transformations on the restored segmented image to obtain a hemispherical segmentation result image.

[0162] For specific limitations on the preset segmentation neural network, please refer to the specific limitations on the segmentation neural network model in the above image segmentation method, which will not be repeated here.

[0163] In this embodiment, at least two different modalities of images to be segmented are obtained based on brain perfusion images. These images are then input into a preset V-shaped self-attention mechanism network model to obtain a cerebrospinal fluid (CSF) segmentation image of the brain perfusion image. Based on the CSF segmentation image, a skull segmentation image of the brain perfusion image is determined. This allows the preset segmentation neural network model to segment the brain perfusion image to obtain both the CSF and skull segmentation images, enabling subsequent differentiation of infarct regions, CSF sites, and skull sites within the brain perfusion image, thereby accurately calculating the volume of the core infarct and abnormal perfusion areas. Furthermore, since the segmentation neural network model includes an encoding layer, an input layer including at least one multi-head self-attention mechanism module, and a decoding layer, it can segment images of different modalities. Moreover, the neural network model can quickly and accurately distinguish the locations of CSF and skull.

[0164] It should be understood that, although Figure 2-7 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-7At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0165] The above embodiments have described the image segmentation method. Now, an image segmentation apparatus will be further described using an embodiment. In one embodiment, such as... Figure 8 As shown, an image segmentation apparatus is provided, comprising:

[0166] The acquisition module 801 is used to acquire at least two different modalities of images to be segmented based on brain perfusion images;

[0167] The segmentation module 802 is used to input at least two different modalities of the image to be segmented into a preset segmentation neural network model to obtain a hemispherical segmentation result image; the segmentation neural network model is a V-shaped self-attention mechanism network model;

[0168] The first determining module 803 is used to determine the cerebrospinal fluid segmentation image of the brain perfusion image based on the hemispherical segmentation result image;

[0169] The second determining module 804 is used to determine the skull segmentation image of the brain perfusion image based on the hemispherical segmentation result image and the brain perfusion image.

[0170] In this embodiment, the acquisition module acquires at least two different modalities of images to be segmented based on the brain perfusion image; the segmentation module inputs the at least two different modalities of images to be segmented into a preset V-shaped self-attention mechanism network model to obtain a hemispherical segmentation result image of the brain perfusion image; the first determination module determines the cerebrospinal fluid segmentation image of the brain perfusion image based on the hemispherical segmentation result image; the second determination module determines the skull segmentation image of the brain perfusion image based on the hemispherical segmentation result image and the brain perfusion image. This allows the preset segmentation neural network model to segment the brain perfusion image to be segmented, obtaining cerebrospinal fluid segmentation images and skull segmentation images, so as to subsequently distinguish the infarct area and cerebrospinal fluid and skull areas in the brain perfusion image, thereby accurately calculating the volume of the core infarct and abnormal perfusion area. Meanwhile, the V-shaped self-attention mechanism network in this scheme is a dual-channel multimodal structure that can simultaneously input images of different modalities and output segmentation results of different parts at the same time. This scheme segments the image into several non-overlapping image blocks and inputs them into the multi-head self-attention mechanism in the form of a sequence, which can improve the model's ability to learn contextual semantic information.

[0171] In one embodiment, the segmentation neural network model includes: an encoding layer, an input layer, and a decoding layer; the input layer includes at least one first multi-head self-attention mechanism module.

[0172] The segmentation module uses an encoding layer to perform target region enhancement and downsampling processing on at least two different modalities of the image to be segmented, to obtain a first encoded image;

[0173] The segmentation module uses the input layer to enhance the target region of the first encoded image to obtain the second encoded image;

[0174] The segmentation module uses a decoding layer to upsample and enhance the target area of ​​the second encoded image to obtain a cerebrospinal fluid segmentation image of the brain perfusion image.

[0175] In one embodiment, the first multi-head self-attention mechanism module includes: a first-layer normalization unit, a multi-head self-attention mechanism unit, a second-layer normalization unit, and a multilayer perceptron unit.

[0176] The segmentation module uses a first-layer normalization unit to normalize the input image;

[0177] The segmentation module uses a multi-head self-attention mechanism unit to increase the weight of the target region in the normalized image and decrease the weight of the other regions to obtain the first intermediate feature segment image. The intermediate feature segment image is then fused with the input image to obtain the second intermediate feature segment image.

[0178] The segmentation module uses a second-layer normalization unit to normalize the second intermediate feature block image to obtain the third intermediate feature block image.

[0179] The segmentation module uses a multilayer perceptron to determine the weights of each segment in the third intermediate feature segment image, obtains the fourth intermediate feature segment image, and then fuses the fourth intermediate feature segment image with the third intermediate feature segment image to obtain the output image.

[0180] In one embodiment, the coding layer includes a block partitioning module, a linear embedding module, and at least one first enhanced sampling module;

[0181] The segmentation module, through the block partitioning module, is used to segment the image to be segmented from at least two different modalities, to obtain multiple first block images;

[0182] The segmentation module uses a linear embedding module to linearly sort multiple first slice images to obtain a one-dimensional linear slice image.

[0183] The segmentation module uses a first enhancement sampling module to enhance the blocks of the target region in the one-dimensional linear block image to obtain a first enhanced block image, and then downsamples the first enhanced block image to obtain a first encoded image.

[0184] In one embodiment, the first enhanced sampling module includes: at least one second multi-head self-attention mechanism module and a downsampling submodule;

[0185] The segmentation module uses a second multi-head self-attention mechanism module to enhance the blocks of the target region in the one-dimensional linear block image to obtain an enhanced block image. The enhanced block image is then fused with the one-dimensional linear block image to obtain the first enhanced block image.

[0186] The segmentation module uses a downsampling submodule to downsample the first enhanced segment image to obtain an enhanced sampled segment image.

[0187] In one embodiment, the decoding layer includes at least one second enhanced sampling module, a block embedding module, and a linear projection module;

[0188] The segmentation module, through the second enhancement sampling module, upsamples the second coded segment image to obtain an upsampled segment image, and enhances the target part in the upsampled segment image to obtain a second enhanced segment image;

[0189] The segmentation module, through the block embedding module, is used to restore the second enhanced block image to obtain the restored block image;

[0190] The segmentation module uses a linear projection module to perform linear transformations on the restored segmented image to obtain a hemispherical segmentation result image.

[0191] In one embodiment, the second enhanced sampling module includes: at least one third multi-head self-attention mechanism module and an upsampling submodule;

[0192] The segmentation module uses an upsampling submodule to upsample the second encoded block image to obtain an upsampled block image.

[0193] The segmentation module uses a third multi-head self-attention mechanism module to enhance the target area segments in the upsampled image segments, and then fuses the upsampled segment image and the enhanced segment image to obtain the second enhanced segment image.

[0194] In one embodiment, the first enhanced sampling module and the corresponding second enhanced sampling module are connected in a skip connection; the image segmentation device further includes:

[0195] The transmission module is used to transmit the first enhanced segmented image to the second enhanced sampling module through the first enhanced sampling module;

[0196] The fusion module is used to fuse the first enhanced block image, the upsampled block image, and the enhanced block image through the second enhanced sampling module to obtain the second enhanced block image.

[0197] In one embodiment, the first determining module is specifically used to obtain the region corresponding to the target pixel value in the hemispherical segmentation result image and determine it as a cerebrospinal fluid segmentation image of the brain perfusion image.

[0198] The second determining module is specifically used to replace the pixel values ​​of the cerebrospinal fluid segmentation area with the pixel values ​​of other display areas to obtain a brain parenchyma image; determine the brain parenchyma region of the brain perfusion map based on the brain parenchyma image; and replace the pixel values ​​of the brain parenchyma region of the brain perfusion map with preset pixel values ​​to obtain a skull segmentation image.

[0199] In one embodiment, the image segmentation apparatus further includes:

[0200] The sample acquisition module is used to acquire multiple brain perfusion images of samples and corresponding hemispheric segmentation result images of the samples;

[0201] The initial segmentation module is used to input the sample brain perfusion image into the initial neural network model to segment the cerebrospinal fluid segmentation image and obtain the first hemisphere segmentation result image;

[0202] The adjustment module is used to adjust the parameters of the initial neural network model based on the loss values ​​of the first hemisphere segmentation result image and the sample hemisphere segmentation result image until the preset convergence condition is reached, thus obtaining the segmentation neural network model.

[0203] For specific limitations regarding the image segmentation apparatus, please refer to the limitations on the image segmentation method above, which will not be repeated here. Each module in the aforementioned image segmentation apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0204] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements an image segmentation method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0205] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0206] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0207] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0208] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0209] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0210] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An image segmentation method characterized by, The method comprises: Different modalities are set for a brain perfusion image to obtain at least two different modalities of to-be-segmented images; The at least two different modalities of to-be-segmented images are input into a preset segmentation neural network model to obtain a hemispheric segmentation result image of the brain perfusion image; the segmentation neural network model is a multi-channel V-shaped self-attention mechanism network model; the number of channels is the same as the number of modalities, wherein the different modalities of to-be-segmented images are obtained by using different window widths and window levels, a brain parenchyma part is displayed in the hemispheric segmentation result image, the brain parenchyma part includes a cerebrospinal fluid part and other related parts, the cerebrospinal fluid part is displayed by a first pixel value and is marked in the hemispheric segmentation result image, and the other related parts are displayed by a second pixel value and are marked; A region corresponding to a preset target pixel value in each pixel value of the hemispheric segmentation result image is displayed in the brain perfusion image to obtain a cerebrospinal fluid segmentation image of the brain perfusion image; A skull segmentation image of the brain perfusion image is determined according to the hemispheric segmentation result image and the brain perfusion image.

2. The method of claim 1, wherein, The segmentation neural network model comprises an encoding layer, an input layer and a decoding layer; the input layer comprises at least one first multi-head self-attention mechanism module; The encoding layer is configured to perform target part enhancement processing and down-sampling processing on the at least two different modalities of to-be-segmented images to obtain a first encoding image; The input layer is configured to perform enhancement processing on a target part of the first encoding image to obtain a second encoding image; The decoding layer is configured to perform up-sampling processing and target part enhancement processing on the second encoding image to obtain the hemispheric segmentation result image of the brain perfusion image.

3. The method of claim 2, wherein, The first multi-head self-attention mechanism module comprises a first layer normalization unit, a multi-head self-attention mechanism unit, a second layer normalization unit and a multi-layer perception unit; The first layer normalization unit is configured to perform normalization processing on an input image; The multi-head self-attention mechanism unit is configured to increase the weight of a target part patch in the normalized image and reduce the weight of other patches to obtain a first intermediate feature patch image, and fuse the intermediate feature patch image with the input image to obtain a second intermediate feature patch image; The second layer normalization unit is configured to perform normalization processing on the second intermediate feature patch image to obtain a third intermediate feature patch image; The multi-layer perception unit is configured to determine the weight of each patch in the third intermediate feature patch image to obtain a fourth intermediate feature patch image, and fuse the fourth intermediate feature patch image with the third intermediate feature patch image to obtain an output image.

4. The method of claim 2, wherein, The encoding layer comprises a patch partition module, a linear embedding module and at least one first enhancement sampling module; the decoding layer comprises at least one second enhancement sampling module, a patch embedding module and a linear projection module; The patch partition module is configured to partition the at least two different modalities of to-be-segmented images to obtain a plurality of first patch images; The linear embedding module is configured to linearly sort a plurality of the first patch images to obtain one-dimensional linear patch images. The first enhancement sampling module is configured to perform enhancement processing on the patch of the target part in the one-dimensional linear patch image to obtain a first enhanced patch image, and to perform down-sampling on the first enhanced patch image to obtain the first encoded image. The second enhancement sampling module is configured to perform up-sampling on the second encoded patch image to obtain an up-sampled patch image, and to perform enhancement processing on the target part in the up-sampled patch image to obtain a second enhanced patch image. The patch embedding module is configured to restore the second enhanced patch image to obtain a restored patch image. The linear projection module is configured to perform linear transformation on the restored patch image to obtain the hemispheric segmentation result image.

5. The method of claim 4, wherein, The first enhancement sampling module comprises at least one second multi-head self-attention mechanism module and a down-sampling module. The second multi-head self-attention mechanism module is configured to perform enhancement processing on the patch of the target part in the one-dimensional linear patch image to obtain an enhanced patch image, and to fuse the enhanced patch image with the one-dimensional linear patch image to obtain the first enhanced patch image. The down-sampling module is configured to perform down-sampling on the first enhanced patch image to obtain an enhanced sampling patch image. The up-sampling module is configured to perform up-sampling on the second encoded patch image to obtain the up-sampled patch image. The third multi-head self-attention mechanism module is configured to perform enhancement processing on the patch of the target part in the up-sampled patch image, and to fuse the up-sampled patch image with the enhanced patch image to obtain the second enhanced patch image.

6. The method of claim 1, wherein, The cerebrospinal fluid segmentation image of the brain perfusion image is determined according to the hemispheric segmentation result image, which comprises: An area corresponding to a target pixel value in the hemispheric segmentation result image is obtained, and is determined as the cerebrospinal fluid segmentation image of the brain perfusion image.

7. The method of claim 6, wherein, The skull segmentation image of the brain perfusion image is determined according to the hemispheric segmentation result image and the brain perfusion image, which comprises: A pixel value of the cerebrospinal fluid segmentation area is replaced with a pixel value of another display area to obtain a brain parenchyma image. A brain parenchyma area of the brain perfusion image is determined according to the brain parenchyma image. A pixel value of the brain parenchyma area of the brain perfusion image is replaced with a preset pixel value to obtain the skull segmentation image.

8. The method of claim 1, wherein, The construction process of the segmentation neural network model comprises: A plurality of sample brain perfusion images and corresponding sample hemispheric segmentation result images are obtained. The sample brain perfusion images are input into an initial neural network model to perform hemispheric image segmentation to obtain first hemispheric segmentation result images. Parameters of the initial neural network model are adjusted according to a loss value of the first hemispheric segmentation result images and the sample hemispheric segmentation result images until a preset convergence condition is reached to obtain the segmentation neural network model.

9. An image segmentation apparatus characterized by comprising: The device comprises: An acquisition module is configured to set different modalities for a brain perfusion image, and acquire at least two different modality images to be segmented; A segmentation module is configured to input the at least two different modality images to be segmented into a preset segmentation neural network model, and obtain a hemispheric segmentation result image of the brain perfusion image; the segmentation neural network model is a multi-channel V-shaped self-attention mechanism network model; the number of channels is the same as the number of modalities, wherein the different modality images to be segmented are obtained by using different window widths and window levels; in the hemispheric segmentation result image, a brain parenchyma part is displayed, the brain parenchyma part includes a cerebrospinal fluid part and other related parts; in the hemispheric segmentation result image, the cerebrospinal fluid part is displayed and marked by using a first pixel value, and the other related parts are displayed and marked by using a second pixel value; A first determination module is configured to display a region corresponding to a preset target pixel value in each pixel value of the hemispheric segmentation result image in the brain perfusion image, and obtain a cerebrospinal fluid segmentation image of the brain perfusion image; A second determination module is configured to determine a skull segmentation image of the brain perfusion image according to the hemispheric segmentation result image and the brain perfusion image. 10.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-9. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 8.

11. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Medical image processing method and device, electronic device and storage medium

    CN109035261A

  • Improved convolutional neural network brain tumor image segmentation method based on attention mechanism

    CN110689543A

  • Generation method, application method and device of cerebrospinal fluid segmentation model

    CN112419340A

  • Method for, device for, and system for analazing brain image

    KR102313656B1