Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a blood vessel image segmentation method, which can segment an iris blood vessel image and improve the segmentation effect of the iris blood vessel image, and the technical scheme of the present invention is as follows:
a method of vessel image segmentation, the method comprising:
s1, acquiring an original blood vessel image and preprocessing the original blood vessel image to obtain a training set image;
s2, inputting the preprocessed training set image into a neural network model for training;
the neural network model comprises a coding module, a decoding module and a residual error module, wherein the coding module comprises four coding layers, each coding layer comprises a convolution layer and a maximum pooling layer, and the coding module is used for performing downsampling operation on an input training set image to obtain a feature map;
the decoding module comprises four decoding layers, each decoding layer comprises an attention block and a deconvolution layer, the decoding module is used for performing up-sampling operation on the feature map to obtain a segmented image, and the encoding module corresponds to the decoding module in structure;
the residual error module comprises four upsampling layers obtained by performing continuous four times of upsampling according to the feature map of the deepest layer obtained by the downsampling of the coding module;
wherein, the input of the attention block in the decoding module specifically comprises a first input from the encoding module, a second input of the residual module, and a third input, and the third input is a decoding output of the attention block at a higher layer in the encoding module; the attention block executes a process including superimposing the first input, the second input and the third input and activating by a function, resampling the activated features, fusing the resampled features with the first input and the second input, and inputting the fused features into an deconvolution layer in the decoding module;
and S3, processing the blood vessel image by using the trained neural network model to obtain a blood vessel image segmentation result.
Further, the feature after resampling is fused with the first input and the second input through a first formula, where the first formula specifically includes:
wherein i represents the ith down-sampling layer in the encoding module, N represents all down-sampling layers of the encoding module,
represents the 2 nd down-sampling layer in the coding module, C () represents the convolution calculation, D () representsSampling operation, U () represents an upsampling operation, and]indicating a feature connection.
The invention has the beneficial effects that: the various parts of the decoder are connected to the upsampling of the base layer. By repeatedly using the high-level semantic feature map, the position information in the image can be acquired from a complete scale, and the accurate segmentation is facilitated, particularly for the detail region of the iris blood vessel. Can cut apart to iris blood vessel image, promote iris blood vessel image and cut apart the effect.
Detailed Description
The technical scheme of the invention is further described by combining the drawings and the embodiment:
the embodiment provides a blood vessel image segmentation method, which can be implemented by a terminal, as shown in fig. 1, including:
step 1, a terminal acquires an original blood vessel image and carries out preprocessing to obtain a training set image, wherein a data set comprises 50 iris blood vessel images from 50 different patients. To facilitate subsequent network training, the training and testing data sets are partitioned according to preprocessing by setting the image size to be 512 × 512, 4:1, and using binary cross entropy as an optimized loss function.
Step 2, inputting the training set image obtained by preprocessing into a neural network model by the terminal for training;
the neural network model comprises a coding module, a decoding module and a residual error module, wherein the coding module comprises four coding layers, each coding layer comprises a convolution layer and a maximum pooling layer, and the coding module is used for performing downsampling operation on an input training set image to obtain a feature map;
the decoding module comprises four decoding layers, each decoding layer comprises an attention block and a deconvolution layer, the decoding module is used for performing up-sampling operation on the feature map to obtain a segmented image, and the coding module corresponds to the decoding module in structure;
the residual error module comprises four upsampling layers obtained by performing continuous four times of upsampling according to the characteristic diagram of the deepest layer obtained by the downsampling of the coding module;
the input of the attention block in the decoding module specifically comprises a first input from the encoding module, a second input of the residual error module and a third input, wherein the third input is the decoding output of the attention block in the upper layer of the encoding module; note that the process performed by the block includes superimposing the first input, the second input, and the third input and activating by a function, resampling the activated features, fusing the resampled features with the first input and the second input, and inputting the fused features into the deconvolution layer in the decoding module.
In the one training process in the embodiment of the present application, the terminal inputs the iris blood vessel image with a size of 512 × 512 into the neural network model, the first convolution operation uses a convolution kernel with a size of 7 × 7, the step size is set to 2, the image size is adjusted to 256 × 0256, and the maximum pool operation is performed, where the maximum pool operation is used for downsampling to reduce the size of the feature mapping. In the second layer of the coding module, the obtained 256 × 1256 feature map is continuously subjected to convolution operations 3 times, wherein each convolution operation is to perform convolution twice by 3 × 23, adjust the image size to 128 × 3128, and then perform the maximum pool operation of the second layer of the coding module. In the third layer of the coding module, the obtained 128 × 128 feature map is continuously subjected to 4 convolution operations, wherein each convolution operation is to perform 3 × 3 convolution twice, the image size is adjusted to 64 × 64, and then the maximum pool operation of the third layer of the coding module is performed. In the fourth layer of the coding module, the obtained 64 × 64 feature map is continuously subjected to convolution operations 3 times, wherein each convolution operation is to perform convolution twice by 3 times, the image size is adjusted to 32 × 32, and then the maximum pool operation of the fourth layer of the coding module is performed. Performing convolution operation for 3 times on the output obtained at the fourth layer of the coding module, wherein each convolution operation is to perform convolution for 3 times by 3 times, and obtain a bottom layer characteristic diagram of 1616 and a depth of 512. It can be seen that the coding module encodes the feature maps for different depths for each layer, where i represents the layer number of the encoder. Characteristic map size of the i-th layer is 512/2i。
In the residual module, the underlying resolution 16 × 16 feature maps are convolved for 4 consecutive times to obtain 32 × 32, 64 × 64, 128 × 128, and 256 × 256 feature maps, which correspond to the fourth, third, second, and first layers in the coding module, respectively.
The decoding module comprises attention blocks (a dotted line frame in fig. 1), the input of each layer of attention block comprises the input from a coding module, a residual error module and a layer before the decoding module in the same layer, the specific operation in the decoding module is as shown in fig. 2, after convolution of a first input from the coding module, a second input from the residual error module and a third input in the upper layer in the coding module, the first input, the second input and the third input are firstly superposed and activated through a Relu function, convolution of 1 × 1 × 1 is carried out, then a Sigmoid function is activated and resampling is carried out, the resampled features are fused with the first input and the second input, and the fused features are input into an deconvolution layer in the decoding module.
Wherein the resampled features are fused with the first input and the second input via a first formula, wherein the first formula specifically comprises:
wherein i represents the ith down-sampling layer in the encoding module, N represents all down-sampling layers of the encoding module,
represents the 2 nd downsampling layer in the coding module, C () represents the convolution calculation, D () represents the downsampling operation, U () represents the upsampling operation, and]indicating a feature connection.
And 3, processing the blood vessel image by the terminal by using the trained neural network model to obtain a blood vessel image segmentation result.
Finally, we used joint crossing (MIoU) as an index to evaluate network performance. Under the condition that all experimental parameters are set to be the same, compared with the Unet image segmentation network without the residual error module and the attention block in the prior art, the MIoU is reduced by about 1.6% compared with the neural network model in the present application, which indicates that the performance of the image segmentation processing is improved by adding the residual error module and the attention block in the embodiment of the present application.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the above teachings, and that all such modifications and variations are intended to be within the scope of the invention as defined in the appended claims.