Tumor image segmentation system and method based on dynamic position coding

By adopting a segmentation network with dynamic position coding and attention mechanism in liver CT image segmentation, the problem of insufficient noise and spatial information in the two-dimensional segmentation algorithm is solved, and the segmentation accuracy of tumor images is significantly improved.

CN119850944APending Publication Date: 2025-04-18绍兴市北大信息技术科创中心
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311359436.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-18
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The two-dimensional segmentation algorithm has problems of insufficient noise and spatial information in liver CT images, resulting in a single feature information and an impact on the segmentation accuracy.

Method used

A tumor image segmentation system based on dynamic position encoding is adopted, including organ presegment module, dynamic position encoding module, inter-layer registration module, inter-layer fusion module and segmentation network module based on attention mechanism. Through these modules, the spatial semantic characteristics of the images are obtained and fused, and the segmentation results are optimized.

Benefits of technology

Image features are obtained through inter-layer registration and fusion modules, spatial information loss and noise problems are optimized, spatial semantic features are obtained through dynamic position coding modules, and finally, through segmentation network modules based on attention mechanism, the segmentation accuracy of tumor images is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850944A_ABST
    Figure CN119850944A_ABST
Patent Text Reader

Abstract

The invention provides a tumor image segmentation system and method based on dynamic position coding, and aims at obtaining image features through an interlayer registration module and an interlayer fusion module, and solving the problems of spatial information loss and noise in two-dimensional image detection. Spatial semantic features are obtained through an organ pre-segmentation module and a dynamic position coding module, the spatial semantic features based on priori knowledge are enhanced, finally, the two features are fused through a segmentation network module based on an attention mechanism for segmentation reasoning, and a high segmentation result is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of data processing, and in particular to a tumor image segmentation system and method based on dynamic position coding. Background Art

[0002] For the problem of liver tumor segmentation in CT images, existing deep learning is divided into two-dimensional segmentation algorithms and three-dimensional segmentation algorithms according to the different dimensions of the input images. The two-dimensional segmentation algorithm refers to training and reasoning for a single-layer two-dimensional CT image. The single-layer two-dimensional CT image is input and passed through a deep learning network (usually a neural network based on two-dimensional convolution, where the function of two-dimensional convolution is to extract features from pixels on the two-dimensional plane) to output the tumor segmentation result of the image. The two-dimensional CT image used in this process loses some spatial information (that is, its relationship with the upper and lower layers), and the single two-dimensional image may introduce noise due to errors in the acquisition and reconstruction processes, resulting in noise in the final single two-dimensional image that affects the recognition performance of the segmentation algorithm. Summary of the invention:

[0003] The present invention aims to solve the problem that the two-dimensional segmentation algorithm has noise and insufficient spatial information, resulting in single feature information and affected segmentation accuracy.

[0004] The present invention provides a tumor image segmentation system and method based on dynamic position coding.

[0005] A tumor image segmentation system based on dynamic position coding, comprising:

[0006] An organ pre-segmentation module, which is used to segment the organs in the image and obtain pixel-by-pixel prediction results of the organs;

[0007] The dynamic position coding module performs position coding on each pixel in the image according to the pixel-by-pixel prediction results of the organ to obtain a dynamic position coding feature map;

[0008] The inter-layer registration module transforms and registers the upper and lower image layers that are spatially adjacent to the current image layer to be detected through the inter-layer registration module, samples the upper and lower image layers based on the deformation field, and obtains the upper and lower enhanced image layers generated by the registration;

[0009] The inter-layer fusion module is used to combine the three layers of single-channel images, namely, the upper and lower enhanced image layers generated by the inter-layer registration module and the current image layer to be detected, into a three-channel image to obtain an enhanced image to be detected;

[0010] The segmentation network module based on the attention mechanism includes an encoder, a decoder and an output layer. The encoder includes a neural network containing a self-attention mechanism. The enhanced image to be detected and the dynamic position encoding feature map are input into the segmentation network module based on the attention mechanism, and the segmentation result of the lesion area is output.

[0011] Preferably, the organ pre-segmentation module includes an encoder, a decoder and an output layer, the encoder includes four layers, each layer includes a convolution operation, a group normalization operation, a ReLU activation function and a pooling operation, the decoder includes four layers, each layer includes an upsampling operation, a convolution operation, a group normalization operation and a ReLU activation function, and the output layer includes a convolution operation and a group normalization operation.

[0012] Preferably, the inter-layer registration module includes an encoder, a decoder, an output layer and a sampler, the encoder includes five layers, each layer includes a convolution operation, a group normalization operation, a ReLU activation function and a pooling operation, the decoder includes four layers, each layer includes an upsampling operation, a convolution operation, a group normalization operation and a ReLU activation function, and the output layer includes a convolution operation, an upsampling operation, a convolution operation and a group normalization operation.

[0013] Preferably, the position encoding method is: if the current pixel is a non-tumor area pixel, the pixel position code is 0; if the current pixel is a tumor area pixel, the position code is calculated based on the total number of tumor area pixels in the current image, the horizontal relative position of the current pixel in the current image, and the vertical relative position of the current pixel in the current image.

[0014] Preferably, the horizontal relative position is calculated by arranging and numbering the pixels of the tumor area in the current image one by one in a horizontal order from top to bottom, and recording the number of the current pixel as Index(i,j) x , then calculate Index(i,j) x Subtract the total number of pixels in the tumor area in the current image, and then take the absolute value, and add it to Index(i,j) x Of the absolute values, take the smaller value as the horizontal relative position;

[0015] The calculation method of the longitudinal relative position is: the pixels of the tumor area in the current image are arranged and numbered one by one in the longitudinal order from left to right, and the number of the current pixel is recorded as Index(i,j) y , then calculate Index(i,j) y Subtract the total number of pixels in the tumor area in the current image, and then take the absolute value, and add it to Index(i,j) y Of the absolute values, take the smaller value as the vertical relative position.

[0016] Preferably, the horizontal relative position and the vertical relative position are divided by the total number of pixels in the tumor area in the current image, respectively, scaled, and then summed to obtain the position code.

[0017] Preferably, the encoder of the segmentation network module based on the attention mechanism includes two layers of convolution operations, group normalization operations, ReLU activation functions and pooling operations, and two layers of attention mechanism neural networks, and the decoder includes four layers, each layer includes an upsampling operation, a convolution operation, a group normalization operation and a ReLU activation function, and the output layer includes a convolution operation and a group normalization operation.

[0018] Preferably, the neural network of the attention mechanism includes a multi-head self-attention feature extraction operation, a group normalization operation, a ReLU activation function and a pooling operation.

[0019] Preferably, for the organ pre-segmentation module or the segmentation network module based on the attention mechanism, in the encoder, the convolution kernel size of the convolution is 3×3, and the padding value is set to 1; the pooling kernel size is 2×2, and the step size is 2; in the decoder, the upsampling ratio is 2, the convolution kernel size of the convolution is 3×3, and the padding value is set to 1; in the output layer, the convolution kernel size of the convolution is 1×1;

[0020] For the inter-layer registration module, in the encoder, the convolution kernel size of the convolution is 3×3, and the padding value is set to 1; the pooling kernel size is 2×2, and the step size is 2; in the decoder, the upsampling ratio is 2, the convolution kernel size is 3×3, and the padding value is set to 1; in the output layer, the convolution kernel size of the convolution is 3×3, and the padding value is set to 1.

[0021] A tumor image segmentation method based on dynamic position coding, using the tumor image segmentation system based on dynamic position coding, comprising:

[0022] Step 1, using a two-dimensional image dataset to train an organ pre-segmentation module and an inter-layer registration module;

[0023] Step 2: Input the two-dimensional image layer to be detected and the upper and lower layers adjacent to the two-dimensional image layer in space into the trained organ pre-segmentation model and dynamic position coding module, output the dynamic position coding feature map, input the two-dimensional image layer to be detected and the upper and lower layers adjacent to the two-dimensional image layer in space into the trained inter-layer registration module and inter-layer fusion module, and output the enhanced image to be detected;

[0024] Step 3, using the enhanced image to be detected and the true value of the lesion area segmentation label corresponding to the image, training the segmentation network module based on the attention mechanism;

[0025] Step 4: Use the above-trained attention-based segmentation network module, organ pre-segmentation module, and inter-layer registration module to perform inference segmentation on the image of the lesion area and generate a lesion segmentation result.

[0026] Preferably, for the organ pre-segmentation module, the training parameters are set as follows: the number of batches for each training is 16, the learning rate is set to 0.0003, and no form of data expansion is set; for the inter-layer registration module, the training parameters are set as follows: the number of batches for each training is 4, the learning rate is set to 0.0003, and no form of data expansion is set; for the segmentation network module based on the attention mechanism, the training parameters are set as follows: the number of batches for each training is 8, the learning rate is set to 0.0003, and no form of data expansion is set.

[0027] Preferably, the organ pre-segmentation module, the inter-layer registration module and the segmentation network module based on the attention mechanism are each trained using a cross entropy loss function and a back propagation method until convergence.

[0028] Compared with the prior art, the present invention has the following advantages and effects:

[0029] The present invention obtains image features through an inter-layer registration module and an inter-layer fusion module, optimizes the spatial information missing and noise problems in two-dimensional image detection, obtains spatial semantic features through an organ pre-segmentation module and a dynamic position encoding module, and the above two parts of features are used as prior knowledge to enhance the spatial information in the features. Finally, the above two parts of features are fused through a segmentation network module based on the attention mechanism for segmentation reasoning, thereby obtaining a relatively high segmentation result. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0031] Figure 1 is a flow chart of the segmentation method of the present invention;

[0032] Figure 2 It is a flowchart of the inter-layer registration module;

[0033] Figure 3 It is a flowchart of the segmentation network module based on the attention mechanism. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0035] Image segmentation technology is one of the core tasks in the fields of computer vision and image processing. It refers to the process of dividing all pixels in an image into several regions with similar semantics. These regions are disjoint, such as segmenting a CT image into liver organ regions and liver tumor regions. In recent years, image segmentation technology based on deep learning has achieved good performance. Deep learning technology adopts the paradigm of "input-deep learning network-output". The image to be segmented is used as input, and a deep learning network with learning ability (fitting ability such as high-order functions) outputs the expected segmentation result (called mask). This process is called the inference process. At the same time, in order for the deep learning network to output the correct expected segmentation result, the network needs to go through a training process. In this process, the user provides a real segmentation result that matches the input image. The predicted segmentation result output by the deep learning network is supervised by the real segmentation result, and the learning ability of the deep learning network is corrected. This process is called the training process. The above training process and inference process constitute the learning stage and inference application stage of the deep learning network.

[0036] Embodiment 1:

[0037] A tumor image segmentation system based on dynamic position coding, comprising:

[0038] An organ pre-segmentation module, which is used to segment the organs in the image and obtain pixel-by-pixel prediction results of the organs;

[0039] The dynamic position coding module performs position coding on each pixel in the image according to the pixel-by-pixel prediction results of the organ to obtain a dynamic position coding feature map;

[0040] The inter-layer registration module transforms and registers the upper and lower image layers that are spatially adjacent to the current image layer to be detected through the inter-layer registration module, samples the upper and lower image layers based on the deformation field, and obtains the upper and lower enhanced image layers generated by the registration;

[0041] The inter-layer fusion module is used to combine the three layers of single-channel images, namely, the upper and lower enhanced image layers generated by the inter-layer registration module and the current image layer to be detected, into a single 3-channel image to obtain an enhanced image to be detected;

[0042] The segmentation network module based on the attention mechanism includes an encoder, a decoder and an output layer. The encoder includes a neural network containing a self-attention mechanism. The enhanced image to be detected and the dynamic position encoding feature map are input into the segmentation network module based on the attention mechanism, and the segmentation result of the lesion area is output.

[0043] In a specific embodiment, the network structure of the organ pre-segmentation module is a four-layer "convolution operation, group standardization operation, ReLU activation function and pooling operation" encoder, a four-layer "up-sampling operation, convolution operation, group standardization operation and ReLU activation function" decoder, and a "convolution operation and group standardization operation" output layer. For example, after the data layer, there are first four modules consisting of "convolution operation, group standardization operation, ReLU activation function and pooling operation", where 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 "up-sampling operation, convolution operation, group standardization operation and ReLU activation function", where the up-sampling 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 organ segmentation result. 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-organ area, and 1 represents the organ area.

[0044] In a specific embodiment, after the image to be segmented passes through the organ pre-segmentation module, a pixel-by-pixel prediction result of the liver organ will be obtained. For the prediction result of each pixel position, 0 represents that the current pixel is in a non-liver organ area, and 1 represents that the current pixel is in a liver organ area. Therefore, the image pixel size of the currently obtained liver prediction result is: the length of the image to be detected × the width of the image to be detected × 1. For each pixel in the image, based on the liver prediction result obtained above, a dynamic position encoding module is used to perform pixel-by-pixel dynamic position encoding: if the current pixel is a non-tumor area pixel, the pixel position encoding is 0; if the current pixel is a tumor area pixel, the position encoding is calculated based on the total number of tumor area pixels in the current image, the horizontal relative position of the current pixel in the current image, and the vertical relative position of the current pixel in the current image. The horizontal relative position is calculated as follows: the tumor area pixels in the current image are arranged one by one in a horizontal order from top to bottom and numbered, and the number of the current pixel is recorded as Index(i,j) x , then calculate Index(i,j) x Subtract the total number of pixels in the tumor area in the current image, and then take the absolute value, and add it to Index(i,j) xThe smaller value is taken as the horizontal relative position in the absolute value and the vertical relative position is calculated as follows: the pixels of the tumor area in the current image are arranged and numbered one by one in the vertical order from left to right, and the number of the current pixel is recorded as Index(i,j) y , then calculate Index(i,j) y Subtract the total number of pixels in the tumor area in the current image, and then take the absolute value, and add it to Index(i,j) y The smaller value is taken as the longitudinal relative position in the absolute value and the lateral relative position and the longitudinal relative position are divided by the total number of pixels in the tumor area in the current image, respectively, and then scaled and summed to obtain the position code. The dynamic position coding feature map is obtained.

[0045] The calculation formula for pixel-by-pixel dynamic position encoding is as follows:

[0046] When P(i,j)=0, E(i,j)=0

[0047] When P(i,j)=1, E(i,j)=

[0048]

[0049] Wherein, E(i,j) represents the position code of the pixel at the i-th row and j-th column, P(i,j) represents the organ pre-segmentation result of the pixel at the i-th row and j-th column, P(*,*)=0 represents that the pixel at the current position is not in the liver organ area, P(*,*)=1 represents that the pixel at the current position is in the liver organ area, min[*,*] represents the smaller value of the two, |*| represents the operation of taking the absolute value of *, Sum represents the total number of pixels with P(*,*)=1 in the current detection image layer, Index(i,j) x Represents that all pixels with P(*,*)=1 are arranged in a horizontal one-dimensional manner and numbered. The position of the pixel (i,j) in the horizontal one-dimensional arrangement is the number of the pixel (i,j). y The position of all pixels with P(*,*)=1 after being arranged and numbered in one dimension in the vertical direction is the number of the (i,j) pixel in the one dimension in the vertical direction.

[0050] In a specific embodiment, the inter-layer registration module is composed of a neural network and a sampler of an "encoder-decoder-output layer" structure. The basic network structure selected by the present invention is similar to the organ pre-segmentation model, and on this basis, the data layer is modified (that is, the image to be registered and the reference image are spliced ​​into an image with a channel number of 2, and the size of the final input image is 512×512×2). In addition, in order to cope with the high complexity of the intensive prediction task of registration, the encoder of the inter-layer registration module is modified from four layers to five layers, and the output layer is modified from "convolution operation" to "convolution operation, upsampling operation, convolution operation and group normalization operation", the convolution kernel size of the convolution is 3×3, and the padding value is set to 1. The remaining configuration is consistent with the organ pre-segmentation model, that is, the encoder is composed of five layers of "convolution operation, group normalization operation, ReLU activation function and pooling operation", the decoder is composed of four layers of "upsampling operation, convolution operation, group normalization operation and ReLU activation function", and the output layer is composed of "convolution operation, upsampling operation, convolution operation and group normalization operation". Finally, the deformation field of the displacement before and after registration is output, and the image to be registered is subjected to bilinear difference sampling through a sampler based on the deformation field, and finally the registered image is output.

[0051] In a specific embodiment, the segmentation network module based on the attention mechanism is composed of a neural network with a self-attention mechanism in an "encoder-decoder" structure. Compared with the organ pre-segmentation module, this module replaces several "convolution" operations in the encoder in the organ pre-segmentation module with "multi-head self-attention feature extraction" operations to enhance the long-range dependency of image features. Preferably, the first and second layers of the encoder are composed of "convolution operation, group normalization operation, ReLU activation function and pooling operation", wherein 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, the third and fourth layers of the encoder are composed of "multi-head self-attention feature extraction operation, group normalization operation, ReLU activation function and pooling operation", the pooling kernel size is 2×2 and the step size is 2, and the decoder is composed of four layers of "up-sampling operation, convolution operation, group normalization operation and ReLU activation function", wherein the up-sampling ratio is 2, the convolution kernel size of the convolution is 3×3, and the padding value is set to 1.

[0052] A tumor image segmentation method based on dynamic position coding, comprising:

[0053] Step 1, using a two-dimensional image dataset to train an organ pre-segmentation module and an inter-layer registration module;

[0054] Step 2: Input the two-dimensional image layer to be detected and the upper and lower layers adjacent to the two-dimensional image layer in space into the trained organ pre-segmentation model and dynamic position coding module, output the dynamic position coding feature map, input the two-dimensional image layer to be detected and the upper and lower layers adjacent to the two-dimensional image layer in space into the trained inter-layer registration module and inter-layer fusion module, and output the enhanced image to be detected;

[0055] Step 3, using the enhanced image to be detected and the true value of the lesion area segmentation label corresponding to the image, training the segmentation network module based on the attention mechanism, and the true value of the lesion area segmentation label is manually input;

[0056] Step 4, use the above-trained attention-based segmentation network module, organ pre-segmentation module, and inter-layer registration module to perform inference segmentation on the two-dimensional image without the real lesion area label: input the two-dimensional image without the real lesion area label to be detected and the upper and lower layers adjacent to the two-dimensional image layer space into the organ pre-segmentation model, dynamic position encoding module and attention-based segmentation network module in the above steps, and then output the pixel-by-pixel lesion prediction result of the two-dimensional image without the real lesion area label to be detected.

[0057] In a specific embodiment, in step 1, the organ pre-segmentation module and the inter-layer registration module both use the stochastic gradient descent method to train and optimize the network model parameters. For the organ pre-segmentation module, the parameters are set as follows: the number of batches for each training is 16, and the learning rate is set to 0.0003. No form of data augmentation is set, including cropping, flipping, etc. The parameters of the organ pre-segmentation module are trained using the cross entropy loss function and the back propagation method until the model converges. For the inter-layer registration module, 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 form of data augmentation is set, including cropping, flipping, etc. The parameters of the inter-layer registration module are trained using the mutual information loss function and the back propagation method until the model converges.

[0058] In a specific embodiment, in step 2, when the patient undergoes organ imaging scanning, a series of two-dimensional slice images are obtained by scanning layer by layer. For an image layer of a certain organ to be detected, the image layer to be detected is first input into a trained organ pre-segmentation model to obtain a pre-segmentation result, and then a dynamic position encoding feature map is obtained through a dynamic position encoding module; secondly, the image layer to be detected and its spatially adjacent upper image n-1 are input into an interlayer registration module to output an n-1 layer image to be registered to the image layer n, and then the image layer to be detected and its spatially adjacent lower image n+1 are input into an interlayer registration module to output an n+1 layer image to be registered to the image layer n, so that the upper and lower layers of the image layer adjacent to the image layer to be detected are obtained after registration, and then the image layer n to be detected and the above two layers of registered image layers are input into an interlayer fusion module to output an enhanced image to be detected.

[0059] In one specific embodiment, in step 3, the segmentation network module based on the attention mechanism uses the stochastic gradient descent method to train and optimize the network model parameters. The training 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 augmentation is set in any form, including cropping, flipping, etc. The parameters of the segmentation network based on the attention mechanism are trained using the cross entropy loss function and the back propagation method until the model converges.

[0060] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A tumor image segmentation system based on dynamic position coding, characterized in that: include: An organ pre-segmentation module, which is used to segment the organs in the image and obtain pixel-by-pixel prediction results of the organs; The dynamic position coding module performs position coding on each pixel in the image according to the pixel-by-pixel prediction results of the organ to obtain a dynamic position coding feature map; The inter-layer registration module transforms and registers the upper and lower image layers that are spatially adjacent to the current image layer to be detected through the inter-layer registration module, samples the upper and lower image layers based on the deformation field, and obtains the upper and lower enhanced image layers generated by the registration; The inter-layer fusion module is used to combine the three layers of single-channel images, namely, the upper and lower enhanced image layers generated by the inter-layer registration module and the current image layer to be detected, into a three-channel image to obtain an enhanced image to be detected; The segmentation network module based on the attention mechanism includes an encoder, a decoder and an output layer. The encoder includes a neural network containing a self-attention mechanism. The enhanced image to be detected and the dynamic position encoding feature map are input into the segmentation network module based on the attention mechanism, and the segmentation result of the lesion area is output.

2. The tumor image segmentation system based on dynamic position coding according to claim 1, characterized in that: The organ pre-segmentation module includes an encoder, a decoder and an output layer. The encoder includes four layers, each of which includes a convolution operation, a group normalization operation, a ReLU activation function and a pooling operation. The decoder includes four layers, each of which includes an upsampling operation, a convolution operation, a group normalization operation and a ReLU activation function. The output layer includes a convolution operation and a group normalization operation.

3. The tumor image segmentation system based on dynamic position coding according to claim 1, characterized in that: The inter-layer registration module includes an encoder, a decoder, an output layer and a sampler. The encoder includes five layers, each layer includes a convolution operation, a group normalization operation, a ReLU activation function and a pooling operation. The decoder includes four layers, each layer includes an upsampling operation, a convolution operation, a group normalization operation and a ReLU activation function, and the output layer includes a convolution operation, an upsampling operation, a convolution operation and a group normalization operation.

4. The tumor image segmentation system based on dynamic position coding according to claim 1, characterized in that: For the dynamic position coding module, the position coding method is as follows: if the current pixel is a non-tumor area pixel, the pixel position code is 0; if the current pixel is a tumor area pixel, the position code is calculated based on the total number of tumor area pixels in the current image, the horizontal relative position of the current pixel in the current image, and the vertical relative position of the current pixel in the current image.

5. The tumor image segmentation system based on dynamic position coding according to claim 4, characterized in that: The calculation method of the horizontal relative position is: arrange and number the pixels of the tumor area in the current image one by one in the horizontal order from top to bottom, and record the number of the current pixel as Index(i,j) x , then calculate Index(i,j) x Subtract the total number of pixels in the tumor area in the current image, and then take the absolute value, and add it to Index(i,j) x Of the absolute values, take the smaller value as the horizontal relative position; The calculation method of the longitudinal relative position is: the pixels of the tumor area in the current image are arranged and numbered one by one in the longitudinal order from left to right, and the number of the current pixel is recorded as Index(i,j) y , then calculate Index(i,j) y Subtract the total number of pixels in the tumor area in the current image, and then take the absolute value, and add it to Index(i,j) y Of the absolute values, take the smaller value as the vertical relative position.

6. The tumor image segmentation system based on dynamic position coding according to claim 4, characterized in that: The horizontal relative position and the vertical relative position are divided by the total number of pixels in the tumor area in the current image, respectively, and then scaled and added to obtain the position code.

7. The tumor image segmentation system based on dynamic position coding according to claim 1, characterized in that: The encoder of the segmentation network module based on the attention mechanism includes two layers of convolution operations, group normalization operations, ReLU activation functions and pooling operations, and two layers of attention mechanism neural networks. The decoder includes four layers, each layer includes upsampling operations, convolution operations, group normalization operations and ReLU activation functions, and the output layer includes convolution operations and group normalization operations.

8. The tumor image segmentation system based on dynamic position coding according to claim 7, characterized in that: The neural network of the attention mechanism includes a multi-head self-attention feature extraction operation, a group normalization operation, a ReLU activation function and a pooling operation.

9. A tumor image segmentation method based on dynamic position coding, based on the tumor image segmentation system based on dynamic position coding according to any one of claims 1 to 8, characterized in that: include: Step 1, using a two-dimensional image dataset to train an organ pre-segmentation module and an inter-layer registration module; Step 2: Input the two-dimensional image layer to be detected and the upper and lower layers adjacent to the two-dimensional image layer in space into the trained organ pre-segmentation model and dynamic position coding module, output the dynamic position coding feature map, input the two-dimensional image layer to be detected and the upper and lower layers adjacent to the two-dimensional image layer in space into the trained inter-layer registration module and inter-layer fusion module, and output the enhanced image to be detected; Step 3, using the enhanced image to be detected and the true value of the lesion area segmentation label corresponding to the image, training the segmentation network module based on the attention mechanism; Step 4: Use the above-trained attention-based segmentation network module, organ pre-segmentation module, and inter-layer registration module to perform inference segmentation on the image of the lesion area and generate a lesion segmentation result.

10. The tumor image segmentation method based on dynamic position coding according to claim 9, characterized in that: For the organ pre-segmentation module, inter-layer registration module and attention-based segmentation network module, each is trained using the cross-entropy loss function and back-propagation method until convergence.