Cerebrovascular CTA segmentation method and system based on three-dimensional convolutional network
The brain blood vessel CTA segmentation method based on three-dimensional convolutional networks solves the problems of insufficient accuracy and broken connections in the segmentation of blood vessel images in the existing technology, and achieves high-precision segmentation of brain blood vessels, generating high-quality three-dimensional blood vessel masks.
Patent Information
- Application Number
- CN202511500051.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-02-17
AI Technical Summary
Existing vascular image segmentation methods rely on manual parameter adjustment and prior knowledge, making it difficult to adapt to differences between different scanning devices and individual patients. They are unable to accurately capture complex vascular structures ranging from millimeter-level trunks to sub-millimeter-level distal ends, resulting in insufficient segmentation accuracy and problems such as broken connections.
A brain vessel CTA segmentation method based on a three-dimensional convolutional network is adopted. Two-dimensional slice files are obtained and stacked into three-dimensional data. After contrast enhancement, the data is input into a three-dimensional convolutional neural network and combined with morphological optimization to generate a high-precision three-dimensional vessel segmentation mask.
It achieves high-precision segmentation of cerebral blood vessels, can capture individual differences between patients, and generates clean, connected three-dimensional vascular masks, thus improving segmentation accuracy and efficiency.
Smart Images

Figure CN121544880A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing, and in particular relates to a method and system for cerebral blood vessel CTA segmentation based on three-dimensional convolutional networks. Background Technology
[0002] In clinical practice, vascular image segmentation typically relies on thresholding, region growing, or machine learning models with manually designed features. Traditional techniques use fixed thresholds or image grayscale histograms to distinguish blood vessels from background tissue, followed by morphological manipulations for post-processing to optimize the segmentation results. These methods heavily depend on manual parameter tuning and prior knowledge, and each step in the processing flow is performed independently, lacking global optimization capabilities. Current traditional segmentation methods or early machine learning approaches suffer from sensitivity to image quality and weak generalization ability, making it difficult to adapt to differences in different scanning devices, protocols, and individual patients. In particular, they cannot accurately capture complex vascular structures ranging from millimeter-level trunks to sub-millimeter-level distal segments simultaneously, resulting in insufficient accuracy in segmenting small vessels or breakage and misconnection at vascular branches and intersections, ultimately limiting their application in precise clinical diagnosis and surgical planning. Summary of the Invention
[0003] Therefore, it is necessary to provide a cerebral vascular CTA segmentation method and system based on a three-dimensional convolutional network that can accurately capture complex vascular structures from millimeter-level trunks to sub-millimeter-level distal ends, addressing the aforementioned technical problems.
[0004] In a first aspect, this application provides a brain vessel CTA segmentation method based on a three-dimensional convolutional network, comprising:
[0005] Two-dimensional slice files of cerebral blood vessels are obtained; and the two-dimensional slice files are stacked according to their spatial position to obtain three-dimensional CTA volume data;
[0006] Based on preset window width and window level values, the contrast of the 3D CTA volume data is enhanced to obtain the 3D image volume data within the target range;
[0007] The three-dimensional image volume data is input into a preset three-dimensional convolutional neural network to obtain a three-dimensional probability map;
[0008] By comparing the probability value of each voxel in the 3D probability map with the global probability threshold, a binary 3D segmentation mask is obtained.
[0009] Morphological optimization of the binary 3D segmentation mask yields a 3D blood vessel segmentation mask; the 3D blood vessel segmentation mask is used to characterize the morphology of cerebral blood vessels.
[0010] Furthermore, the 3D convolutional neural network is constructed using the following method:
[0011] Define an interface for receiving five-dimensional tensors to obtain the model input port; the interface includes batch size, number of channels, depth, height and width of the input data;
[0012] A first convolutional module is connected after the model input port to obtain a high-resolution feature extractor; the first convolutional module includes multiple convolutional layers with a stride of 1;
[0013] A max-pooling layer is connected after the model input port; and a second convolutional module is connected after the max-pooling layer to obtain a low-resolution feature extractor.
[0014] The 3D convolution operation in the high-resolution feature extractor and the low-resolution feature extractor is replaced with deformable convolution operation to obtain the upgraded feature extractor component; and a feature fusion component based on the attention mechanism is constructed.
[0015] The model input port, feature extractor component, feature fusion component, and decoder are connected to generate a three-dimensional convolutional neural network.
[0016] Furthermore, the 3D convolutional neural network is trained using the following method:
[0017] Initialize an untrained 3D convolutional neural network; and input the training dataset into the 3D convolutional neural network to obtain a prediction probability map;
[0018] The loss value is calculated based on the predicted probability map and the true segmentation labels in the training dataset.
[0019] Based on the loss value, the parameters in the 3D convolutional neural network are updated to obtain the updated model;
[0020] Based on the validation set, calculate the performance metrics of the updated model; and determine the training strategy based on the performance metrics; the training strategy is used to instruct the updated model to proceed to the next round of training or to stop training.
[0021] The updated model that has stopped training is identified as the trained 3D convolutional neural network.
[0022] Furthermore, based on the predicted probability map and the true segmentation labels in the training dataset, the loss value is calculated, including:
[0023] Based on the predicted probability map and the true segmentation labels, the main output loss is calculated using the following formula:
[0024]
[0025] in, The main output loss is defined as i, where i is the voxel index and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. The true label value of the i-th voxel;
[0026] The side output loss is calculated based on the real segmentation labels and the side output prediction probability map; the side output prediction probability map is the segmentation prediction map obtained from the intermediate layer of the decoder.
[0027] Based on the predicted probability map and the true segmentation labels, the hard sample focusing loss is calculated using the following formula:
[0028]
[0029] in, The hard sample focusing loss is defined as follows: i is the voxel index, and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. Let i be the true label value of the i-th voxel. To balance the weights for each category, To focus parameters, Predict the true class probability for the i-th voxel;
[0030] The main output loss, side output loss, and hard sample focusing loss are weighted and summed to obtain the loss value.
[0031] Furthermore, based on the true segmentation labels and the side output prediction probability map, the side output loss is calculated, including:
[0032] Based on the spatial size of the side-output prediction probability map, the true segmentation label is downsampled to obtain the downsampled true label.
[0033] Based on the downsampled real labels and the side output predicted probability map, the scalar loss value of the corresponding side output probability prediction map is calculated using the Dice similarity coefficient;
[0034] The side output loss is obtained by weighted summation of all scalar loss values using the following formula:
[0035]
[0036] in, Let be the side output loss, d be the index of the side output depth, and D be the total number of side outputs. Output the corresponding weight coefficient for the d-th side. Let d be the Dice loss of the output on the d-th side.
[0037] Furthermore, the probability value of each voxel in the 3D probability map is compared with the global probability threshold to obtain a binary 3D segmentation mask, including:
[0038] The probability values in the 3D probability graph are divided into multiple intervals, and the number of voxels in each interval is calculated to obtain a probability value histogram.
[0039] Based on the probability value histogram, a candidate threshold is set; and the classification ratio of each voxel after the 3D probability map is segmented by the candidate threshold and the average probability of the corresponding classification ratio are calculated.
[0040] Based on the classification ratio and average probability, the inter-class variance of the corresponding candidate threshold is calculated, and the candidate threshold that maximizes the inter-class variance is determined as the global probability threshold.
[0041] Traverse each voxel in the 3D probability map. If the probability value of the voxel is not less than the global probability threshold, mark the voxel as a blood vessel. Mark the remaining voxels as background to obtain a binary 3D segmentation mask.
[0042] Furthermore, morphological optimization is performed on the binary 3D segmentation mask to obtain a 3D blood vessel segmentation mask, including:
[0043] Traverse the binary 3D segmentation mask, assign a unique label to all regions formed by connecting voxels representing blood vessels to obtain connected regions; and calculate the volume of the connected regions.
[0044] By removing connected regions whose volume is smaller than a preset volume threshold, a denoised binary segmentation mask is obtained.
[0045] Perform a closing operation on the denoised binary segmentation mask to obtain a filled binary segmentation mask;
[0046] An opening operation is performed on the filled binary segmentation mask to obtain a three-dimensional blood vessel segmentation mask.
[0047] Secondly, this application also provides a cerebral vascular CTA segmentation system based on a three-dimensional convolutional network, comprising:
[0048] The stacking module is used to acquire two-dimensional slice files of cerebral blood vessels and stack the two-dimensional slice files according to their spatial position to obtain three-dimensional CTA volume data.
[0049] The enhancement module is used to enhance the contrast of 3D CTA volume data based on preset window width and window level values to obtain 3D image volume data within the target range.
[0050] The probability module is used to input 3D image volume data into a preset 3D convolutional neural network to obtain a 3D probability map;
[0051] The comparison module is used to compare the probability value of each voxel in the 3D probability map with the global probability threshold to obtain a binary 3D segmentation mask.
[0052] The optimization module is used to perform morphological optimization on the binary 3D segmentation mask to obtain a 3D blood vessel segmentation mask; the 3D blood vessel segmentation mask is used to characterize the morphology of cerebral blood vessels.
[0053] Thirdly, this application also provides a computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement any step of the method provided in the first aspect of this application.
[0054] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any step of the method provided in the first aspect of this application.
[0055] The aforementioned cerebral vascular CTA segmentation method and system based on a 3D convolutional network acquires 2D slice files of cerebral blood vessels; stacks these 2D slice files according to their spatial relationships to obtain 3D CTA volume data; enhances the contrast of the 3D CTA volume data based on preset window width and window level values to obtain 3D image volume data within the target range; inputs the 3D image volume data into a preset 3D convolutional neural network to obtain a 3D probability map; compares the probability value of each voxel in the 3D probability map with the global probability threshold to obtain a binary 3D segmentation mask; performs morphological optimization on the binary 3D segmentation mask to obtain a 3D vascular segmentation mask; and uses the 3D vascular segmentation mask to characterize the morphology of cerebral blood vessels. This method can capture individual patient differences, introduce a 3D convolutional network, achieve a balance between accuracy and efficiency in vascular segmentation, improve the accuracy of vascular segmentation, and generate clean, connected 3D vascular masks. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a schematic diagram of the process of a cerebral blood vessel CTA segmentation method based on a three-dimensional convolutional network provided in an embodiment of the present invention;
[0058] Figure 2 This is a schematic diagram of the structure of a cerebral blood vessel CTA segmentation system based on a three-dimensional convolutional network, provided in an embodiment of the present invention. Detailed Implementation
[0059] 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.
[0060] In one embodiment, such as Figure 1 As shown, a cerebral blood vessel CTA segmentation method based on a three-dimensional convolutional network is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0061] Step 101: Obtain two-dimensional slice files of cerebral blood vessels; and stack the two-dimensional slice files according to their spatial position to obtain three-dimensional CTA volume data.
[0062] Two-dimensional (2D) slices of cerebral blood vessels are raw data directly acquired by computed tomography angiography (CTA) scanning equipment. Each CT scan generates a large number of continuous, cross-sectional 2D grayscale images, with pixel values representing the attenuation of X-rays at that point, which is related to tissue density. 3D CTA volumetric data is formed by stacking a series of 2D slices according to their actual spatial positions within the human body, creating a 3D digital matrix. This can be viewed as a 3D pixel block, where each basic unit is called a voxel. Each voxel not only has a grayscale value but also its coordinate information in 3D space, allowing for the viewing and analysis of the 3D structure of blood vessels from any angle and plane on a computer. The terminal reads DICOM format 2D image files from the medical image archiving system. Based on parameters such as slice thickness and interslice spacing recorded in the header information of each 2D slice file, it accurately calculates the Z-axis coordinates of each slice in 3D space and arranges them in alignment. The 2D pixel array constitutes a 3D voxel array, i.e., 3D volumetric data.
[0063] Step 102: Based on the preset window width and window level values, perform contrast enhancement on the 3D CTA volume data to obtain 3D image volume data within the target range.
[0064] Specifically, preset window width and window level values are classic concepts in medical image display and processing. Window width refers to the range of grayscale values of interest during display or processing. A larger window width covers a wider grayscale range, resulting in lower image contrast; conversely, a smaller window width covers a narrower grayscale range, resulting in higher contrast. Window level is the grayscale value at the center point of the window width range, determining which density of tissue is primarily observed. For cerebral vascular CTA, the window level is set near the CT value of blood. The 3D image volume data within the target range is the output data after contrast enhancement processing. The data structure is the same as the input 3D CTA volume data, but the pixel value distribution has been adjusted to highlight details within the CT value range where blood vessels are located. The terminal performs grayscale transformation, linearly mapping a narrow CT value range defined by the window width and window level to the entire display range. CT values falling within the window width range are stretched to increase their differences, thereby enhancing the contrast between blood vessels and surrounding tissues. CT values below or above the window width range are compressed or truncated, displayed as pure black or pure white, respectively, thus suppressing interference from uninteresting tissues.
[0065] Step 103: Input the three-dimensional image volume data into a preset three-dimensional convolutional neural network to obtain a three-dimensional probability map.
[0066] Specifically, the pre-defined 3D convolutional neural network is a deep learning model trained using a large amount of labeled cerebral vascular data. Its 3D structure means the convolutional kernels can slide in three dimensions, effectively capturing the continuity and morphological features of blood vessels in 3D space. The 3D probability map is a 3D matrix with the same size as the input 3D image volume data. Each voxel in the matrix has a probability value between 0 and 1, representing the likelihood that the voxel belongs to the cerebral vascular category. For example, a voxel with a value of 0.95 has a 95% confidence level that it is a blood vessel. The terminal inputs the enhanced 3D data into the trained neural network. The neural network, through complex internal operations such as multi-layer 3D convolution, pooling, and non-linear activation, extracts features from the data layer by layer, from low to high level, and uses a classifier to calculate a probability that each voxel in the input data belongs to a blood vessel.
[0067] Step 104: Compare the probability value of each voxel in the 3D probability map with the global probability threshold to obtain a binary 3D segmentation mask.
[0068] The global probability threshold is a critical probability value used to distinguish blood vessels from the background. This threshold is not fixed but is automatically calculated by an algorithm based on the overall distribution of the current 3D probability map to achieve optimal segmentation results. The binary 3D segmentation mask is a 3D matrix where each voxel has only two values: 1 for blood vessel and 0 for background, clearly marking the spatial locations of all voxels identified as cerebral blood vessels. The terminal compares the probability value of each voxel with the global probability threshold. It iterates through each voxel in the 3D probability map, comparing its probability value with the global probability threshold. If the voxel's probability value is not less than the threshold, the binary mask value at that voxel's location is set to 1; if the voxel's probability value is less than the threshold, the binary mask value at that voxel's location is set to 0.
[0069] Step 105: Morphological optimization is performed on the binary three-dimensional segmentation mask to obtain a three-dimensional blood vessel segmentation mask; the three-dimensional blood vessel segmentation mask is used to characterize the morphology of cerebral blood vessels.
[0070] Morphological optimization is a set of image processing operations based on shape and structure, commonly used for processing binary images. Basic operations include dilation, erosion, opening, and closing. The 3D blood vessel segmentation mask is a high-quality binary-to-3D segmentation mask after morphological optimization, capable of more accurately and smoothly representing the true 3D morphology of cerebral blood vessels. Terminal repair addresses defects in the initial segmentation by using opening operations to eliminate isolated, small noise points misidentified as blood vessels. For voids within blood vessels due to signal unevenness or segmentation errors, closing operations are used to fill these voids, maintaining internal connectivity. Appropriate dilation and erosion smooth the uneven boundaries of blood vessels and connect small blood vessel segments broken due to excessively high thresholds.
[0071] This embodiment provides a cerebral vascular CTA segmentation method based on a 3D convolutional network. The method acquires 2D slice files of cerebral blood vessels; stacks these slice files according to their spatial relationships to obtain 3D CTA volumetric data; enhances the contrast of the 3D CTA volumetric data based on preset window width and window level values to obtain 3D image volumetric data within the target range; inputs the 3D image volumetric data into a preset 3D convolutional neural network to obtain a 3D probability map; compares the probability value of each voxel in the 3D probability map with the global probability threshold to obtain a binary 3D segmentation mask; performs morphological optimization on the binary 3D segmentation mask to obtain a 3D vascular segmentation mask; and uses the 3D vascular segmentation mask to characterize the morphology of cerebral blood vessels. Through these methods, individual patient differences can be captured, and by introducing a 3D convolutional network, a balance between accuracy and efficiency in vascular segmentation can be achieved, improving the accuracy of vascular segmentation and generating a clean and connected 3D vascular mask.
[0072] In one embodiment, the three-dimensional convolutional neural network is constructed using the following method:
[0073] Step 201: Define the interface for receiving the five-dimensional tensor to obtain the model input port; the interface includes batch size, number of channels, depth, height and width of the input data.
[0074] In deep learning, a five-dimensional tensor is a general term for multidimensional arrays. For convolutional networks processing three-dimensional data, the input is actually a five-dimensional tensor. The five dimensions represent: batch size, which refers to the number of three-dimensional CTA volume data sent to the network for processing at one time; batch processing can improve training efficiency and stability; number of channels, which refers to the number of feature layers for each three-dimensional volume data; the initial input is 1, but the number of channels may increase if multimodal fusion is used; depth, height, and width define the specific spatial dimensions of a three-dimensional CTA volume data, representing the number of voxels in the depth, height, and width directions. The model input port is the data entry point of the neural network, an interface with a clearly defined data shape, specifying the expected size of the data received by all network layers, laying the foundation for data flow in the network. The terminal creates an input layer and specifies the desired data format as [batch size, number of channels, depth, height, width].
[0075] Step 202: Connect the first convolutional module after the model input port to obtain a high-resolution feature extractor; the first convolutional module includes multiple convolutional layers with a stride of 1.
[0076] Specifically, the first convolutional module is a network structure composed of multiple cascaded 3D convolutional layers. Each convolutional layer contains a set of learnable 3D convolutional kernels used to extract features from the input data. The stride is the distance the convolutional kernel slides across the input data each time. A stride of 1 means that the convolutional kernel moves only one voxel at a time, which allows the output feature map to maintain maximum spatial consistency with the input. The high-resolution feature extractor is the output after processing by the first convolutional module. Its core features are a large spatial size and a small number of feature channels. Due to the use of convolution with a stride of 1, the feature map output by this path has almost no reduction in depth, height, and width, but may be slightly altered due to edge processing. It retains rich spatial detail information and high-resolution features, which are crucial for accurately segmenting the boundaries and fine branches of blood vessels. The terminal connects the defined input port directly to a module composed of multiple 3D convolutional layers. Each convolutional layer performs the following operations: the convolutional kernel slides across the input volume data, performing multiplication and addition operations to activate certain specific local modes. Due to the stride of 1, less spatial information is lost.
[0077] Step 203: Connect a max pooling layer after the model input port; and connect a second convolutional module after the max pooling layer to obtain a low-resolution feature extractor.
[0078] Specifically, the max-pooling layer is a downsampling operation that reduces the spatial size of the feature map by maximizing local regions, thus actively sacrificing resolution for a larger receptive field. The second convolutional module is a relatively deeper convolutional neural network module with more layers and more convolutional kernel channels than the first convolutional module. The core feature of the low-resolution feature extractor is its small spatial size but high number of feature channels. Due to the pooling and deeper convolutional operations, each voxel has a larger receptive field, able to see a wider range of context in the original image, thus containing higher-level semantic and global contextual information. The terminal connects to the max-pooling layer, then to the second convolutional module. The pooling layer rapidly reduces the data resolution, and then the condensed data is fed into a deeper convolutional module with more channels for in-depth processing and understanding. This path focuses on understanding semantics.
[0079] Step 204: Replace the 3D convolution operation in the high-resolution feature extractor and the low-resolution feature extractor with deformable convolution operation to obtain the upgraded feature extractor component; and construct a feature fusion component based on the attention mechanism.
[0080] Deformable convolution is an advanced convolution operation where the sampling point position of the convolution kernel adaptively shifts according to the content of the input image, thus better conforming to the real shape of irregular and curved structures such as blood vessels. The upgraded feature extractor component replaces the standard convolutions in both paths with deformable convolutions in the entire feature extraction part. After the upgrade, the high-resolution path can more accurately capture the detailed contours of tortuous blood vessels, while the low-resolution path can more effectively understand the complex morphological context of blood vessels. The attention-based feature fusion component is an intelligent weighted fusion module that automatically learns which spatial locations and feature channels are more important in the high-resolution and low-resolution feature maps, assigning higher weights to important information, thereby achieving adaptive and selective feature fusion. The terminal replaces the original standard convolutional layers in the network with deformable convolutional layers. During training, the network not only learns the weights of the convolutional kernels, but also learns the offset of each sampling point, making the feature extraction process more adaptive. A network module is designed that receives feature maps from high-resolution and low-resolution paths, generates an attention weight map between 0 and 1 through a series of convolutions and activation functions, and then weights and sums the feature maps of the two paths according to this weight map to achieve intelligent fusion.
[0081] Step 205: Connect the model input port, feature extractor component, feature fusion component and decoder to generate a three-dimensional convolutional neural network.
[0082] The decoder, acting as the reverse of the feature extraction process, primarily performs upsampling, gradually restoring the smaller, fused feature map to the size of the original input image. The generated 3D convolutional neural network is a complete, end-to-end semantic segmentation network model, encompassing all components from input, multi-scale feature extraction, intelligent fusion, to final pixel-level classification. The terminal connects all previously constructed components—including the input port, the upgraded dual-path feature extractor component, the attention feature fusion component, and the decoder—in the correct data flow order. Data enters through the input port, undergoes extraction and fusion along two paths, and is finally upsampled by the decoder, outputting a 3D probability map with the same size as the input data.
[0083] This embodiment constructs a fully functional 3D convolutional network segmentation model, utilizes multi-scale information and adaptive receptive fields, and achieves precise and detailed voxel-level segmentation of cerebral blood vessels through intelligent fusion and upsampling. Dual-channel feature extraction and intelligent fusion of attention enable accurate capture of complex vascular structures ranging from millimeter-level trunks to sub-millimeter-level extremities.
[0084] In one embodiment, the three-dimensional convolutional neural network is trained using the following method:
[0085] Step 301: Initialize the untrained 3D convolutional neural network; and input the training dataset into the 3D convolutional neural network to obtain the prediction probability map.
[0086] The untrained 3D convolutional neural network is a model whose network structure is complete, but all parameters are in an initial random state, and it has not yet learned any knowledge related to brain vessel segmentation. The training dataset is the data set used to train the model, containing a large number of paired samples. The input is 3D CTA volume data, and the labels are corresponding, expert-annotated, real segmentation masks, with each voxel explicitly labeled as either a vessel or background. The prediction probability map is the output result calculated by the network after inputting the 3D CTA volume data from the training data into the untrained neural network. It is a 3D matrix of the same size as the input volume data, and each voxel's value is a probability value between 0 and 1, representing the likelihood that the current model considers that voxel to be a vessel. In the early stages of training, the prediction results will be very inaccurate due to the random parameters. The terminal assigns initial values to all learnable parameters of the network using a random initialization method, providing a starting point for training. The training dataset is input into the neural network for forward propagation. Data flows in from the network's input port, passes through all layers sequentially, and finally, the prediction result is obtained at the output.
[0087] Step 302: Calculate the loss value based on the predicted probability map and the true segmentation labels in the training dataset.
[0088] Specifically, the true segmentation labels are the segmentation results provided in the training dataset, considered the standard answer. These are binary or probabilistic segmentation maps labeled by medical experts and deemed absolutely correct; they are the target of the model's learning. The loss value is a scalar value used to quantify the difference or degree of error between the current model's predicted probability map and the true segmentation labels. The larger the loss value, the less accurate the model's prediction; the smaller the loss value, the closer the prediction is to the true answer. Its core function is to guide the adjustment of model parameters. The terminal completes this process through a preset loss function. The loss function receives two inputs—the network's prediction and the true labels—and calculates a scalar value representing the overall error according to an internally defined mathematical formula. This process is automatic and differentiable.
[0089] Step 303: Based on the loss value, update the parameters in the 3D convolutional neural network to obtain the updated model.
[0090] Specifically, parameters are all the adjustable variables in a neural network, mainly including the weights and biases of each convolutional kernel. They determine the network's behavior and performance, and training essentially involves finding a set of optimal parameters. The updated model is a neural network with adjusted parameters. Compared to the untrained model or the previous model, the parameters have undergone slight changes, and theoretically, the predictive ability should be improved, becoming closer to the true labels. Backpropagation is performed at the terminal to calculate the gradient of the loss value with respect to each network parameter. The gradient indicates the direction and approximate magnitude by which each parameter should be adjusted to reduce the loss. An optimization algorithm is used to fine-tune all parameters based on the calculated gradients.
[0091] Step 304: Calculate the performance metrics of the updated model based on the validation set; and determine the training strategy based on the performance metrics; the training strategy is used to instruct the updated model to proceed to the next round of training or to stop training.
[0092] The validation set is an independent dataset used during training that is not involved in parameter updates. It includes both input and ground truth labels and is used to objectively evaluate the model's generalization ability and determine whether the model is overfitting. Performance metrics are objective standards used to quantify the quality of model segmentation, including the Dice coefficient, which measures the volume overlap between the segmentation result and the ground truth labels, and recall, which measures the ability to identify all real blood vessels. These metrics differ from loss functions and are generally easier for humans to understand. The training strategy is a set of rules for controlling the training process based on the performance of the validation set, and may include: continuing training, early stopping, adjusting the learning rate, etc. The terminal inputs the validation set data into the currently updated model, obtains the prediction results, uses pre-selected metrics to calculate the model's performance score on the dataset, monitors the changes in performance metrics in consecutive training rounds, and decides to continue training if the metrics continue to improve; if the metrics fail to improve significantly after multiple consecutive rounds, the training stop strategy is triggered, and training is terminated.
[0093] Step 305: The updated model that has stopped training is identified as the trained 3D convolutional neural network.
[0094] The trained 3D convolutional neural network is the output of the entire training process. It is a mature model with optimized and fixed parameters, suitable for practical clinical or research applications. When new, unseen CTA volume data is input, it can output high-quality, high-precision cerebral vessel segmentation probability maps. When the conditions for stopping training in the training strategy are met, the final saved model version is determined by the terminal as the final usable trained model.
[0095] This embodiment trains a previously constructed 3D convolutional neural network, enabling the 3D convolutional neural network to still output high-quality, high-precision cerebral blood vessel segmentation probability maps for unseen CTA volume data. By using an early stopping strategy, it avoids model overfitting during training, thereby improving the segmentation accuracy of cerebral blood vessel CTA.
[0096] In one embodiment, the loss value is calculated based on the predicted probability map and the true segmentation labels in the training dataset, including:
[0097] Step 401: Based on the predicted probability map and the true segmentation labels, calculate the main output loss using the following formula:
[0098]
[0099] in, The main output loss is defined as i, where i is the voxel index and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. is the true label value of the i-th voxel.
[0100] Specifically, the main output loss refers to the Dice loss, which is an indicator that directly measures the similarity between the model's output predicted probability map and the true segmentation label. The Dice coefficient originates from an indicator that measures the overlap between two sample sets; it is 1 for a perfect match and 0 for a complete mismatch. The optimal Dice loss value is 0. The predicted probability is the probability value output by the model for the i-th voxel that belongs to the blood vessel category, ranging from [0,1]. The true label value is the value of the i-th voxel in the true segmentation label, which is 0 or 1. The terminal calculates the intersection and union of each voxel. The numerator in the formula approximately calculates twice the overlap between the predicted blood vessel region and the true blood vessel region, and the denominator approximately calculates the total volume of the two regions. Since the true label value is binary, the sum of the squares of the true label values is the total volume of the true blood vessels. Dividing the overlap by the total volume yields the Dice coefficient, which is between 0 and 1. The larger the value, the higher the overlap and the more accurate the prediction. Subtracting this coefficient from 1 gives the loss value; the less accurate the prediction, the larger the loss value.
[0101] Step 402: Calculate the side output loss based on the real segmentation label and the side output prediction probability map; the side output prediction probability map is the segmentation prediction map obtained from the intermediate layer of the decoder.
[0102] The side-output prediction probability map is derived from predictions obtained not only from the final output layer of the network during training but also from intermediate layers of the decoder. These prediction maps come from different depths, have a larger spatial size, but their features are shallower and more localized. The side-output loss is a weighted sum of the losses calculated from all side-output prediction probability maps and their corresponding ground truth labels. The terminal downsamples the full-resolution ground truth segmentation labels using interpolation and other methods to match their size to the corresponding side-output prediction maps. For each side-output prediction map, the difference between it and the downsampled ground truth label is calculated using the same loss function as the main output, resulting in a scalar loss value. All side-output loss values are multiplied by a preset weight and summed to obtain the total side-output loss.
[0103] Step 403: Based on the predicted probability map and the true segmentation labels, calculate the hard sample focusing loss using the following formula:
[0104]
[0105] in, The hard sample focusing loss is defined as follows: i is the voxel index, and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. Let i be the true label value of the i-th voxel. To balance the weights for each category, To focus parameters, Predict the true class probability for the i-th voxel.
[0106] Specifically, hard samples refer to samples that are easily misclassified by the model. In the segmentation task of this embodiment, these refer to voxels that are difficult to distinguish, such as the boundaries of blood vessels and small branches. The probability of predicting the true class is the probability that the i-th voxel is predicted to be the true class. The hard sample focusing loss is an improvement on the standard cross-entropy loss. By introducing two modulation factors, it reduces the contribution of easily classified samples to the total loss, thereby allowing the model to focus more on learning those hard-to-classify samples. The terminal iterates through each voxel, selects a calculation method based on its true label value, calculates the probability of predicting the true class for the i-th voxel, substitutes it into the formula, sums the weighted cross-entropy terms calculated for all voxels, divides by the total number of voxels, and takes a negative number to obtain the final hard sample focusing loss value.
[0107] Step 404: Perform a weighted summation of the main output loss, side output loss, and hard sample focusing loss to obtain the loss value.
[0108] The loss value is a single scalar number that guides the parameter updates in this round of training. It is a weighted sum of the main output loss, the side output loss, and the hard sample focusing loss. The terminal multiplies each of the three loss values by a preset weight coefficient and then adds them together. The weights are used to balance the influence of different loss terms on the direction of model optimization.
[0109] This embodiment combines multiple loss functions with different focuses to form a comprehensive and powerful optimization objective. The Dice loss ensures the accuracy of the overall segmentation shape, the side output loss stabilizes and accelerates the training process, and the focus loss focuses on improving the segmentation quality of details and hard examples. The composite loss can guide the model to learn more accurate segmentation capabilities and is a key strategy for achieving high-performance segmentation.
[0110] In one embodiment, the side-output loss is calculated based on the true segmentation label and the side-output prediction probability map, including:
[0111] Step 501: Based on the spatial size of the side output prediction probability map, downsample the real segmentation label to obtain the downsampled real label.
[0112] The spatial dimensions of the side-output prediction probability map refer to the specific size of the prediction map obtained from the intermediate layers of the decoder in three spatial dimensions: depth, height, and width. Due to operations such as pooling or stride convolution, these dimensions are usually smaller than the probability map output by the network. The ground truth segmentation label is a binary segmentation map annotated by experts, with the same resolution as the original input image. The downsampled ground truth label is a new, scaled-down label map whose depth, height, and width are exactly the same as the dimensions of the current side-output prediction probability map to be calculated. The terminal obtains the spatial dimensions of the current side-output probability map. Since the ground truth segmentation label is a binary map, an interpolation algorithm that preserves its discrete characteristics to the greatest extent is needed. Nearest neighbor interpolation is selected for downsampling. This algorithm directly takes the value of the nearest voxel in the original high-resolution image for each voxel in the downsampled new image. Using the selected interpolation algorithm, the full-resolution ground truth label is scaled down from its original size to the target size.
[0113] Step 502: Based on the downsampled real labels and the side output prediction probability map, calculate the scalar loss value of the corresponding side output probability prediction map using the Dice similarity coefficient.
[0114] The scalar loss value is a single numerical value representing the degree of difference between the predicted probability map of the d-th side output and its corresponding downsampled true label, calculated using the Dice similarity coefficient. The calculation process is completely identical to that of calculating the main output Dice loss, but the input objects differ. The terminal takes all voxel probability values from the d-th side output probability map and all voxel label values from its corresponding downsampled true label map, using the same calculation formula as the main output. It is the voxel value in the side output probability plot. It is the voxel value of the downsampled real label image, summed and iterated through all voxels of the output image on this side.
[0115] Step 503: Calculate the side output loss by weighted summation of all scalar loss values using the following formula:
[0116]
[0117] in, Let be the side output loss, d be the index of the side output depth, and D be the total number of side outputs. Output the corresponding weight coefficient for the d-th side. Let d be the Dice loss of the output on the d-th side.
[0118] Specifically, the side-output depth index is used to identify the sequence number of different side-output layers, where d=1 represents the shallowest side-output and d=D represents the deepest side-output. The weight coefficient is a positive number pre-assigned to the d-th side-output, used to control the importance of that side-output's loss in the total side-output loss. If deep semantic features and shallow detail features are considered equally important, a uniform weight can be set; if the model focuses more on the accuracy of deep outputs, a larger weight value can be assigned to deeper side-outputs. The side-output loss is a scalar value, the sum of all individual side-output losses after weighted summation. The terminal iterates through each side-output depth index. In each iteration, the Dice loss value of the d-th side-output is retrieved, multiplied by its corresponding weight coefficient, and the weighted loss value is added to an accumulator variable. After all D side-outputs have been processed, the final value in the accumulator is the side-output loss.
[0119] This embodiment combines supervision signals from different depths and multiple scales of the network into a unified, optimizable objective, sets different weights, and guides the network to focus more on learning effective features at key levels.
[0120] In one embodiment, the probability value of each voxel in the 3D probability map is compared with the global probability threshold to obtain a binary 3D segmentation mask, including:
[0121] Step 601: Divide the probability values in the three-dimensional probability graph into multiple intervals and calculate the number of voxels in each interval to obtain a probability value histogram.
[0122] In this context, an interval is a discrete division of a continuous range of probability values into several consecutive, non-overlapping smaller ranges. For example, dividing the range from 0 to 1 into 100 intervals, each with a width of 0.01, results in the first interval being [0, 0.01), the second [0.01, 0.02), and so on. A probability value histogram is a statistical chart where the horizontal axis represents the probability value interval and the vertical axis represents the number of voxels falling within each interval, visually displaying the distribution of probability values for all voxels in a 3D probability graph. The terminal determines the probability range (0 to 1) and the number of intervals, generating probability intervals of equal width. It iterates through each voxel in the 3D probability graph, determining which probability interval it belongs to based on its probability value, incrementing the counter corresponding to that interval, and after all voxels have been traversed and statistically analyzed, a complete distribution graph, i.e., the probability value histogram, is obtained.
[0123] Step 602: Based on the probability value histogram, set a candidate threshold; and calculate the classification ratio of each voxel after the three-dimensional probability map is segmented by the candidate threshold and the average probability of the corresponding classification ratio.
[0124] Specifically, the candidate threshold is a potential critical value used to segment blood vessels and background, tested by iterating through all possible probability values as candidate thresholds. The classification ratio, if used to segment the probability map with the current candidate threshold, is the proportion of voxels classified as background out of the total number of voxels, and the proportion of voxels classified as blood vessels out of the total number of voxels; the sum of these two ratios is 1. The average probability is the arithmetic mean of the probability values of all voxels within the same category, including the average probability of all voxels classified as background and the average probability of all voxels classified as blood vessels. Starting from the lowest probability, the terminal increments the probability in steps to the highest probability, using each value as a candidate threshold. Using a histogram, the terminal quickly calculates the sum of the number of voxels in all intervals where the probability value is less than the candidate threshold, and then divides it by the total number of primes. Similarly, it calculates the sum of the number of voxels in all intervals where the probability value is greater than or equal to the candidate threshold, and then divides it by the total number of primes. For each interval where the probability value is less than the candidate threshold, the terminal takes the median probability of that interval and multiplies it by the number of voxels in that interval. The sum of all these products is then divided by the total number of background class voxels. For intervals where the probability value is greater than or equal to the candidate threshold, the terminal takes the median probability of that interval and multiplies it by the number of voxels in that interval. The sum of all these products is then divided by the total number of background class voxels. This yields four key statistics that characterize the weights and central tendencies of the two classes.
[0125] Step 603: Based on the classification ratio and average probability, calculate the inter-class variance of the corresponding candidate thresholds: and determine the candidate threshold that maximizes the inter-class variance as the global probability threshold.
[0126] Specifically, the inter-class variance is calculated using the following formula:
[0127]
[0128] in, Let be the inter-class variance at threshold t, where t is the candidate threshold. The proportion of voxels classified as background at threshold t. This represents the proportion of voxels classified as blood vessels at threshold t. The average probability of background pixels at threshold t. Let be the average probability of blood vessel pixels at threshold t. Inter-class variance is a metric used to evaluate the separation between background and blood vessel categories at a given candidate threshold. A larger inter-class variance indicates a better separation between the two classes, theoretically resulting in better segmentation. The global probability threshold is the specific threshold selected from all candidate thresholds that maximizes the inter-class variance; it is considered the optimal threshold for best distinguishing between blood vessels and background. For each candidate threshold, the terminal calculates using four statistics in the formula, iterates through the inter-class variance values corresponding to all candidate thresholds, finds the candidate threshold that maximizes the inter-class variance, and determines it as the final global probability threshold used for binarization.
[0129] Step 604: Traverse each voxel in the 3D probability map. If the probability value of a voxel is not less than the global probability threshold, mark the voxel as a blood vessel. Mark the remaining voxels as background to obtain a binary 3D segmentation mask.
[0130] The binary 3D segmentation mask is a 3D array with the same size as the 3D probability map, but the value of each voxel is no longer a continuous probability, but a discrete integer label, with 1 representing blood vessels and 0 representing background. The terminal accesses each voxel in the 3D probability map one by one, comparing the probability value of the current voxel with a global probability threshold. If the probability value of the voxel is not less than the global probability threshold, the output mask value at that voxel's location is set to 1, representing a blood vessel; if the probability value of the voxel is less than the global probability threshold, the output mask value at that voxel's location is set to 0, representing background. After all voxels have been processed, the binary 3D segmentation mask is generated.
[0131] This embodiment employs an automated, data-driven optimal threshold selection method to ensure that the selected threshold maximizes inter-class differences, thereby obtaining the theoretically optimal binary segmentation result. This avoids the subjectivity and tediousness of manually setting thresholds, thus improving the accuracy of cerebral vascular CTA segmentation.
[0132] In one embodiment, morphological optimization is performed on the binary 3D segmentation mask to obtain a 3D blood vessel segmentation mask, including:
[0133] Step 701: Traverse the binary 3D segmentation mask, assign a unique label to all regions formed by connecting voxels representing blood vessels to obtain connected regions; and calculate the volume of the connected regions.
[0134] In 3D space, a connected region refers to all voxels labeled as blood vessels. These voxels are connected by face adjacency, edge adjacency, or corner adjacency, forming an independent, continuous 3D object. Each such region is assigned a unique identifier. The volume of a connected region is the total number of voxels contained within it. Since each voxel represents a fixed-size physical space, the volume directly reflects the size of the connected region in the physical world. The terminal starts from the beginning of the binary 3D segmentation mask and scans each voxel position. When it scans an unlabeled voxel with a value of 1, it is used as a seed for a new region. Using a region growing algorithm, it recursively searches for all voxels connected to the seed voxel with a value of 1, grouping all found connected voxels into the same region and assigning a unique, currently unused label. During the labeling of a connected region, a counter counts the number of voxels contained in that region; this number is the volume of the region. The process continues traversing the mask, searching for the next unlabeled voxel with a value of 1, until all voxels with a value of 1 have been visited and assigned a region label.
[0135] Step 702: Remove connected regions whose volume is smaller than a preset volume threshold to obtain a denoised binary segmentation mask.
[0136] Specifically, the preset volume threshold is a manually set volume cutoff value, determined based on prior knowledge. All connected regions with volumes smaller than this threshold are considered noise or non-target segments. The denoising binary segmentation mask is a new binary 3D array with the same size as the original mask. Compared to the original mask, all connected regions with excessively small volumes have been removed, and their voxel values have been reset from 1 to 0. The terminal iterates through all connected regions and their volumes. For each region, the volume is compared with the preset volume threshold. If the volume of a connected region is smaller than the preset threshold, the values of all voxels contained in that region in the original binary 3D segmentation mask are changed from 1 to 0. If the volume is greater than or equal to the threshold, the region's values are retained.
[0137] Step 703: Perform a closing operation on the denoised binary segmentation mask to obtain a filled binary segmentation mask.
[0138] Specifically, closing is a fundamental morphological operation, defined as performing a dilation operation followed by an erosion operation, using a predefined 3D structuring element as a probe to detect and modify the image. Filling the binary segmentation mask is the binary 3D segmentation mask processed by the closing operation. The terminal performs a dilation operation on the denoised binary segmentation mask, sliding the origin of the structuring element sequentially through each voxel with a value of 1 in the mask. For each blood vessel voxel, all neighboring voxels covered by the structuring element are marked as 1, causing all blood vessel regions to expand outwards. The erosion operation is then performed on the dilated result. The origin of the structuring element is then slided sequentially through each voxel with a value of 1 in the current result. Only when all voxels covered by the structuring element have a value of 1 is the voxel at the origin position retained as 1 in the output; otherwise, it is set to 0. This causes the blood vessel regions to shrink inwards, roughly restoring the original size of the blood vessel trunk and offsetting most of the expansion caused by dilation, while preserving connectivity and hole filling effects.
[0139] Step 704: Perform an opening operation on the filled binary segmentation mask to obtain a three-dimensional blood vessel segmentation mask.
[0140] In this process, opening is the opposite of closing; it involves performing erosion followed by dilation. The 3D vascular segmentation mask is an optimized binary 3D segmentation mask processed by opening, representing the final segmented cerebral vascular system. The terminal performs erosion on the filled binary segmentation mask, removing the outermost voxels, causing the vascular region to shrink as a whole. Dilation is then performed on the eroded result to restore the vascular dimensions lost in the previous erosion step, bringing the vascular lumen back to a more realistic thickness. This repairs slightly uneven boundaries caused by erosion, making them smoother overall, while retaining the purification effect achieved by erosion.
[0141] This embodiment uses a volume threshold and a morphological optimization method that performs closing operations before opening operations to ensure the connectivity and structural integrity of the vascular network. By actively repairing breakpoints and filling holes, it ensures the formation of a more continuous and complete vascular tree in terms of topology. It also removes amplified residual scattered noise and disconnects unnecessary and erroneous connections, ensuring that the purity and aesthetics of the segmentation results are maximized while prioritizing vascular connectivity.
[0142] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0143] Based on the same inventive concept, this application also provides a 3D convolutional network-based cerebral blood vessel CTA segmentation system for implementing the aforementioned 3D convolutional network-based cerebral blood vessel CTA segmentation method. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more embodiments of the 3D convolutional network-based cerebral blood vessel CTA segmentation system provided below can be found in the limitations of the 3D convolutional network-based cerebral blood vessel CTA segmentation method described above, and will not be repeated here.
[0144] In one exemplary embodiment, such as Figure 2 As shown, a cerebral vascular CTA segmentation system 800 based on a three-dimensional convolutional network is provided, including:
[0145] Stacking module 801 is used to acquire two-dimensional slice files of cerebral blood vessels; and stack the two-dimensional slice files according to their spatial position to obtain three-dimensional CTA volume data;
[0146] Enhancement module 802 is used to enhance the contrast of 3D CTA volume data based on preset window width and window level values to obtain 3D image volume data within the target range;
[0147] The probability module 803 is used to input three-dimensional image volume data into a preset three-dimensional convolutional neural network to obtain a three-dimensional probability map;
[0148] The comparison module 804 is used to compare the probability value of each voxel in the three-dimensional probability map with the global probability threshold to obtain a binary three-dimensional segmentation mask.
[0149] The optimization module 805 is used to perform morphological optimization on the binary three-dimensional segmentation mask to obtain a three-dimensional blood vessel segmentation mask; the three-dimensional blood vessel segmentation mask is used to characterize the morphology of cerebral blood vessels.
[0150] Furthermore, the system also includes a modeling module for:
[0151] Define an interface for receiving five-dimensional tensors to obtain the model input port; the interface includes batch size, number of channels, depth, height and width of the input data;
[0152] A first convolutional module is connected after the model input port to obtain a high-resolution feature extractor; the first convolutional module includes multiple convolutional layers with a stride of 1;
[0153] A max-pooling layer is connected after the model input port; and a second convolutional module is connected after the max-pooling layer to obtain a low-resolution feature extractor.
[0154] The 3D convolution operation in the high-resolution feature extractor and the low-resolution feature extractor is replaced with deformable convolution operation to obtain the upgraded feature extractor component; and a feature fusion component based on the attention mechanism is constructed.
[0155] The model input port, feature extractor component, feature fusion component, and decoder are connected to generate a three-dimensional convolutional neural network.
[0156] Furthermore, the modeling module is also used for:
[0157] Initialize an untrained 3D convolutional neural network; and input the training dataset into the 3D convolutional neural network to obtain a prediction probability map;
[0158] The loss value is calculated based on the predicted probability map and the true segmentation labels in the training dataset.
[0159] Based on the loss value, the parameters in the 3D convolutional neural network are updated to obtain the updated model;
[0160] Based on the validation set, calculate the performance metrics of the updated model; and determine the training strategy based on the performance metrics; the training strategy is used to instruct the updated model to proceed to the next round of training or to stop training.
[0161] The updated model that has stopped training is identified as the trained 3D convolutional neural network.
[0162] Furthermore, the modeling module is also used for:
[0163] Based on the predicted probability map and the true segmentation labels, the main output loss is calculated using the following formula:
[0164]
[0165] in, The main output loss is defined as i, where i is the voxel index and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. The true label value of the i-th voxel;
[0166] The side output loss is calculated based on the real segmentation labels and the side output prediction probability map; the side output prediction probability map is the segmentation prediction map obtained from the intermediate layer of the decoder.
[0167] Based on the predicted probability map and the true segmentation labels, the hard sample focusing loss is calculated using the following formula:
[0168]
[0169] in, The hard sample focusing loss is defined as follows: i is the voxel index, and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. Let i be the true label value of the i-th voxel. To balance the weights for each category, To focus parameters, Predict the true class probability for the i-th voxel;
[0170] The main output loss, side output loss, and hard sample focusing loss are weighted and summed to obtain the loss value.
[0171] Furthermore, the modeling module is also used for:
[0172] Based on the spatial size of the side-output prediction probability map, the true segmentation label is downsampled to obtain the downsampled true label.
[0173] Based on the downsampled real labels and the side output predicted probability map, the scalar loss value of the corresponding side output probability prediction map is calculated using the Dice similarity coefficient;
[0174] The side output loss is obtained by weighted summation of all scalar loss values using the following formula:
[0175]
[0176] in, Let be the side output loss, d be the index of the side output depth, and D be the total number of side outputs. Output the corresponding weight coefficient for the d-th side. Let d be the Dice loss of the output on the d-th side.
[0177] Furthermore, the comparison module 804 is also used for:
[0178] The probability values in the 3D probability graph are divided into multiple intervals, and the number of voxels in each interval is calculated to obtain a probability value histogram.
[0179] Based on the probability value histogram, a candidate threshold is set; and the classification ratio of each voxel after the 3D probability map is segmented by the candidate threshold and the average probability of the corresponding classification ratio are calculated.
[0180] Based on the classification ratio and average probability, the inter-class variance of the corresponding candidate threshold is calculated, and the candidate threshold that maximizes the inter-class variance is determined as the global probability threshold.
[0181] Traverse each voxel in the 3D probability map. If the probability value of the voxel is not less than the global probability threshold, mark the voxel as a blood vessel. Mark the remaining voxels as background to obtain a binary 3D segmentation mask.
[0182] Furthermore, the optimization module 805 is also used for:
[0183] Traverse the binary 3D segmentation mask, assign a unique label to all regions formed by connecting voxels representing blood vessels to obtain connected regions; and calculate the volume of the connected regions.
[0184] By removing connected regions whose volume is smaller than a preset volume threshold, a denoised binary segmentation mask is obtained.
[0185] Perform a closing operation on the denoised binary segmentation mask to obtain a filled binary segmentation mask;
[0186] An opening operation is performed on the filled binary segmentation mask to obtain a three-dimensional blood vessel segmentation mask.
[0187] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the cerebral blood vessel CTA segmentation method based on a three-dimensional convolutional network as described above.
[0188] 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.
[0189] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0190] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.
Claims
1. A three-dimensional convolution network-based cerebral vessel CTA segmentation method, characterized in that, The method includes: Two-dimensional slice files of cerebral blood vessels are obtained; and the two-dimensional slice files are stacked according to their spatial position to obtain three-dimensional CTA volume data; Based on preset window width and window level values, the contrast of the three-dimensional CTA volume data is enhanced to obtain three-dimensional image volume data within the target range; The three-dimensional image volume data is input into a preset three-dimensional convolutional neural network to obtain a three-dimensional probability map; The probability value of each voxel in the three-dimensional probability map is compared with the global probability threshold to obtain a binary three-dimensional segmentation mask. The binary three-dimensional segmentation mask is morphologically optimized to obtain a three-dimensional blood vessel segmentation mask; the three-dimensional blood vessel segmentation mask is used to characterize the morphology of the cerebral blood vessels.
2. The method according to claim 1, characterized in that, The three-dimensional convolutional neural network is constructed using the following method: Define an interface for receiving five-dimensional tensors to obtain the model input port; the interface includes batch size, number of channels, depth, height and width of the input data; A first convolutional module is connected after the model input port to obtain a high-resolution feature extractor; the first convolutional module includes multiple convolutional layers with a stride of 1; A max-pooling layer is connected after the model input port; and a second convolutional module is connected after the max-pooling layer to obtain a low-resolution feature extractor. The 3D convolution operation in the high-resolution feature extractor and the low-resolution feature extractor is replaced with deformable convolution operation to obtain the upgraded feature extractor component; and a feature fusion component based on the attention mechanism is constructed. The model input port, the feature extractor component, the feature fusion component, and the decoder are connected to generate the three-dimensional convolutional neural network.
3. The method according to claim 2, characterized in that, The three-dimensional convolutional neural network was trained using the following method: Initialize the untrained 3D convolutional neural network; and input the training dataset into the 3D convolutional neural network to obtain a prediction probability map; Calculate the loss value based on the predicted probability map and the true segmentation labels in the training dataset; Based on the loss value, the parameters in the three-dimensional convolutional neural network are updated to obtain the updated model; Based on the validation set, calculate the performance metrics of the updated model; and determine the training strategy based on the performance metrics. The training strategy is used to instruct the updated model to proceed to the next round of training or to stop training. The updated model that has stopped training is identified as the trained 3D convolutional neural network.
4. The method according to claim 3, characterized in that, The step of calculating the loss value based on the predicted probability map and the true segmentation labels in the training dataset includes: Based on the predicted probability map and the true segmentation labels, the main output loss is calculated using the following formula: in, The main output loss is defined as i, where i is the voxel index and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. The true label value of the i-th voxel; Based on the actual segmentation labels and the side output prediction probability map, the side output loss is calculated; the side output prediction probability map is a segmentation prediction map obtained from the intermediate layer of the decoder. Based on the predicted probability map and the true segmentation labels, the hard sample focusing loss is calculated using the following formula: in, The hard sample focusing loss is defined as follows: i is the voxel index, and N is the total number of primes in the current sample. The model predicts the probability for the i-th voxel. Let i be the true label value of the i-th voxel. To balance the weights for each category, To focus parameters, Predict the true class probability for the i-th voxel; The loss value is obtained by weighted summation of the main output loss, the side output loss, and the hard sample focusing loss.
5. The method according to claim 4, characterized in that, The side-output loss is calculated based on the true segmentation label and the side-output prediction probability map, including: Based on the spatial dimensions of the side-output prediction probability map, the real segmentation label is downsampled to obtain the downsampled real label. Based on the downsampled real labels and the side output predicted probability map, the scalar loss value corresponding to the side output predicted probability map is calculated using the Dice similarity coefficient; The side output loss is obtained by weighted summation of all the scalar loss values using the following formula: in, Let be the side output loss, d be the index of the side output depth, and D be the total number of side outputs. Output the corresponding weight coefficient for the d-th side. Let d be the Dice loss of the output on the d-th side.
6. The method according to claim 1, characterized in that, The step of comparing the probability value of each voxel in the three-dimensional probability map with the global probability threshold to obtain a binary three-dimensional segmentation mask includes: The probability values in the three-dimensional probability graph are divided into multiple intervals, and the number of voxels in each interval is calculated to obtain a probability value histogram. Based on the probability value histogram, a candidate threshold is set; and the classification ratio of each voxel after the three-dimensional probability map is segmented by the candidate threshold and the average probability of the corresponding classification ratio are calculated. Based on the classification ratio and the average probability, calculate the inter-class variance corresponding to the candidate threshold: and determine the candidate threshold that maximizes the inter-class variance as the global probability threshold; Traverse each voxel in the three-dimensional probability map. If the probability value of the voxel is not less than the global probability threshold, then mark the voxel as the blood vessel; and mark the remaining voxels as the background to obtain the binary three-dimensional segmentation mask.
7. The method according to claim 6, characterized in that, The morphological optimization of the binary 3D segmentation mask to obtain a 3D blood vessel segmentation mask includes: Traverse the binary 3D segmentation mask, assign unique labels to all regions formed by voxel connections representing blood vessels to obtain connected regions; and calculate the volume of the connected regions. The connected regions whose volume is smaller than a preset volume threshold are removed to obtain a denoised binary segmentation mask; Perform a closing operation on the denoised binary segmentation mask to obtain a filled binary segmentation mask; An opening operation is performed on the filled binary segmentation mask to obtain the three-dimensional blood vessel segmentation mask.
8. A cerebral vascular CTA segmentation system based on a three-dimensional convolutional network, characterized in that, The system includes: The stacking module is used to acquire two-dimensional slice files of cerebral blood vessels; and stack the two-dimensional slice files according to their spatial position to obtain three-dimensional CTA volume data; An enhancement module is used to enhance the contrast of the three-dimensional CTA volume data based on preset window width and window level values to obtain three-dimensional image volume data within the target range. The probability module is used to input the three-dimensional image volume data into a preset three-dimensional convolutional neural network to obtain a three-dimensional probability map; The comparison module is used to compare the probability value of each voxel in the three-dimensional probability map with the global probability threshold to obtain a binary three-dimensional segmentation mask. An optimization module is used to perform morphological optimization on the binary three-dimensional segmentation mask to obtain a three-dimensional blood vessel segmentation mask; the three-dimensional blood vessel segmentation mask is used to characterize the morphology of the cerebral blood vessels.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.