An automatic three-dimensional spine MR image segmentation apparatus

By constructing the TransUNet network and combining encoder and decoder structures, the limitations of existing three-dimensional spinal MR image segmentation methods are overcome, achieving high-precision spinal structure segmentation and supporting doctors in developing treatment plans.

CN115372872BActive Publication Date: 2026-03-20UNIV OF SHANGHAI FOR SCI & TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing spinal segmentation methods are not applicable to 3D spinal MR images and have limitations in focusing on local features, failing to extract global features.

Method used

The TransUNet network, combining encoder and decoder structures, uses 3 convolutional layers and 12 transformer blocks to extract local and global features of spine images for automatic 3D spine MR image segmentation.

Benefits of technology

It improves the accuracy of spinal medical image segmentation, is applicable to three-dimensional spinal MR images, and can accurately segment spinal structures to assist doctors in developing treatment plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115372872B_ABST
    Figure CN115372872B_ABST
Patent Text Reader

Abstract

The application discloses a kind of three-dimensional spinal MR image automatic segmentation detection methods, comprising the following steps: obtaining three-dimensional spinal MR image, become data set, and data set is divided into training set and test set;The three-dimensional spinal MR image obtained is preprocessed, the three-dimensional image in training set is converted into two-dimensional slice data, and the three-dimensional image in test set is compressed into h5 file;TransUNet network is constructed, and TransUNet network is trained using training set, and the trained network model is obtained;The data in test set is segmented using the trained network model Test, obtain the segmentation result of prediction;The three-dimensional spinal MR image to be segmented is input into the trained network model, and the segmentation result is obtained.The three-dimensional spinal MR image automatic segmentation device of the application is suitable for spinal MR image, and local features can be extracted also global features of image can be extracted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of medical image segmentation processing, and particularly relates to a three-dimensional spinal MR image automatic segmentation device. BACKGROUND

[0002] The spine maintains and supports the body and its organs in the musculoskeletal system, maintains people's daily activities and joint rotation, and protects the spinal cord from damage caused by external force impact. With the rapid development of society, people spend more and more time sitting, almost every day in a long time to maintain a posture, the spine keeps the same state for a long time, which can make the spine stiff, accumulate chronic strain, increase joint pressure, and cause spinal diseases, such as cervical degeneration, lumbar disc herniation, etc. MRI is a fast, high-quality and detailed imaging method in 3D imaging of the spine, which generates a 3D spine image by generating a strong magnetic field and a radio frequency pulse. Manually marking the vertebral region from a medical image is very time-consuming, and manually marking the vertebrae has subjectivity, which is very easy to have scoring differences. Automatic segmentation of the vertebrae can prevent these differences and reduce the workload of physicians, so the automatic positioning and segmentation method is very desirable in clinical diagnosis. And accurate spinal segmentation is the basis for spinal registration and the establishment of a three-dimensional model of the spine; based on the segmentation result, a three-dimensional model can be reconstructed to segment and identify the spine, spinal cord and lumbar disc structure and locate the lesion area, assist doctors in determining the treatment plan for patients, and evaluate the effectiveness of the treatment plan, such as helping doctors to determine the pedicle screw insertion point and simulate the screw insertion channel, determine the screw insertion position, direction and depth, and avoid injury to important nerves and blood vessels. Therefore, it is of great significance to develop an auxiliary segmentation method for the spine.

[0003] In the prior art, U-shaped network U-Net and its variant network are used to train and predict spinal segmentation. In the prior art, convolution is used in the left part of the network to downsample the spinal image, up-sampling is used in the right half of the network to restore the resolution of the spinal image reduced during down-sampling, the segmentation result is output in the output part of the network, and CT spinal image is used as an embodiment of the application. However, it is not suitable for three-dimensional spinal MR image and has low applicability. Convolution operation is used for segmentation, and convolution operation has the limitation of focusing on local features, and the global features of the spinal image are not fully utilized when training the network. SUMMARY

[0004] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present application is that the existing spinal segmentation method is not suitable for three-dimensional spinal MR image, and has the limitation of focusing on local features, and cannot extract global features. The present application provides a three-dimensional spinal MR image automatic segmentation device, which is suitable for spinal MR image and can extract local features and global features of the image.

[0005] To achieve the above object, the application provides a three-dimensional spine MR image automatic segmentation detection method, comprising the following steps:

[0006] Obtain a three-dimensional spine MR image, form a data set, and divide the data set into a training set and a test set;

[0007] Preprocess the obtained three-dimensional spine MR image, convert the three-dimensional image in the training set into two-dimensional slice data, and compress the three-dimensional image in the test set into an h5 file;

[0008] Construct a TransUNet network, train the TransUNet network using the training set, and obtain a trained network model;

[0009] Use the trained network model to perform segmentation testing on the data in the test set, and obtain a predicted segmentation result;

[0010] Input the three-dimensional spine MR image to be segmented into the trained network model, and obtain a final segmentation result.

[0011] Further, obtain a three-dimensional spine MR image, form a data set, and divide the data set into a training set and a test set, specifically comprising the following steps:

[0012] Obtain a three-dimensional spine MR image including an annotated spine T2 weighted sagittal MR image data set, obtain a segmentation mask legend of each vertebra region of the spine; the segmentation mask legend includes 20 categories, including background, 10 blocks of vertebrae and 9 blocks of intervertebral discs, and the 20 categories are distinguished by different gray levels;

[0013] The first few images of the segmented mask legend are used as the test set, and the remaining images are used as the training set.

[0014] Further, the number of images in the test set is less than the number of images in the training set.

[0015] Further, preprocess the obtained three-dimensional spine MR image, convert the three-dimensional image in the training set into two-dimensional slice data, and compress the three-dimensional image in the test set into an h5 file, specifically comprising the following steps:

[0016] Convert the three-dimensional spine MR image from nii.gz format to numpy format, crop the image in the [-125, 275] region, and normalize the cropped three-dimensional image to [0, 1] to form two-dimensional slices, extract the two-dimensional slices of each image from the training set image as the final training set, and compress the images in the test set into npy.h5 format files for testing as the final test set.

[0017] Further, the TransUNet network is constructed, and the TransUNet network is trained using the training set to obtain a trained network model, including:

[0018] The TransUNet network is divided into an encoder and a decoder, the encoder is composed of 3 convolutional layers and 12 transformer blocks, the encoder extracts features of the input two-dimensional slice, the decoder includes upsampling, convolution and skip connection, the decoder expands the features in the encoder to the same size as the original input image, and outputs a predicted segmentation map.

[0019] Further, a transformer block includes layer normalization LN, attention calculation MSA, residual connection and multi-layer perception connection MLP; before the output of the 3 convolutional layers is input into the 12 transformer blocks, the model expands the 2-dimensional image data into a 1-dimensional sequence as the conventional input data of the transformer.

[0020] Another embodiment of the application provides a three-dimensional spine MR image automatic segmentation device, comprising:

[0021] A spine MR image acquisition device is used to acquire a three-dimensional spine MR image, which becomes a data set, and the data set is divided into a training set and a test set;

[0022] A spine MR image preprocessing device is used to preprocess the acquired three-dimensional spine MR image, convert the three-dimensional image in the training set into two-dimensional slice data, and compress the three-dimensional image in the test set into an h5 file;

[0023] A spine MR image construction device is used to construct a TransUNet network, and train the TransUNet network using the training set to obtain a trained network model;

[0024] A spine MR image auxiliary segmentation device is used to segment the test set data using the trained network model to obtain a predicted segmentation result;

[0025] A spine MR image segmentation device is used to input the three-dimensional spine MR image to be segmented into the trained network model to obtain a final segmentation result.

[0026] Further, the spine MR image preprocessing device includes an MR image cropping and normalization unit, a training set data conversion unit and a test set data conversion unit, which are used to crop, normalize, convert the training set data format and convert the test set data of the three-dimensional spine MR image, respectively.

[0027] Further, the spinal column MR image construction device is specifically configured to divide the TransUNet network into two parts of an encoder and a decoder, the encoder is composed of 3 convolutional layers and 12 transformer blocks, the encoder extracts features of the input two-dimensional slice, the decoder includes upsampling, convolution and skip connection, the decoder expands the features in the encoder to the same size as the original input image, and outputs a predicted segmentation map.

[0028] A computer device is provided in another preferred embodiment of the present application, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method according to any one of claims 1-6 when executing the program.

[0029] The three-dimensional spinal MR image automatic segmentation method provided by the present application trains a network model for three-dimensional spinal MR images, is suitable for automatic segmentation of three-dimensional spinal MR images, introduces a transformer method, combines with a U-shaped network U-Net, has the characteristics of extracting local features and global features of the spinal image at the same time, and improves the accuracy of spinal medical image segmentation.

[0030] The concept, specific structure and technical effects of the present application will be further described below with reference to the accompanying drawings, so as to fully understand the purpose, features and effects of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0031] Figure 1 is a flowchart of a three-dimensional spinal MR image automatic segmentation method of a preferred embodiment of the present application;

[0032] Figure 2 is a TransUNet method network architecture used by a three-dimensional spinal MR image automatic segmentation method of a preferred embodiment of the present application;

[0033] Figure 3 is a spinal column segmentation result of a three-dimensional spinal MR image automatic segmentation method of a preferred embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the technical problems to be solved by the present application, the technical solutions and beneficial effects more clearly understood, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0035] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular procedures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

[0036] As shown in Figure 1 The embodiment of the present application provides a three-dimensional spine MR image automatic segmentation detection method, which comprises the following steps:

[0037] Step 100, acquiring a three-dimensional spine MR image as a data set, and dividing the data set into a training set and a test set; acquiring the three-dimensional spine MR image includes an annotated spine T2 weighted sagittal MR image data set, obtaining a segmentation mask legend of each vertebra region of the spine; the segmentation mask legend includes 20 categories, including background, 10 vertebrae and 9 intervertebral discs, and the 20 categories are distinguished by different gray levels; in this embodiment, 172 voxel-level labeled three-dimensional images; the first few images of the segmentation mask legend after the distinction are used as the test set, and the remaining images are used as the training set; in this embodiment, after the gray level distinction, the first 30 images are used as the test set, and the remaining 142 images are used as the training set.

[0038] Step 200, preprocessing the acquired three-dimensional spine MR image, converting the three-dimensional image in the training set into two-dimensional slice data, and compressing the three-dimensional image in the test set into an h5 file; converting the three-dimensional spine MR image from nii.gz format to numpy format, and clipping the image in the [-125, 275] region, and normalizing the clipped three-dimensional image to [0, 1] to form a two-dimensional slice, extracting the two-dimensional slice of each image from the training set image as the final training set, and compressing the image in the test set into an npy.h5 format file for testing as the final test set.

[0039] Step 300, constructing a TransUNet network, and training the TransUNet network using the training set to obtain a trained network model; the TransUNet network is divided into an encoder and a decoder, the encoder is composed of 3 convolutional layers and 12 transformer blocks, the encoder extracts features from the input two-dimensional slice, the decoder includes upsampling, convolution and skip connection, the decoder expands the features in the encoder to the same size as the original input image, and outputs a predicted segmentation map.

[0040] The three convolutional layers of the encoder are connected after a convolutional layer with a step size of 2 and a convolution kernel size of 7*7, and each of the three convolutional layers includes 3*3 convolution, 1*1 convolution, group normalization, and RELU activation. After the 7*7 convolution of the spine image input into the encoder, the image enters the three convolutional layers, and each convolutional layer performs 1*1 convolution, 3*3 convolution, and 1*1 convolution in sequence. After each convolution, group normalization and a RELU activation function are connected. The result obtained by each convolutional layer is added to the input of the current convolutional layer to perform residual connection to obtain the final result of the three convolutional layers.

[0041] A transformer block includes layer normalization LN, attention calculation MSA, residual connection, and multi-layer perception connection MLP. Before the results output by the three convolutional layers are input into 12 transformer blocks, the model expands the two-dimensional image data into a one-dimensional sequence as the conventional input data of the transformer; define the expanded one-dimensional sequence as X, and the position identifier as E pos ,E pos In the model, the parameters are obtained through model training, and the final input of the transformer is formula (1)

[0042] Z0=X+E pos (1)

[0043] In the transformer, Z0 first undergoes layer normalization LN and then attention calculation. The attention calculation is as shown in formula (2-3). The normalized Z0 undergoes linear mapping to generate Q, K, and V three vectors. The attention first multiplies Q and K to obtain a score, then normalizes the score to maintain the stability of the model gradient, then uses the Softmax function to activate and then multiplies V to obtain the attention calculation result.

[0044] Q, K, V=Linear(Z0) (2)

[0045]

[0046] wherein is the attention head dimension, and is the length of Z0 divided by the number of initialized attention heads of the model.

[0047] After the attention calculation is completed, the initial Z0 is added to perform residual connection. After the residual connection, layer normalization and multi-layer perception connection are performed once, and then residual connection is performed again to obtain an output result of a transformer block. The whole process is as shown in formula (4). Each transformer block has the same calculation steps.

[0048] Z' = MLP(LN(MSA(LN(Z0) + Z0)) + (MSA(LN(Z0)) + Z0) (4)

[0049] The decoder includes upsampling, convolution, and jump connection. The result output by the last transformer block is inversely unfolded to convert the one-dimensional sequence into two-dimensional data. The converted two-dimensional data is first subjected to 3x3 convolution with a step of 1, and then subjected to bilinear upsampling interpolation. Referring to Figure 2 The data after the first upsampling is spliced with the output result of the last layer of the three-layer convolution in the encoder, and then subjected to 3x3 convolution with a step of 1. Then, 3x3 convolution with a step of 1 and bilinear upsampling interpolation are repeated, and the output result of the corresponding three-layer convolution in the encoder is spliced. The decoder performs 3x3 convolution with a step of 1, bilinear upsampling interpolation, and splicing operation a total of 4 times. After 4 times of convolution, linear interpolation, and splicing operation, the model is subjected to 3x3 convolution with a step of 1 and a segmentation head to obtain the final training result of the model. The segmentation head includes convolution and upsampling operation.

[0050] At step 400, the trained network model is used to test the data in the test set to obtain the predicted segmentation result. The unlabeled three-dimensional spine MR image in the test set data is segmented into two-dimensional slices and sent into the trained model. The model outputs the predicted segmentation result of the slice. Then, the slices are recombined into a three-dimensional image to obtain the predicted segmentation result of the three-dimensional spine MR image.

[0051] In the embodiment, after the acquired spine MR image data is divided into a training set and a test set, the test set data is first preprocessed. In the spine MR image preprocessing device, the three-dimensional spine MR image is first converted into a numpy multidimensional array format, and each three-dimensional spine MR image sagittal plane is extracted as two-dimensional slice data in the data. The extracted two-dimensional slice data is cropped, and the minimum value is set to -125 and the maximum value is set to 275, so that the pixel value of each slice is limited within the range of [-125, 275]. Then, the cropped array is normalized, and the normalization calculation is as formula (5).

[0052]

[0053] wherein min is the minimum value of the pixel points of the current slice, max is the maximum value of the pixel points of the current slice, and img_data is the current slice.

[0054] The slice obtained by the MR image cropping and normalization unit is converted into model training and testing data by the training set data conversion unit and the testing set data conversion unit. The training set data conversion unit stores the spine unsegmented mask slice and the corresponding segmented mask slice obtained by the MR image cropping and normalization unit in the same.npz file in the same format. The testing set data conversion unit does not perform slice extraction in the MR image cropping and normalization unit. After normalization, the three-dimensional spine MR unsegmented mask array and the corresponding segmented mask array are stored in the same npy.h5 file.

[0055] The spine MR image construction device inputs the training data in the memory into the TransUNet network in batches for training. In this embodiment, 24 training data are input into the model in each batch for training. The data first enters the encoder part of the TransUNet. In the encoder, a convolution operation with a step size of 2 and a convolution kernel size of 7x7 is first performed. Then, the data is subjected to three convolution layers for convolution, normalization, and RELU activation operation. In each convolution layer, 1x1 convolution, 3x3 convolution, and 1x1 convolution operations are performed once. After each convolution, a normalization and RELU activation function are connected. The result of each layer of convolution is added to the input of the current convolution layer to obtain the final result of the three convolution layers. Before the result of the three convolution layers is input into the 12 transformer blocks, the model expands the two-dimensional image data into a one-dimensional sequence as the conventional input data of the transformer. In each transformer block, layer normalization, attention calculation, residual connection, layer normalization, multi-layer perception connection, and residual connection operations are performed in sequence.

[0056] The 1D sequence obtained by the last transformer block of the encoder is input into the decoder. First, the result output by the last transformer block is inversely expanded to convert the one-dimensional sequence into two-dimensional data. The converted two-dimensional data is subjected to a 3x3 convolution with a step size of 1, followed by bilinear upsampling interpolation. Referring to Figure 2 The data after the first upsampling is concatenated with the output result of the last layer of the three convolution layers in the encoder, and then subjected to a 3x3 convolution with a step size of 1. Then, the 3x3 convolution with a step size of 1, bilinear upsampling interpolation, and concatenation operation are repeated again. The decoder performs the 3x3 convolution with a step size of 1, bilinear upsampling interpolation, and concatenation operation four times. After the four convolution, linear interpolation, and concatenation operations, the model is subjected to a 3x3 convolution with a step size of 1 and a segmentation head to obtain the final training result of the model. In the segmentation head, 3x3 convolution and bilinear upsampling interpolation operations are performed in sequence.

[0057] The spine MR image assisted segmentation device uses the trained TransUNet model to test the data set to generate a segmentation result. The npy.h5 file is input one by one, and the unsegmented mask spine image saved in the npy.h5 file and the labeled segmented mask spine image are extracted respectively. The three-dimensional spine image is divided into slices according to the image sagittal plane. Each slice is input into the trained TransUNet model to obtain the predicted segmentation result of the current slice. After predicting the segmentation result of all slices of the current three-dimensional spine image, all slices are stacked into a three-dimensional image as the final segmentation result predicted by the model.

[0058] Figure 3 The predicted segmentation result in the spine MR image assisted segmentation device in the embodiment of the application is the eighth slice of the predicted segmentation result in the example, because the spine MR image assisted segmentation device divides the final segmentation result into a medical 3D picture.

[0059] Embodiment two

[0060] Another embodiment of the application provides a three-dimensional spine MR image automatic segmentation device, comprising:

[0061] A spine MR image acquisition device is used to acquire a three-dimensional spine MR image, which becomes a data set, and divides the data set into a training set and a test set.

[0062] A spine MR image preprocessing device is used to preprocess the acquired three-dimensional spine MR image, convert the three-dimensional image in the training set into two-dimensional slice data, and compress the three-dimensional image in the test set into an h5 file.

[0063] A spine MR image construction device is used to construct a TransUNet network and train the TransUNet network using the training set to obtain a trained network model.

[0064] A spine MR image assisted segmentation device is used to use the trained network model to segment the test set to obtain a predicted segmentation result.

[0065] A spine MR image segmentation device is used to input a three-dimensional spine MR image to be segmented into the trained network model to obtain a final segmentation result.

[0066] Further, the spine MR image preprocessing device comprises an MR image cropping and normalization unit, a training set data conversion unit, and a test set data conversion unit, which are used to crop, normalize, and convert the training set data and the test set data of the three-dimensional spine MR image, respectively.

[0067] The spinal MR image construction device is specifically used to divide the TransUNet network into two parts: an encoder and a decoder. The encoder consists of 3 convolutional layers and 12 transformer blocks. The encoder extracts features from the input 2D slices. The decoder includes upsampling, convolution, and skip connections. The decoder expands the features in the encoder to the same size as the original input image and outputs the predicted segmentation map.

[0068] The apparatus in this embodiment is used to implement the method steps in Embodiment 1, and its implementation is the same as in Embodiment 1. Therefore, it will not be described again here.

[0069] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. An automatic segmentation and detection method for three-dimensional spinal MR images, characterized in that, Includes the following steps: Three-dimensional spinal MR images are acquired and compiled into a dataset, which is then divided into a training set and a test set. The acquisition of three-dimensional spinal MR images includes a dataset of labeled T2-weighted sagittal MR images of the spine, and the generation of segmentation mask legends for each vertebral region of the spine. The segmentation mask legends include 20 categories, including background, 10 vertebrae and 9 intervertebral discs, and the 20 categories are distinguished by different gray levels. The first few images of the segmented mask pattern after differentiation are used as the test set, and the remaining images are used as the training set. The acquired 3D spinal MR images are preprocessed by converting the 3D images in the training set into 2D slice data and compressing the 3D images in the test set into h5 files. The 3D spinal MR images are converted from nii.gz format to numpy format and cropped into images within the [-125, 275] region. The cropped 3D images are normalized to [0, 1] to form 2D slices. The 2D slices of each image are extracted from the training set images as the final training set. The images in the test set are compressed into npy.h5 format files for testing and serve as the final test set. A TransUNet network is constructed and trained using the training set to obtain a trained network model. The TransUNet network is divided into an encoder and a decoder. The encoder consists of 3 convolutional layers and 12 transformer blocks. The encoder extracts features from the input 2D slices. The decoder includes upsampling, convolution, and skip connections. The decoder expands the features in the encoder to the same size as the original input image and outputs a predicted segmentation map. A transformer block includes layer normalization (LN), attention calculation (MSA), residual connections, and multilayer perceptual connections (MLP). Before the output of the 3 convolutional layers is input into the 12 transformer blocks, the model unfolds the 2D image data into a 1D sequence as the regular input data for the transformer. The computation steps are the same for each transformer block. Z'=MLP(LN(MSA(LN(Z0))+Z0))+( MSA(LN(Z0))+Z0) Let X be the unfolded 1D sequence, and E be the position identifier. pos E pos In the model, the parameters are obtained through model training, and the final input of the transformer is Z0 = X + E. pos In this process, Z0 is first processed through a layer-normalized LN before attention calculation, and E... pos The parameters in the model are obtained through model training. The trained network model is used to perform segmentation tests on the data in the test set to obtain the predicted segmentation results; The three-dimensional spine MR image to be segmented is input into the trained network model to obtain the final segmentation result.

2. The automatic segmentation and detection method for three-dimensional spinal MR images as described in claim 1, characterized in that, The number of legends in the test set is less than the number of legends in the training set.

3. An automatic segmentation device for three-dimensional spinal MR images, characterized in that, include: A spinal MR image acquisition device is used to acquire three-dimensional spinal MR images, which are then compiled into a dataset, and the dataset is divided into a training set and a test set. The acquisition of three-dimensional spinal MR images includes a dataset of labeled T2-weighted sagittal MR images of the spine, resulting in segmentation mask legends for each vertebral region of the spine. The segmentation mask legends include 20 categories, including background, 10 vertebrae, and 9 intervertebral discs, and different gray levels are used to distinguish the 20 categories. The first few images of the segmentation mask legends after differentiation are used as the test set, and the remaining legends are used as the training set. A spinal MR image preprocessing device is used to preprocess acquired three-dimensional spinal MR images, convert the three-dimensional images in the training set into two-dimensional slice data, compress the three-dimensional images in the test set into h5 files; convert the three-dimensional spinal MR images from nii.gz format to numpy format, and crop them into images within the [-125, 275] region, and normalize the cropped three-dimensional images to [0, 1] to form two-dimensional slices; extract the two-dimensional slices of each image from the training set images as the final training set; and compress the images in the test set into npy.h5 format files for testing, serving as the final test set. A spinal MR image construction device is used to construct a TransUNet network and train the TransUNet network using the training set to obtain a trained network model. The TransUNet network is divided into an encoder and a decoder. The encoder consists of 3 convolutional layers and 12 transformer blocks. The encoder extracts features from the input 2D slices. The decoder includes upsampling, convolution, and skip connections. The decoder expands the features in the encoder to the same size as the original input image and outputs a predicted segmentation map. A transformer block includes layer normalization (LN), attention calculation (MSA), residual connections, and multilayer perceptual connections (MLP). Before the output of the 3 convolutional layers is input into the 12 transformer blocks, the model unfolds the 2D image data into a 1D sequence as the regular input data for the transformer. The computation steps for each transformer block are the same. Z'=MLP(LN(MSA(LN(Z0))+Z0))+( MSA(LN(Z0))+Z0) Let X be the unfolded 1D sequence, and E be the position identifier. pos E pos In the model, the parameters are obtained through model training, and the final input of the transformer is Z0 = X + E. pos In this process, Z0 is first processed through a layer-normalized LN before attention calculation, and E... pos The parameters in the model are obtained through model training. A spinal MR image-assisted segmentation device is used to perform segmentation tests on the data in the test set using the trained network model to obtain predicted segmentation results; A spinal MR image segmentation device is used to input a three-dimensional spinal MR image to be segmented into the trained network model to obtain the final segmentation result.

4. The automatic segmentation device for three-dimensional spine MR images as described in claim 3, characterized in that, The spinal MR image preprocessing device includes an MR image cropping and normalization unit, a training set data conversion unit, and a test set data conversion unit, which respectively perform cropping, normalization, training set data format conversion, and test set data conversion on the three-dimensional spinal MR image.

5. The automatic segmentation device for three-dimensional spine MR images as described in claim 4, characterized in that, The spinal MR image construction device is specifically used to divide the TransUNet network into two parts: an encoder and a decoder. The encoder consists of 3 convolutional layers and 12 transformer blocks. The encoder extracts features from the input 2D slices. The decoder includes upsampling, convolution, and skip connections. The decoder expands the features in the encoder to the same size as the original input image and outputs the predicted segmentation map.

6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-2.

Citation Information

Patent Citations

  • High-precision layer segmentation method for retinal OCT three-dimensional image

    CN111696109A