A three-dimensional image segmentation method and device based on registration enhancement and dynamic position coding
By slicing and inter-layer fusion of three-dimensional images based on registration enhancement and dynamic position encoding methods, the problem of low precision and accuracy in two-dimensional image segmentation processing is solved, and higher image segmentation accuracy and anti-noise capabilities are achieved. .
Patent Information
- Application Number
- CN202410924066.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-11
AI Technical Summary
The two-dimensional image segmentation processing of three-dimensional entities in the existing technology has the problem of low image processing precision and accuracy, mainly due to the lack of spatial information and noise interference of the two-dimensional image on the three-dimensional entity.
A three-dimensional image segmentation method based on registration enhancement and dynamic position encoding is adopted. The image to be segmented and the auxiliary image are obtained by slicing the three-dimensional image. The first image segmentation model is used to perform pixel-by-pixel segmentation processing, and a dynamic position encoding map is constructed. Combined with the auxiliary image The image undergoes inter-layer fusion and registration mapping, and is input into the second image segmentation model for multi-head self-attention feature extraction to obtain high-precision segmentation results.
It improves the precision and accuracy of image segmentation, enhances the ability to perceive spatial semantic features, makes up for the lack of spatial information of three-dimensional entities in two-dimensional images, and improves the anti-noise ability to obtain higher segmentation processing effects.
Smart Images

Figure CN118470035B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a three-dimensional image segmentation method and device based on registration enhancement and dynamic position coding. Background Art
[0002] As machine vision gradually develops and matures, its application in daily life and production is becoming more and more extensive. For example, in the industrial field, images are segmented and recognized to detect manufactured devices; in the road traffic field, images are segmented and recognized to assist in autonomous driving.
[0003] In the image recognition process, when the imaging object is a three-dimensional entity, there are two main ways to perform image segmentation: directly perform image segmentation on the three-dimensional image; or slice the three-dimensional entity to obtain a two-dimensional image, and perform image segmentation on the two-dimensional image. Among them, for the first method, since the corresponding algorithm is trained in the early stage and the subsequent application is aimed at three-dimensional images, it not only consumes a lot of computing resources such as memory and video memory, but also has a large amount of training data and difficulty, which leads to high overhead and difficulty in the final actual application. Based on this, the above second method is more common in actual image processing when the imaging object is a three-dimensional entity.
[0004] However, the inventors have found that the above-mentioned image segmentation processing method for the two-dimensional image still has the following defects: on the one hand, since the imaged object itself is a three-dimensional entity, the two-dimensional image lacks spatial information for the three-dimensional entity; on the other hand, noise interference is introduced during the slice acquisition and reconstruction process of the two-dimensional image. All these lead to the problem of low image processing precision and accuracy in the final image segmentation result. Summary of the invention
[0005] The purpose of the present invention is to provide a three-dimensional image segmentation method and device based on registration enhancement and dynamic position coding, so as to improve the technical problem of low image processing precision and accuracy when processing two-dimensional images corresponding to three-dimensional entities in the prior art.
[0006] To achieve the above object, the present invention proposes the following technical solutions:
[0007] In the first aspect, the technical solution provides a three-dimensional image segmentation method based on registration enhancement and dynamic position coding. It includes:
[0008] Acquire a three-dimensional image corresponding to the three-dimensional entity to be detected, and slice the three-dimensional image to obtain an image to be segmented and a plurality of auxiliary images; wherein the image to be segmented and the auxiliary images are both two-dimensional images, and the auxiliary images are adjacent layer images of the image to be segmented in the slicing process;
[0009] Performing image processing on the image to be segmented based on the first image segmentation model to obtain a segmentation result of each pixel in the image to be segmented, and performing dynamic position coding on the segmentation results of all pixels to obtain a dynamic position coding map;
[0010] Among them, the dynamic position encoding method is:
[0011] when P When (i,j)=0, E (i,j)=0;
[0012] when P When (i,j)=1,
[0013] ;
[0014] in, P (i,j) represents the segmentation result of the pixel at the i-th row and j-th column. P (i,j)=0 means the pixel at the current position is a non-target area. P (i,j)=1 means the current pixel is the target area. sum Represents the total number of pixels in the image to be detected, Index (i,j) x The pixels representing all target areas are arranged and numbered in a horizontal one-dimensional manner. The pixel at position (i, j) is the number of the pixel in the horizontal one-dimensional arrangement. Index (i,j) y The pixels representing all target areas are arranged and numbered in one dimension in the vertical direction, and the number of the pixel at position (i, j) in the one dimension in the vertical direction;
[0015] Mapping each auxiliary image to the image to be segmented through transformation registration to obtain each enhanced image corresponding to each auxiliary image, and inter-layer fusion of the image to be segmented and each enhanced image to obtain a fused enhanced image; wherein the morphology and structure of the enhanced image are consistent with the image to be segmented;
[0016] The dynamic position coding map and the fused enhanced image are input into a second image segmentation model to perform multi-head self-attention feature extraction on them based on an attention mechanism, thereby obtaining a segmentation processing result corresponding to the image to be segmented.
[0017] Furthermore, mapping each auxiliary image to the image to be segmented through transformation and registration to obtain each enhanced image corresponding to each auxiliary image includes:
[0018] The image to be segmented is defined as an N-th layer image, and the auxiliary images are respectively an N-1-th layer image and an N+1-th layer image;
[0019] Input the Nth layer image and the N-1th layer image into a deep learning network to obtain a first deformation field corresponding to the N-1 layer image before and after registration; at the same time, input the Nth layer image and the N+1 layer image into a deep learning network to obtain a second deformation field corresponding to the N+1 layer image before and after registration;
[0020] The N-1th layer image and the N+1th layer image are subjected to bilinear difference sampling based on the first deformation field and the second deformation field as standards respectively to obtain enhanced images corresponding thereto respectively.
[0021] Furthermore, the image to be segmented is all two-dimensional images after the three-dimensional image is sliced; after obtaining the segmentation processing result corresponding to the image to be segmented; comprising:
[0022] Based on the segmentation processing result, all the images to be segmented are screened to obtain all the target images containing the target area;
[0023] Based on the position coordinates in the slicing process of the three-dimensional image, all target images are three-dimensionally reconstructed and the segmentation processing result of each target image is displayed, thereby obtaining the three-dimensional segmentation processing result corresponding to the three-dimensional image.
[0024] Furthermore, the image processing is performed on the image to be segmented based on the first image segmentation model to obtain a segmentation result of each pixel in the image to be segmented; comprising:
[0025] Get the segmentation result as P The statistical number of pixels where (i,j)=1;
[0026] If it is determined that the statistical number is greater than a preset number threshold, the subsequent steps are continued; otherwise, the image to be segmented is reacquired.
[0027] Furthermore, the first image segmentation model and the second image segmentation model are both built based on a deep learning network;
[0028] Among them, the basic network structure of the first image segmentation model includes: a first encoder, a first decoder and a first output layer in sequence; the first encoder includes: a convolution operation, a group normalization operation, a ReLU activation function operation, and a pooling operation in sequence; the first decoder includes: an upsampling operation, a convolution operation, a group normalization operation, and a ReLU activation function operation in sequence; the first output layer includes: a convolution operation and a group normalization operation in sequence;
[0029] The basic network structure of the second image segmentation model includes: a second encoder, a second decoder and a second output layer in sequence; the second encoder includes: a multi-head self-attention feature extraction operation, a group normalization operation, a ReLU activation function operation, and a pooling operation in sequence; the second decoder includes: an upsampling operation, a multi-head self-attention feature extraction operation, a group normalization operation, and a ReLU activation function operation in sequence; the second output layer includes: a multi-head self-attention feature extraction operation and a group normalization operation in sequence.
[0030] In the second aspect, the technical solution provides a three-dimensional image segmentation device based on registration enhancement and dynamic position coding. It includes:
[0031] An image acquisition module, used to acquire a three-dimensional image corresponding to the three-dimensional entity to be detected, and slice the three-dimensional image to obtain an image to be segmented and a plurality of auxiliary images; wherein the image to be segmented and the auxiliary images are both two-dimensional images, and the auxiliary images are adjacent layer images of the image to be segmented in the slicing process;
[0032] A first segmentation module, configured to perform image processing on the image to be segmented based on a first image segmentation model to obtain a segmentation result of each pixel in the image to be segmented, and to perform dynamic position coding on the segmentation results of all pixels to obtain a dynamic position coding map;
[0033] Among them, the dynamic position encoding method is:
[0034] when P When (i,j)=0, E (i,j)=0;
[0035] when P When (i,j)=1,
[0036] ;
[0037] in, P (i,j) represents the segmentation result of the pixel at the i-th row and j-th column. P (i,j)=0 means the pixel at the current position is a non-target area. P (i,j)=1 means the current pixel is the target area. sum Represents the total number of pixels in the image to be detected, Index (i,j) x The pixels representing all target areas are arranged and numbered in a horizontal one-dimensional manner. The pixel at position (i, j) is the number of the pixel in the horizontal one-dimensional arrangement. Index (i,j) y The pixels representing all target areas are arranged and numbered in one dimension in the vertical direction, and the number of the pixel at position (i, j) in the one dimension in the vertical direction;
[0038] A registration and fusion module, used for mapping each auxiliary image to the image to be segmented through transformation registration to obtain each enhanced image corresponding to each auxiliary image, and performing inter-layer fusion on the image to be segmented and each enhanced image to obtain a fused enhanced image; wherein the morphology and structure of the enhanced image are consistent with those of the image to be segmented;
[0039] The second segmentation module is used to input the dynamic position coding map and the fused enhanced image into a second image segmentation model to perform multi-head self-attention feature extraction on them based on the attention mechanism, and then obtain a segmentation processing result corresponding to the image to be segmented.
[0040] Furthermore, the image to be segmented is defined as an Nth layer image, and the auxiliary images are respectively an N-1th layer image and an N+1th layer image; in this case, the registration and fusion module includes:
[0041] A deformation field acquisition unit is used to input the N-th layer image and the N-1-th layer image into a deep learning network to obtain a first deformation field of the pre-registration displacement corresponding to the N-1-th layer image; at the same time, input the N-th layer image and the N+1-th layer image into the deep learning network to obtain a second deformation field of the pre-registration displacement corresponding to the N+1-th layer image;
[0042] The image enhancement unit is used to perform bilinear difference sampling on the N-1th layer image and the N+1th layer image based on the first deformation field and the second deformation field as standards to obtain enhanced images corresponding to them respectively.
[0043] Furthermore, the first segmentation module includes:
[0044] Statistics acquisition unit, used to obtain the segmentation results P The statistical number of pixels where (i,j)=1;
[0045] The judgment iteration unit is used to judge that if the statistical number is greater than a preset number threshold, then continue to perform subsequent steps; otherwise, re-acquire the image to be segmented.
[0046] In a third aspect, the technical solution provides an electronic device, comprising at least one processor, the processor being coupled to a memory, the memory storing a computer program, and the computer program being configured to execute the method when executed by the processor.
[0047] In a fourth aspect, the technical solution provides a computer-readable storage medium, on which a computer program is stored, and the computer program is used to execute the method described.
[0048] Beneficial effects:
[0049] It can be seen from the above technical solutions that the present invention provides a three-dimensional image segmentation method based on registration enhancement and dynamic position coding to improve the current technical defect of low accuracy when directly segmenting two-dimensional images.
[0050] This technical solution obtains the image to be segmented and other auxiliary images by slicing the three-dimensional image. Continuing, on the one hand, the image to be segmented is subjected to the first segmentation processing using the first image segmentation model to obtain the pixel-by-pixel segmentation result, and a dynamic position coding map is constructed based on the pixel-by-pixel segmentation result, thereby enhancing the spatial semantic features based on prior knowledge and improving the perception ability of the subsequent segmentation network to the semantics of the spatial position of the pixel. On the other hand, the image to be segmented is used as a reference image, and the auxiliary image is used as a floating image, and then the auxiliary image is mapped to the image to be segmented through registration to obtain the corresponding enhanced image, and the image to be segmented and the enhanced image are inter-layer fused to obtain a fused enhanced image. At this time, the fused enhanced image will supplement and enhance the spatial information in the image to be segmented, and make up for the defect of the weak anti-noise ability of the image to be segmented. Finally, the dynamic position coding map and the fused enhanced image are simultaneously input into the second image segmentation model, and the attention mechanism is introduced to fuse the above two parts and perform feature extraction before performing segmentation reasoning, so as to obtain a segmentation processing result with high precision and accuracy. At the same time, in the processing of the second image segmentation model, multi-head self-attention feature extraction is specifically introduced to enhance the long-range dependency of image features and ensure the segmentation effect.
[0051] It should be appreciated that all combinations of the foregoing concepts, as well as additional concepts described in greater detail below, may be considered to be part of the inventive subject matter of the present disclosure, provided such concepts are not mutually inconsistent.
[0052] The foregoing and other aspects, embodiments and features of the present invention can be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as the features and / or beneficial effects of the exemplary embodiments, will be apparent from the following description or learned from the practice of the specific embodiments according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component shown in various figures may be represented by the same reference numeral. For clarity, not every component is labeled in every figure. Embodiments of various aspects of the present invention will now be described by way of example and with reference to the accompanying drawings, in which:
[0054] Figure 1A flowchart of the three-dimensional image segmentation method based on registration enhancement and dynamic position coding described in this embodiment;
[0055] Figure 2 This is a flow chart of obtaining an image to be segmented according to this embodiment;
[0056] Figure 3 This is a flow chart of the enhanced image described in this embodiment;
[0057] Figure 4 This is a flowchart of obtaining the three-dimensional segmentation processing result in this embodiment;
[0058] Figure 5 It is a structural block diagram of the three-dimensional image segmentation device based on registration enhancement and dynamic position coding described in this embodiment;
[0059] Figure 6 is a structural block diagram of the electronic device described in this embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be the common meanings understood by people with ordinary skills in the field to which the present invention belongs.
[0061] The words "first", "second" and similar words used in the specification and claims of this patent application do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular form of "a", "an" or "the" and similar words do not indicate a quantity limitation, but indicate the existence of at least one. "Include" or "comprise" and similar words mean that the elements or objects appearing before "include" or "comprise" include the features, wholes, steps, operations, elements and / or components listed after "include" or "comprise", and do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0062] For the segmentation processing of images whose current imaging objects are three-dimensional entities, the existing deep learning is mainly divided into two types according to the different dimensions of the input images: three-dimensional segmentation algorithm and two-dimensional segmentation algorithm. The three-dimensional segmentation algorithm refers to directly training and reasoning the three-dimensional overall image of the scanned local area, and outputting the segmentation result of the target area. In this process, since the operation object of the training and reasoning process is a three-dimensional image, the consumption of computing resources is very large, and the training difficulty and data volume requirements are increased, resulting in high overhead and difficulty in the final practical application. Therefore, the current image segmentation processing of three-dimensional entities is still mainly based on two-dimensional segmentation. However, the two-dimensional image used in the two-dimensional segmentation process loses some spatial information (that is, its association with the upper and lower layers), and a single two-dimensional image may introduce noise due to errors in the acquisition, reconstruction and other processes, resulting in the presence of noise in the final single two-dimensional image, which affects the recognition performance of the segmentation algorithm. Based on this, the present embodiment aims to provide a three-dimensional image segmentation method based on registration enhancement and dynamic position coding to improve the above-mentioned technical defects in the current two-dimensional segmentation algorithm.
[0063] The following is a detailed introduction to the three-dimensional image segmentation method based on registration enhancement and dynamic position coding described in this embodiment in conjunction with the accompanying drawings.
[0064] like Figure 1 As shown, the method includes:
[0065] Step S102: Acquire a three-dimensional image corresponding to the three-dimensional entity to be detected, and slice the three-dimensional image to obtain an image to be segmented and a plurality of auxiliary images.
[0066] In this embodiment, the image to be segmented and the auxiliary image are both two-dimensional images, and the auxiliary image is an adjacent layer image of the image to be segmented in the slicing process. As a specific implementation, the image to be segmented is the Nth layer image, and the auxiliary images are the N-1th layer image and the N+1th layer image respectively.
[0067] Step S104: performing image processing on the image to be segmented based on the first image segmentation model to obtain a segmentation result of each pixel in the image to be segmented, and performing dynamic position coding on the segmentation results of all pixels to obtain a dynamic position coding map.
[0068] In specific implementation, the dynamic position encoding method is:
[0069] when P When (i,j)=0, E (i,j)=0;
[0070] when P When (i,j)=1,
[0071] ;
[0072] in, P (i,j) represents the segmentation result of the pixel at the i-th row and j-th column. P (i,j)=0 means the pixel at the current position is a non-target area. P (i,j)=1 means the current pixel is the target area. sum Represents the total number of pixels in the image to be detected, Index (i,j) x The pixels representing all target areas are arranged and numbered in a horizontal one-dimensional manner. The pixel at position (i, j) is the number of the pixel in the horizontal one-dimensional arrangement. Index (i,j) y The pixels representing all target areas are arranged and numbered in a one-dimensional vertical arrangement, and the pixel at position (i, j) is the number of the pixel in the one-dimensional vertical arrangement.
[0073] Specifically, for the first image segmentation model, it is built based on a deep learning network. The basic network structure of the first image segmentation model includes: a first encoder, a first decoder and a first output layer in sequence; the first encoder includes: convolution operation, group standardization operation, ReLU activation function operation, pooling operation in sequence; the first decoder includes: upsampling operation, convolution operation, group standardization operation, ReLU activation function operation in sequence; the first output layer includes: convolution operation, group standardization operation in sequence. Specifically, after the data layer (that is, the number of channels to be segmented is 1, and the size of the final input image is 512×512×1), there are first four modules consisting of "convolution-group standardization-ReLU activation function-pooling", in which the convolution kernel size of the convolution is 3×3, the padding value is set to 1, the pooling kernel size is 2×2, and the step size is 2. Secondly, there are four modules consisting of "upsampling-convolution-group standardization-ReLU activation function", in which the upsampling ratio is 2, the convolution kernel size of the convolution is 3×3, and the padding value is set to 1. Finally, there is a convolution module with a convolution kernel size of 1×1, which finally outputs the segmentation result of the image to be segmented. The image size of the result is 512×512×1, where the last channel represents the segmentation result of the corresponding pixel, 0 represents the non-target area, and 1 represents the target area.
[0074] During the training process of the first image segmentation model, the parameters are set as follows: the batch size for each training is 16, and the learning rate is set to 0.0003. No data augmentation is set in any form, including cropping, flipping, etc. The parameters of the organ pre-segmentation model are trained using the cross entropy loss function and back propagation until the model converges.
[0075] As a specific implementation method, in order to improve the effectiveness of subsequent image segmentation processing, Figure 2 As shown, step S104 also includes:
[0076] Step S104.2: Get the segmentation result: P The number of pixels where (i,j)=1.
[0077] Step S104.4: If it is determined that the statistical number is greater than a preset number threshold, then the subsequent steps are continued; otherwise, the image to be segmented is reacquired.
[0078] At this time, based on steps S104.2 to S104.4, the image to be segmented can be screened to confirm that it contains the target area.
[0079] Step S106: Map each auxiliary image to the image to be segmented through transformation registration to obtain each enhanced image corresponding to each auxiliary image, and perform inter-layer fusion on the image to be segmented and each enhanced image to obtain a fused enhanced image.
[0080] The shape and structure of the enhanced image are consistent with those of the image to be segmented.
[0081] For the inter-layer registration process, it is also based on a deep learning algorithm. The basic network structure selected in this embodiment is similar to the first image segmentation model, and on this basis, the data layer is modified (that is, the auxiliary image and the image to be segmented are spliced into an image with a channel number of 2, and the size of the final input image is 512×512×1). In addition, in order to cope with the high complexity of the intensive prediction task of registration, the encoder corresponding to the inter-layer registration is five layers, and the output layer includes "convolution-upsampling-convolution-convolution-group normalization". The convolution kernel size is 3×3, and the padding value is set to 1. The rest of the configuration is consistent with the organ pre-segmentation model, and finally the deformation field of the displacement before and after the registration is output, and the auxiliary image is bilinearly interpolated based on the deformation field, and finally the enhanced image is output.
[0082] In the training process of the deep learning model corresponding to the inter-layer registration, the parameters are set as follows: the number of batches for each training is 4, and the learning rate is set to 0.0003. No data augmentation is set in any form, including cropping, flipping, etc. The parameters of the inter-layer registration model are trained using the mutual information loss function and the back propagation method until the model converges.
[0083] Combined with the above basic network structure setting, as a specific implementation method, Figure 3 As shown, each enhanced image is obtained by the following steps:
[0084] Step S106.2: Input the Nth layer image and the N-1th layer image into a deep learning network to obtain a first deformation field of the pre- and post-registration displacement corresponding to the N-1 layer image; at the same time, input the Nth layer image and the N+1th layer image into a deep learning network to obtain a second deformation field of the pre- and post-registration displacement corresponding to the N+1 layer image.
[0085] Step S106.4: perform bilinear difference sampling on the N-1th layer image and the N+1th layer image respectively based on the first deformation field and the second deformation field to obtain enhanced images corresponding to them respectively.
[0086] Specifically, for the inter-layer fusion process, the three layers of single-channel images, namely, the Nth layer image, and the two enhanced images corresponding to the N-1th layer image and the N+1th layer image, are stitched into a single 3-channel image to fuse the image information of the three layers.
[0087] Step S108: input the dynamic position coding map and the fused enhanced image into a second image segmentation model to perform multi-head self-attention feature extraction on them based on the attention mechanism, and then obtain a segmentation processing result corresponding to the image to be segmented.
[0088] In this embodiment, the second image segmentation model is built based on a deep learning network. The basic network structure of the second image segmentation model includes: a second encoder, a second decoder and a second output layer in sequence; the second encoder includes: a multi-head self-attention feature extraction operation, a group normalization operation, a ReLU activation function operation, and a pooling operation in sequence; the second decoder includes: an upsampling operation, a multi-head self-attention feature extraction operation, a group normalization operation, and a ReLU activation function operation in sequence; the second output layer includes: a multi-head self-attention feature extraction operation and a group normalization operation in sequence. At this time, the final output image size is 512×512×1, where the last channel represents the segmentation result of the corresponding pixel, 0 represents the non-target area, and 1 represents the target area.
[0089] During the training process of the second image segmentation model, the parameters are set as follows: the number of batches for each training is 8, and the learning rate is set to 0.0003. No data expansion in any form is set, including cropping, flipping, etc. The parameters of the inter-layer registration model are trained using the cross entropy loss function and back propagation until the model converges.
[0090] As a further embodiment, in combination Figure 4 As shown, the image to be segmented is all the two-dimensional images after the three-dimensional image is sliced. At this time, after obtaining the segmentation processing result corresponding to the image to be segmented, the method further includes:
[0091] Step S110.2: Screen all the images to be segmented based on the segmentation processing result to obtain all target images containing the target area.
[0092] Step S110.4: perform three-dimensional reconstruction on all target images based on the position coordinates in the three-dimensional image slicing process and display the segmentation processing result of each target image, thereby obtaining the three-dimensional segmentation processing result corresponding to the three-dimensional image.
[0093] At this time, based on steps S102 to S110.4, a three-dimensional image segmentation result can be obtained on the basis of processing the two-dimensional image, which is more convenient for assisting related subsequent operations.
[0094] In summary, the method described in this embodiment enhances the features of the image pixel semantics and spatial position information by the first image segmentation model and the dynamic position coding joint process, thereby enhancing the internal semantic features of the two-dimensional image. At the same time, the spatial context information is supplemented by the inter-layer registration and inter-layer fusion joint processing, and the image anti-noise ability is improved. Finally, when the image segmentation is processed by the second image segmentation model, an image segmentation result with higher precision and accuracy is obtained.
[0095] The above program can be run in the processor, or it can be stored in the memory (or computer-readable storage medium), which includes permanent and non-permanent, removable and non-removable media. Information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
[0096] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps of the functions specified in one or more blocks can be implemented by different modules corresponding to different steps.
[0097] Based on the above method, this embodiment also provides a three-dimensional image segmentation device based on registration enhancement and dynamic position coding. Figure 5 As shown, the device includes the following functional modules:
[0098] An image acquisition module is used to acquire a three-dimensional image corresponding to the three-dimensional entity to be detected, and slice the three-dimensional image to obtain an image to be segmented and several auxiliary images; wherein the image to be segmented and the auxiliary images are both two-dimensional images, and the auxiliary images are adjacent layer images of the image to be segmented in the slicing process.
[0099] A first segmentation module, configured to perform image processing on the image to be segmented based on a first image segmentation model to obtain a segmentation result of each pixel in the image to be segmented, and to perform dynamic position coding on the segmentation results of all pixels to obtain a dynamic position coding map;
[0100] Among them, the dynamic position encoding method is:
[0101] when P When (i,j)=0, E (i,j)=0;
[0102] when P When (i,j)=1,
[0103] ;
[0104] in, P (i,j) represents the segmentation result of the pixel at the i-th row and j-th column. P (i,j)=0 means the pixel at the current position is a non-target area. P (i,j)=1 means the current pixel is the target area. sum Represents the total number of pixels in the image to be detected, Index (i,j) x The pixels representing all target areas are arranged and numbered in a horizontal one-dimensional manner. The pixel at position (i, j) is the number of the pixel in the horizontal one-dimensional arrangement. Index (i,j) y The pixels representing all target areas are arranged and numbered in a one-dimensional vertical arrangement, and the pixel at position (i, j) is the number of the pixel in the one-dimensional vertical arrangement.
[0105] A registration and fusion module is used to map each auxiliary image to the image to be segmented through transformation registration to obtain each enhanced image corresponding to each auxiliary image, and to perform inter-layer fusion on the image to be segmented and each enhanced image to obtain a fused enhanced image; wherein the morphology and structure of the enhanced image are consistent with those of the image to be segmented.
[0106] The second segmentation module is used to input the dynamic position coding map and the fused enhanced image into a second image segmentation model to perform multi-head self-attention feature extraction on them based on the attention mechanism, and then obtain a segmentation processing result corresponding to the image to be segmented.
[0107] Since the device is used to implement the steps of the above method, what has been described has not been repeated here.
[0108] For example, when the image to be segmented is defined as an Nth layer image, and the auxiliary images are respectively an N-1th layer image and an N+1th layer image; the registration and fusion module further includes:
[0109] A deformation field acquisition unit is used to input the N-th layer image and the N-1-th layer image into a deep learning network to obtain a first deformation field of the pre-registration displacement corresponding to the N-1-th layer image; at the same time, input the N-th layer image and the N+1-th layer image into the deep learning network to obtain a second deformation field of the pre-registration displacement corresponding to the N+1-th layer image;
[0110] The image enhancement unit is used to perform bilinear difference sampling on the N-1th layer image and the N+1th layer image based on the first deformation field and the second deformation field as standards to obtain enhanced images corresponding to them respectively.
[0111] For example, the first segmentation module further includes:
[0112] Statistics acquisition unit, used to obtain the segmentation results P The number of pixels where (i,j)=1.
[0113] The judgment iteration unit is used to judge that if the statistical number is greater than a preset number threshold, then continue to perform subsequent steps; otherwise, re-acquire the image to be segmented.
[0114] Combination Figure 6 As shown, this embodiment further provides an electronic device, comprising at least one processor, the processor being coupled to a memory, the memory storing a computer program, and the computer program being configured to execute the method when being executed by the processor.
[0115] Similarly, this embodiment also provides a computer-readable storage medium, on which a computer program is stored, and the computer program is used to execute the method described.
[0116] Since the device, the electronic device and the computer-readable storage medium are all constructed based on the method, they also have technical advantages of high precision and accuracy in practical applications.
[0117] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.
Claims
1. A 3D image segmentation method based on registration enhancement and dynamic position encoding, It is characterized in that include: Acquire a three-dimensional image corresponding to the three-dimensional entity to be detected, and slice the three-dimensional image to obtain an image to be segmented and a plurality of auxiliary images; wherein the image to be segmented and the auxiliary images are both two-dimensional images, and the auxiliary images are adjacent layer images of the image to be segmented in the slicing process; Performing image processing on the image to be segmented based on the first image segmentation model to obtain a segmentation result of each pixel in the image to be segmented, and performing dynamic position coding on the segmentation results of all pixels to obtain a dynamic position coding map; Among them, the basic network structure of the first image segmentation model includes: a first encoder, a first decoder and a first output layer in sequence; the first encoder includes: a convolution operation, a group normalization operation, a ReLU activation function operation, and a pooling operation in sequence; the first decoder includes: an upsampling operation, a convolution operation, a group normalization operation, and a ReLU activation function operation in sequence; the first output layer includes: a convolution operation and a group normalization operation in sequence; Among them, the dynamic position encoding method is: when P When (i,j)=0, E (i,j)=0; when P When (i,j)=1, ; in, P (i,j) represents the segmentation result of the pixel at the i-th row and j-th column. P (i,j)=0 means the pixel at the current position is a non-target area. P (i,j)=1 means the current pixel is the target area. sum Represents the total number of pixels in the image to be detected, Index (i,j) x The pixels representing all target areas are arranged and numbered in a horizontal one-dimensional manner. The pixel at position (i, j) is the number of the pixel in the horizontal one-dimensional arrangement. Index (i,j) y The pixels representing all target areas are arranged and numbered in one dimension in the vertical direction, and the number of the pixel at position (i, j) in the one dimension in the vertical direction; Mapping each auxiliary image to the image to be segmented through transformation registration to obtain each enhanced image corresponding to each auxiliary image, and inter-layer fusion of the image to be segmented and each enhanced image to obtain a fused enhanced image; wherein the morphology and structure of the enhanced image are consistent with the image to be segmented; The acquisition of each enhanced image includes: first, defining the image to be segmented as the Nth layer image, then the auxiliary images are the N-1th layer image and the N+1th layer image respectively; second, inputting the Nth layer image and the N-1th layer image into a deep learning network to obtain a first deformation field of the pre-registration displacement corresponding to the N-1th layer image; at the same time, inputting the Nth layer image and the N+1th layer image into a deep learning network to obtain a second deformation field of the pre-registration displacement corresponding to the N+1th layer image; then, bilinear difference sampling is performed on the N-1th layer image and the N+1th layer image respectively based on the first deformation field and the second deformation field to obtain the enhanced images corresponding to them respectively; Inputting the dynamic position coding map and the fused enhanced image into a second image segmentation model to perform multi-head self-attention feature extraction on them based on an attention mechanism, and obtaining a segmentation processing result corresponding to the image to be segmented; Among them, the basic network structure of the second image segmentation model includes: a second encoder, a second decoder and a second output layer in sequence; the second encoder includes: a multi-head self-attention feature extraction operation, a group normalization operation, a ReLU activation function operation, and a pooling operation in sequence; the second decoder includes: an upsampling operation, a multi-head self-attention feature extraction operation, a group normalization operation, and a ReLU activation function operation in sequence; the second output layer includes: a multi-head self-attention feature extraction operation and a group normalization operation in sequence.
2. The three-dimensional image segmentation method based on registration enhancement and dynamic position coding according to claim 1, It is characterized in that The image to be segmented includes all two-dimensional images after the three-dimensional image is sliced; after obtaining the segmentation processing result corresponding to the image to be segmented; comprising: Based on the segmentation processing result, all the images to be segmented are screened to obtain all the target images containing the target area; Based on the position coordinates in the slicing process of the three-dimensional image, all target images are three-dimensionally reconstructed and the segmentation processing result of each target image is displayed, thereby obtaining the three-dimensional segmentation processing result corresponding to the three-dimensional image.
3. The three-dimensional image segmentation method based on registration enhancement and dynamic position coding according to claim 1, It is characterized in that The step of performing image processing on the image to be segmented based on the first image segmentation model to obtain a segmentation result for each pixel in the image to be segmented comprises: Get the segmentation result as P The statistical number of pixels where (i,j)=1; If it is determined that the statistical number is greater than a preset number threshold, the subsequent steps are continued; otherwise, the image to be segmented is reacquired.
4. A three-dimensional image segmentation device based on registration enhancement and dynamic position coding, It is characterized in that include: An image acquisition module, used to acquire a three-dimensional image corresponding to the three-dimensional entity to be detected, and slice the three-dimensional image to obtain an image to be segmented and a plurality of auxiliary images; wherein the image to be segmented and the auxiliary images are both two-dimensional images, and the auxiliary images are adjacent layer images of the image to be segmented in the slicing process; A first segmentation module, configured to perform image processing on the image to be segmented based on a first image segmentation model to obtain a segmentation result of each pixel in the image to be segmented, and to perform dynamic position coding on the segmentation results of all pixels to obtain a dynamic position coding map; Among them, the basic network structure of the first image segmentation model includes: a first encoder, a first decoder and a first output layer in sequence; the first encoder includes: a convolution operation, a group normalization operation, a ReLU activation function operation, and a pooling operation in sequence; the first decoder includes: an upsampling operation, a convolution operation, a group normalization operation, and a ReLU activation function operation in sequence; the first output layer includes: a convolution operation and a group normalization operation in sequence; Among them, the dynamic position encoding method is: when P When (i,j)=0, E (i,j)=0; when P When (i,j)=1, ; in, P (i,j) represents the segmentation result of the pixel at the i-th row and j-th column. P (i,j)=0 means the pixel at the current position is a non-target area. P (i,j)=1 means the current pixel is the target area. sum Represents the total number of pixels in the image to be detected, Index (i,j) x The pixels representing all target areas are arranged and numbered in a horizontal one-dimensional manner. The pixel at position (i, j) is the number of the pixel in the horizontal one-dimensional arrangement. Index (i,j) y The pixels representing all target areas are arranged and numbered in one dimension in the vertical direction, and the number of the pixel at position (i, j) in the one dimension in the vertical direction; A registration and fusion module, used to map each auxiliary image to the image to be segmented through transformation registration to obtain each enhanced image corresponding to each auxiliary image, and perform inter-layer fusion on the image to be segmented and each enhanced image to obtain a fused enhanced image; wherein the morphology and structure of the enhanced image are consistent with the image to be segmented; wherein, the image to be segmented is defined as the Nth layer image, and each auxiliary image is respectively the N-1th layer image and the N+1th layer image; the registration and fusion module also includes: a deformation field acquisition unit, used to input the Nth layer image and the N-1th layer image into a deep learning network to obtain a first deformation field of the registration before and after displacement corresponding to the N-1th layer image; at the same time, the Nth layer image and the N+1th layer image are input into the deep learning network to obtain a second deformation field of the registration before and after displacement corresponding to the N+1th layer image; an image enhancement unit, used to perform bilinear difference sampling on the N-1th layer image and the N+1th layer image based on the first deformation field and the second deformation field as the standard to obtain the enhanced images corresponding to them respectively; The second segmentation module is used to input the dynamic position coding map and the fused enhanced image into the second image segmentation model to perform multi-head self-attention feature extraction on them based on the attention mechanism, and then obtain the segmentation processing result corresponding to the image to be segmented; wherein the basic network structure of the second image segmentation model includes: a second encoder, a second decoder and a second output layer in sequence; the second encoder includes: a multi-head self-attention feature extraction operation, a group normalization operation, a ReLU activation function operation, and a pooling operation in sequence; the second decoder includes: an upsampling operation, a multi-head self-attention feature extraction operation, a group normalization operation, and a ReLU activation function operation in sequence; the second output layer includes: a multi-head self-attention feature extraction operation and a group normalization operation in sequence.
5. The three-dimensional image segmentation device based on registration enhancement and dynamic position coding according to claim 4, It is characterized in that The first segmentation module comprises: Statistics acquisition unit, used to obtain the segmentation results P The statistical number of pixels where (i,j)=1; The judgment iteration unit is used to judge that if the statistical number is greater than a preset number threshold, then continue to perform subsequent steps; otherwise, re-acquire the image to be segmented.
6. An electronic device, It is characterized in that The method comprises at least one processor, wherein the processor is coupled to a memory, wherein a computer program is stored in the memory, and wherein the computer program is configured to execute the method according to any one of claims 1 to 3 when executed by the processor.
7. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and the computer program is used to execute the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
A three-dimensional image segmentation method and system based on a full convolutional neural network
CN109903292A
Image processing method and device
CN118279206A
