A method for intracranial hemorrhage lesion segmentation based on IHLS-Net
The IHLS-Net network solves the dependency and accuracy issues in intracranial hemorrhage CT image segmentation by introducing specific modules and loss function optimization, and achieves efficient lesion segmentation and bleeding volume calculation.
Patent Information
- Application Number
- CN202411481435.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-10-23
AI Technical Summary
Existing technologies have high dependency, low segmentation efficiency and poor accuracy in lesion segmentation of intracranial hemorrhage CT images, especially in the segmentation of subtypes other than intracerebral hemorrhage.
The IHLS-Net network architecture is adopted, combined with the parameterized linear rectification residual block module, the expanded spatial attention pyramid pooling module and the dynamic channel attention module. The accurate segmentation of the bleeding area is achieved through the combined optimization training of Dice loss and cross entropy loss.
It improves the accuracy and efficiency of intracranial hemorrhage lesion segmentation, can better capture multi-scale feature information, enhance the ability to understand complex scenes, and achieve accurate calculation of bleeding volume.
Smart Images

Figure CN119579616B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of AI medical image-assisted diagnosis and relates to a method for intracranial hemorrhage lesion segmentation based on IHLS-Net. Background Art
[0002] Intracranial hemorrhage is a serious neurological condition that can be caused by a variety of factors, including head trauma, hypertension, aneurysms, and thrombosis. Based on the location and shape of the bleeding, it is categorized into five subtypes: intracerebral hemorrhage, intraventricular hemorrhage, subarachnoid hemorrhage, epidural hemorrhage, and subdural hemorrhage. Intracranial hemorrhage can cause blood to accumulate around or within the brain tissue, increasing intracranial pressure and causing brain damage and compression. In severe cases, it can lead to movement disorders, speech dysfunction, impaired consciousness, coma, and even death. Rapid and accurate diagnosis of intracranial hemorrhage has become a major challenge in the medical field.
[0003] In current clinical practice, neuroradiologists need to manually outline the intracranial hemorrhage area and use the Tada formula to estimate the amount of bleeding. However, when there are multiple bleeding areas or the bleeding areas are irregular in shape, this estimation method may not provide accurate calculation results. With the development of artificial intelligence, computer-aided diagnosis has also begun to attract the attention of more researchers and scholars. The current neural network-based methods have poor fine-grained feature extraction and lesion edge segmentation capabilities due to the presence of imaging artifacts and noise in CT plain scan images and the high density of brain hemorrhage areas, especially in the segmentation of subtypes other than intracerebral hemorrhage. Therefore, an accurate and efficient automatic segmentation method for intracranial hemorrhage CT images is needed. Summary of the Invention
[0004] The present invention provides an intracranial hemorrhage lesion segmentation method based on IHLS-Net, which solves the problems of strong dependence on doctors, low segmentation efficiency and poor segmentation accuracy in intracranial hemorrhage CT image lesion segmentation.
[0005] In order to achieve the above object, the present invention provides the following technical solution: a method for intracranial hemorrhage lesion segmentation based on IHLS-Net, comprising the following steps:
[0006] Step 1: Collect the intracranial hemorrhage dataset and remove invalid data.
[0007] Step 2: Data preprocessing is performed on the acquired dataset, including adjusting the orientation matrix of the NIFTI format image to RAI, adjusting the window width and window position of the image using [15,85], [-15,200], [-100,1300], superimposing the number of channels, adjusting the pixel spacing, and performing random transformation on the image.
[0008] Step 3: Construct a parameterized linear rectifier residual block module, construct a 3×3×3 convolutional layer and a 1×1×1 convolutional layer, use the output of the previous stage as the input of the next stage, use the PReLU activation function instead of the ReLU activation function, and finally perform a residual connection between the input features and the output features.
[0009] X1=PReLU(Conv (3×3×3) (X))
[0010] X2=PReLU(Conv (3×3×3) (X1))
[0011] X3=PReLU(Conv (1×1×1) (X2))
[0012]
[0013] Among them, X represents the input feature, X1, X2, X3, Y represent the stage output features, Represents residual connection.
[0014] The PReLU activation function is:
[0015]
[0016] Where a is a learnable parameter that can be trained based on data.
[0017] Step 4: Construct an expanded spatial attention pyramid pooling module, use 4 expanded convolutions for serial connection, use the output of the previous stage as the input of the next stage, form a multi-scale pyramid structure, use the maximum pooling layer and the average pooling layer to process the input feature map, combine the features obtained by maximum pooling and average pooling, apply Sigmoid to map the features to the range of 0 to 1, and then multiply the new features with the input features.
[0018] X avg =AVGPool(X)
[0019] X max =MAXPool(X)
[0020]
[0021] Among them, X represents the input feature, AVGPool and MAXPool represent average pooling and maximum pooling, X avg represents the features obtained by average pooling, X max represents the features obtained by maximum pooling, Y represents the output features, Indicates the multiplication of corresponding elements, Indicates the addition of corresponding elements.
[0022] Step 5: Construct a dynamic channel attention module. First, use two large-kernel depth convolutions for parallel processing, concatenate the output features in the channel dimension, use average pooling and maximum pooling for processing, perform convolution and Sigmoid operations on the pooled features to obtain adaptive weights, and finally multiply the stage output features by the weights and add them to the input features.
[0023] X1=DWConv (5,5,5) (X)
[0024] X2=DWConv (7,7,7) (X)
[0025] X avg =AVGPool(X1;X2)
[0026] X max =MAXPool(X1;X2)
[0027] w1; w2 = Sigmoid(Conv (7×7×7) (X avg ;X max ))
[0028]
[0029] Where DWConv stands for depthwise convolution, and w1 and w2 stand for adaptive weights.
[0030] Step 6: Build the IHLS-Net network architecture, use PRB modules inside the network to replace the convolutions in the encoder and decoder, use the ASAPPB module as the bottom bottleneck to connect the encoder and decoder, and finally insert the DCAB module in the decoder.
[0031] Step 7: Construct DiceCELoss and combine the Dice loss function and the cross entropy loss function.
[0032]
[0033] Cross Entropy Loss=-Σ i y i log(p i )+(1-y i )log(1-p i )
[0034] Total Loss = λ dice ×Dice Loss+λ ce ×Cross Entropy Loss
[0035] Among them, Intersection represents the intersection of the predicted segmentation and the true segmentation, Union represents their union, ∈ is a small constant used to avoid the denominator being zero, y i represents the true label, p i represents the predicted probability, log represents the natural logarithm, and λ dice and λ ce It is the weight factor used to control Dice Loss and Cross Entropy Loss in the final loss.
[0036] Step 8: Visualize the segmentation results.
[0037] Step 9: Evaluate the performance of the model based on the prediction results.
[0038] Step 10: Calculate the amount of bleeding based on the bleeding area.
[0039] Compared with the prior art, the present invention has the following advantages:
[0040] 1. The present invention introduces a parameterized linear rectified residual block module to replace the simple convolution operation in the encoder and decoder, which effectively solves the gradient vanishing problem in neural network training, accelerates the convergence speed of the network, and improves the model's learning and generalization capabilities for complex features.
[0041] 2. The present invention uses the expanded spatial attention pyramid pooling module as the bottom bottleneck, which effectively solves the problem of multi-scale information acquisition, helps the network to more comprehensively perceive and capture feature information of different scales in the image, thereby improving the model's ability to understand and accuracy of complex scenes.
[0042] 3. The present invention adds a dynamic channel attention module to the decoder to solve the problem of information loss caused by different correlations between feature channels. By dynamically paying attention to the importance of different channels, the network's ability to restore details and recover structures is improved, and the model's attention to and utilization of important features is enhanced, thereby improving the accuracy and effect of the segmentation task.
[0043] 4. The present invention accurately quantifies the segmented bleeding area and calculates the amount of bleeding through pixel quantity statistics, thereby achieving accurate calculation of the amount of bleeding. This calculation method has practical application significance in medical image analysis and provides an effective and reliable way to accurately assess the bleeding situation. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a parameterized linear rectified residual module.
[0045] Figure 2 It is the expanded spatial attention pyramid pooling module.
[0046] Figure 3 It is a dynamic channel attention module.
[0047] Figure 4 This is the IHLS-Net network architecture.
[0048] Figure 5 For the segmentation effect.
[0049] Figure 6 For comparative test. DETAILED DESCRIPTION
[0050] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0051] The present invention provides an intracranial hemorrhage lesion segmentation method based on IHLS-Net, which specifically comprises the following steps:
[0052] Step 1: Obtain 3D intracranial hemorrhage CT plain scan images in NIFTI format.
[0053] The dataset used in this paper is the INSTANCE2022 public dataset, which contains 100 NIFTI format data of intracranial hemorrhage.
[0054] Step 2: Preprocess the data.
[0055] Specifically, step 2 includes the following:
[0056] Step 2-1: Adjust the orientation matrix of the NIFTI format image to RAI to match the relationship between the image data coordinate system and the real-world coordinate system.
[0057] RAI represents the image data coordinate system, where the image's X-axis points to the right, the Y-axis points forward, and the Z-axis points inward.
[0058] Step 2-2, adjust the window width and window level of the image.
[0059] The window level is the center position of the window, and the window width is the displayed HU value range. Use [15,85], [-15,200], and [-100,1300] to adjust the window width and window position of the image and construct three sets of images.
[0060] The first number represents the window level value, and the second number represents the window width value.
[0061] Step 2-3: superimpose the three adjusted images to form an RGB three-channel image.
[0062] In steps 2-4, adjust the pixel spacing and resample the pixels. Use [0.476, 0.476, 5.0] as the pixel spacing of the image and use bilinear interpolation as the interpolation mode.
[0063] The first number represents the X-axis pixel spacing, the second number represents the Y-axis pixel spacing, and the third number represents the Z-axis pixel spacing.
[0064] In steps 2-5, the image is randomly flipped, rotated, and offset, and the probability of the three random operations is set to 0.1.
[0065] Step 3: Construct a parameterized linear rectified residual block module.
[0066] Inspired by the residual block, this paper designs a parametric linear rectified residual module (PRB). After the 3×3×3 convolution layer, an activation function, dropout and normalization layer are added. The 3×3×3 convolution layer is repeated twice, and then a 1×1×1 convolution layer is passed. Finally, the input and the features obtained after convolution are residually connected. The module structure is as follows: Figure 1 shown.
[0067] The activation function uses the PReLU activation function instead of the ReLU activation function. In the traditional ReLU function, the negative part is truncated to zero, which may cause some neurons to never be activated during training, which is called the "neuron death" problem.
[0068] PReLU introduces a learnable parameter to control the slope of the negative part, so that the neuron can obtain gradient information throughout the training process. The mathematical representation of PReLU is as follows:
[0069]
[0070] Here, a is a learnable parameter that can be trained based on data. When a = 0, PReLU is equivalent to traditional ReLU. The introduction of PReLU can help accelerate model training, reduce the vanishing gradient problem, and in some cases improve model performance and generalization.
[0071] Step 4: Construct the expanded spatial attention pyramid pooling module. The module structure is as follows Figure 2 shown.
[0072] Based on spatial attention, the present invention designs an Atrous Spatial Attention Pyramid Pooling Block (ASAPPB).
[0073] Specifically, step 4 includes the following:
[0074] In step 4-1, we construct four dilated convolutions with different dilation rates to capture information at different scales. These are a 1×1×1 convolution layer and three 3×3×3 convolution layers with dilation rates of [0, 2, 4, 6]. After the convolution, we use the Leaky ReLU activation function and the normalization layer.
[0075] In step 4-2, we construct a spatial attention module and use the maximum pooling layer and the average pooling layer to process the input features. We combine the features obtained by the maximum pooling and the average pooling, apply the Sigmoid function to generate new features, and then multiply the new features with the input features. The formula is shown below.
[0076] X avg =AVGPool(X)
[0077] X max =MAXPool(X)
[0078]
[0079] Among them, X represents the input feature, AVGPool and MAXPool represent average pooling and maximum pooling, X avg represents the features obtained by average pooling, X max represents the features obtained by maximum pooling, Y represents the output features, Indicates the multiplication of corresponding elements, Indicates the addition of corresponding elements.
[0080] The formula for maximum pooling is as follows.
[0081]
[0082] where y kij Represents the rectangular area R related to the kth feature ij The maximum pooling output value, x kpq Represents the rectangular area R ij The element at (p,q) in .
[0083] The formula for average pooling is as follows.
[0084]
[0085] where y kij Represents the rectangular area R related to the kth feature ij The average pooling output value, x kpq Represents the rectangular area R ijThe element at (p,q) in |R ij | represents a rectangular area R ij The number of elements in .
[0086] The Sigmoid formula is as follows.
[0087]
[0088] In step 4-3, the output features of the four convolutional layers and the spatial attention features are concatenated in the channel dimension to obtain a feature map with richer contextual information.
[0089] In step 4-4, the features are finally passed through a 1×1×1 convolutional layer to map the concatenated features to the number of output channels.
[0090] Step 5: Construct a dynamic channel attention module. The module structure is as follows Figure 3 shown.
[0091] This paper proposes a Dynamic Channel Attention Block (DCAB), which uses a dynamic attention mechanism to adaptively highlight the most important spatial features based on global context information and uses large convolution kernels to capture multi-scale features.
[0092] Specifically, step 5 includes the following:
[0093] In step 5-1, first use two large kernel depth convolutions: 5×5×5 convolution and 7×7×7 convolution. The formula is as follows.
[0094] X1=DWConv (5,5,5) (X)
[0095] X2=DWConv (7,7,7) (X)
[0096] Where X is the input feature, X1 and X2 are the output features obtained by depthwise convolution, and DWConv stands for depthwise convolution.
[0097] In step 5-2, the features obtained by depthwise convolution are concatenated in the channel dimension, and the features are processed using average pooling and maximum pooling respectively. The formulas are shown below.
[0098] X avg =AVGPool(X1;X2)
[0099] X max =MAXPool(X1;X2)
[0100] Among them, X1; X2 represents the concatenation of X1 and X2 in a new dimension.
[0101] In step 5-3, the features obtained by average pooling and maximum pooling are merged, and then a large 7×7×7 convolution kernel is used for feature extraction. Finally, the output value is mapped to a range between 0 and 1 through the Sigmoid function. The formula is shown below.
[0102] w1; w2 = Sigmoid(Conv (7×7×7) (X avg ;X max ))
[0103] Where w1 and w2 represent dynamic weights.
[0104] In step 5-4, the weights are used to dynamically and adaptively select features and add them to the input. The formula is shown below.
[0105]
[0106] Step 6: Build the IHLS-Net network architecture, as shown in Figure 4 shown.
[0107] Specifically, step 6 includes the following content.
[0108] In step 6-1, an intracranial hemorrhage lesion segmentation network (IHLS-Net) consisting of an encoder and a decoder is designed. The number of feature channels is set to [32, 64, 96, 128, 192, 256]. Then, the convolutional layers in the traditional encoder and decoder are replaced with PRB modules, and skip connections are established between the encoder and decoder at different scales to speed up training and avoid gradient vanishing.
[0109] In step 6-2, the ASAPPB module is used as the bottom bottleneck to connect the encoder and decoder, effectively promoting information transfer and feature fusion.
[0110] In step 6-3, in the decoder, a DCAB module is inserted after each PRB module to reduce redundant information, enhance the perceptual range, and improve attention distribution.
[0111] Step 7: Construct the loss function.
[0112] Specifically, step 7 includes the following content.
[0113] Step 7-1, construct Dice Loss. Dice Loss is used to measure the similarity between the predicted segmentation and the true segmentation. The formula is as follows.
[0114]
[0115] Among them, Intersection represents the intersection of the predicted segmentation and the true segmentation, Union represents their union, and ∈ is a small constant used to avoid the denominator being zero.
[0116] Step 7-2, construct the cross entropy loss. The cross entropy loss calculates the difference between the output category probability and the true label. The formula is as follows.
[0117] Cross Entropy Loss=-∑ i y i log(p i )+(1-y i )log(1-p i )
[0118] Among them, y i represents the true label, p i represents the predicted probability, and log represents the natural logarithm.
[0119] Step 7-3, construct DiceCELoss, and combine Dice Loss and Cross Entropy Loss weightedly. The formula is as follows.
[0120] Total Loss = λ dice ×Dice Loss+λ ce ×Cross Entropy Loss
[0121] Among them, λ dice and λ ce It is the weight factor used to control Dice Loss and Cross Entropy Loss in the final loss.
[0122] Step 8: Visualize the segmentation effect, such as Figure 5 As shown, the left side represents the original image, the middle side represents the actual label, and the right side represents the segmentation result.
[0123] Step 9: Evaluate model performance.
[0124] The present invention uses Dice Similarity Coefficient (DSC), Hausdorff Distance (HD), Normalized Surface Dice (NSD), Jaccard Similarity Coefficient (Jaccard Similarity Coefficient), and Relative Volume Difference (RVD) as evaluation indicators.
[0125] The formula for the dice similarity coefficient is as follows.
[0126]
[0127] Among them, X and Y are two sets, |X| represents the number of elements in set X, and ∩ represents the intersection of the two sets, that is, the elements in common in the two sets.
[0128] The Hausdorff distance formula is shown below.
[0129] H(A,B)=max(h(A,B),h(B,A))
[0130]
[0131]
[0132] where a and b are points in sets A and B respectively, and ||ab|| is the Euclidean distance between these points.
[0133] The normalized surface dice formula is shown below.
[0134]
[0135] Among them, S pred Represents the set of boundary points for predicted segmentation, S gt The set of boundary points representing the true segmentation.
[0136] The Jaccard similarity coefficient formula is shown below.
[0137]
[0138] The relative volume difference formula is shown below.
[0139]
[0140] Among them, V pred is the volume of the predicted region segmentation, V gt is the volume of the real region segmentation.
[0141] like Figure 6 As shown in Figure 3, the experimental results show that the method proposed in this paper achieves excellent results in the intracranial hemorrhage segmentation task.
[0142] Step 10: Using the bleeding area obtained by segmentation, the number of pixels in the segmented area is counted and multiplied by the pixel volume to obtain the value of the bleeding amount. The formula is as follows.
[0143] V hemorrhage =N×V pixel
[0144] Among them, V hemorrhage represents the amount of bleeding, N represents the number of pixels in the bleeding area, V pixel Represents the volume of one pixel.
[0145] This paper is implemented in the PyTorch framework, using an NVIDIA RTX 3090 graphics card for GPU-accelerated training. The experimental data set used is the INSTANCE 2022 public dataset. During training, the image is sliced into 96×96×16 blocks to accelerate model training. The cache num is set to 8, and the AdamW optimizer is used with a learning rate of 1e-4, a weight decay of 1e-5, and a maximum number of training steps of 40,000.
Claims
1. A method for intracranial hemorrhage lesion segmentation based on IHLS-Net, Its characteristics include the following steps: Step 1: Collect the intracranial hemorrhage dataset and remove invalid data; Step 2: Data preprocessing is performed on the acquired dataset, including adjusting the orientation matrix of the NIFTI format image to RAI, adjusting the window width and window position of the image using [15,85], [-15,200], [-100,1300], performing channel stacking, adjusting the pixel spacing, and performing random transformation on the image; Step 3: Construct a parameterized linear rectified residual block module, construct a 3×3×3 convolutional layer and a 1×1×1 convolutional layer, use the output of the previous stage as the input of the next stage, use the PReLU activation function instead of the ReLU activation function, and finally perform a residual connection between the input features and the output features; Step 4: Construct an expanded spatial attention pyramid pooling module, using four expanded convolutions for serial connection. The output of the previous stage is used as the input of the next stage to form a multi-scale pyramid structure. The input feature map is processed using the maximum pooling layer and the average pooling layer. The feature maps obtained by the maximum pooling and average pooling are combined, and Sigmoid is applied to map the features to the range of 0 to 1. The new feature map is then multiplied with the input feature map. Step 5: Construct a dynamic channel attention module. First, use two large-kernel depthwise convolutions for parallel processing, concatenate the output features in the channel dimension, use average pooling and maximum pooling for processing, perform convolution and Sigmoid operations on the pooled features to obtain adaptive weights, and finally multiply the stage output features by the weights and add them to the input features. Step 6: Build the IHLS-Net network architecture, use PRB modules to replace the convolution in the encoder and decoder, use the ASAPPB module as the bottom bottleneck to connect the encoder and decoder, and finally insert the DCAB module in the decoder; Step 7: Construct DiceCELoss and combine the Dice loss function and the cross entropy loss function; Step 8: Visualize the segmentation results; Step 9: Evaluate the performance of the model based on the prediction results; Step 10: Calculate the amount of bleeding based on the bleeding area.
2. The intracranial hemorrhage lesion segmentation method based on IHLS-Net according to claim 1, characterized in that The parameterized linear rectification residual block formula in step 3 is as follows: X1=PReLU(Conv. (3×3×3) (X)) X2=PReLU(Conv (3×3×3) (X1)) X3=PReLU(Conv (1×1×1) (X2)) Among them, X represents the input feature, X1, X2, X3, Y represent the stage output features, Represents residual connection, Conv represents convolution operation; The PReLU activation function is: Where a is a learnable parameter that can be trained based on data.
3. The intracranial hemorrhage lesion segmentation method based on IHLS-Net according to claim 1, characterized in that The formula for the expanded spatial attention pyramid pooling module in step 4 is as follows: X avg =AVGPool(X) X max =MAXPool(X) Among them, X represents the input feature, AVGPool and MAXPool represent average pooling and maximum pooling, X avg represents the features obtained by average pooling, X max represents the features obtained by maximum pooling, Y represents the output features, Indicates the multiplication of corresponding elements, Indicates the addition of corresponding elements, and Sigmoid represents the activation function.
4. The intracranial hemorrhage lesion segmentation method based on IHLS-Net according to claim 1, characterized in that The formula of the dynamic channel attention module in step 5 is as follows: X1=DWConv (5,5,5) (X) X2=DWConv (7,7,7) (X) X avg =AVGPool(X1;X2) X max =MAXPool(X1;X2) w1;w2=Sigmoid(Conv (7×7×7) (X avg ;X max )) Where DWConv stands for depthwise convolution, w1, w2 stand for adaptive weights, X stands for input features, X1, X2 stand for stage output features, AVGPool and MAXPool stand for average pooling and maximum pooling, X avg represents the features obtained by average pooling, X max represents the features obtained by maximum pooling, Y represents the output features, Indicates the multiplication of corresponding elements, Indicates the addition of corresponding elements, and Sigmoid represents the activation function.
5. The intracranial hemorrhage lesion segmentation method based on IHLS-Net according to claim 1, characterized in that The DiceCELoss formula in step 7 is as follows: Cross Entropy Loss=-∑ i y i log(p i )+(1-y i )log(1-p i ) Total Loss=λ dice ×Dice Loss+λ ce ×Cross Entropy Loss Among them, Intersection represents the intersection of the predicted segmentation and the true segmentation, Union represents their union, ∈ is a small constant used to avoid the denominator being zero, y i represents the true label, p i represents the predicted probability, log represents the natural logarithm, and λ dice and λ ce It is the weight factor used to control Dice Loss and Cross Entropy Loss in the final loss.
Citation Information
Patent Citations
Micro-hemorrhage focus segmentation method based on convolutional neural network
CN112927243A
Image feature extraction method and segmentation method based on refined global attention mechanism
CN116503428A