Lung CT image segmentation device based on spatial neighborhood analysis
Through the lung CT image segmentation device based on spatial neighborhood analysis, the self-attention mechanism and imaging prior knowledge are used to solve the problem of difficulty in segmenting the lesion boundary with single layer processing and the high hardware requirements of deep learning methods, achieving high accuracy. ,Lung CT image segmentation with low computational load, suitable for clinical application.
Patent Information
- Application Number
- CN202210137852.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-02-15
AI Technical Summary
Existing lung CT image segmentation methods are difficult to accurately segment the lesion boundary when processing a single layer, and the three-dimensional spatial information is insufficiently utilized. Moreover, deep learning methods have high hardware requirements and are difficult to apply in clinical practice. General deep learning segmentation methods are not suitable for specific lesions. Regions have poor interpretability.
A lung CT image segmentation device based on spatial neighborhood analysis is used to extract and fuse the spatial context features between continuous neighborhood layers through image preprocessing, spatial neighborhood feature recognition, self-attention feature decoding and multi-view area calibration modules. , using the self-attention mechanism to remap features to achieve accurate 3D image segmentation, and perform calibration and completion through imaging prior knowledge.
It improves the precision and accuracy of lung CT image segmentation, reduces the amount of calculation, does not rely on complete three-dimensional annotation data, provides interpretable auxiliary analysis basis, and is suitable for clinical applications.
Smart Images

Figure CN114549552B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a lung CT image segmentation device based on spatial neighborhood analysis. Background Art
[0002] Lung CT images are a series of cross-sectional continuous image layers obtained through computer tomography. By locating and segmenting the lung CT lesion area through image processing technology, it can provide image visualization and quantitative analysis results for radiologists, thereby providing assistance for clinical diagnosis and disease detection.
[0003] Existing lung CT image segmentation devices usually process a single layer or analyze the three-dimensional image composed of all layers. However, various processing methods have the following problems:
[0004] First, the image segmentation method for a single layer only uses the two-dimensional spatial information of the cross-section of the CT image, which makes it difficult to accurately segment the boundary area of some lesions. The layer thickness of high-resolution CT images is usually around 1 mm, and the actual size of most lesions to be segmented is much larger than the layer thickness. Therefore, a single cross-sectional layer is difficult to provide effective information in the other two orthogonal directions in three-dimensional space, resulting in discontinuous or missing segmentation results;
[0005] Second, the intra-slice spacing (resolution) of CT images is usually smaller than the inter-slice spacing (slice thickness), that is, there is anisotropy in the orthogonal directions, which leads to the need for image segmentation methods that use three-dimensional spatial regions as processing units to unify the pixel spacing in all directions through image interpolation, and different interpolation strategies will directly affect the accuracy of image segmentation of the lesion area;
[0006] Third, deep learning methods represented by three-dimensional convolution have stronger spatial feature analysis capabilities and are not affected by anisotropy, but their overall parameter scale and computational complexity have increased by an order of magnitude, which places high demands on hardware equipment. Image segmentation methods based on three-dimensional supervisory information rely on complete 3D annotation of the lesion area, making them difficult to apply in clinical practice. Fourth, among the existing medical image processing schemes, there are no solutions for specific lung CT lesion segmentation scenarios, and general deep learning segmentation methods use the image features of supervisory information (image annotation data) as a guide to achieve result reasoning. Their interpretability for specific lesion areas is poor. How to flexibly apply them to clinical diagnostic practice and combine them with the actual needs of physicians is still a problem that needs to be considered.
[0007] Through literature search, it was found that there is an implicit inverse attention mechanism for segmenting the new coronavirus lesion area in chest CT images. This method only segments the lesion area for a single CT layer, and does not fully consider the three-dimensional spatial information of the lesion area contained between CT layers; another method performs two-dimensional convolution on continuous CT layer slices to achieve three-dimensional vascular structure segmentation. This method integrates the image features of multiple adjacent two-dimensional CT layer slices in the channel domain, and extracts the semantic information of a single layer from the fused features through non-local attention. However, this scheme only integrates features in the channel dimension for local neighborhood images, and fails to truly analyze the correlation semantic information between a single pixel and other pixels in the three-dimensional spatial neighborhood. Summary of the invention
[0008] The embodiment of the present application proposes a lung CT image segmentation device based on spatial neighborhood analysis, which extracts and fuses spatial context features between continuous neighborhood layers, and remaps the fused features into channel domain two-dimensional image components through a self-attention mechanism, thereby guiding the feature decoding process of a single CT layer and achieving accurate three-dimensional image segmentation.
[0009] Specifically, the lung CT image segmentation device based on spatial neighborhood analysis proposed in the embodiment of the present application includes:
[0010] The image preprocessing module is used to standardize the image format of the input original CT image file to obtain the image pixel value, calculate the lung parenchyma foreground area mask corresponding to each layer in the original lung CT image file, and merge a single foreground area layer and its front and back neighboring layers into a set of neighboring layer slice sequences;
[0011] The spatial neighborhood feature recognition module is used to extract the two-dimensional lesion image features in each neighborhood layer slice sequence in parallel using the preset coding convolution block, extract the local three-dimensional spatial semantic features between the neighborhood layer slice sequences, fuse the extracted local three-dimensional spatial semantic features through the three-dimensional convolution operation, and obtain the coding feature maps of the lesion area of different scales;
[0012] The self-attention feature decoding module is used to combine the self-attention mechanism of channel correlation analysis, remap the fused features into two-dimensional image features corresponding to a single CT layer, perform multi-scale feature decoding based on the obtained two-dimensional image features, and obtain a normalized weight matrix corresponding to each lesion area;
[0013] The multi-view region calibration module is used to normalize the weight values of the lesion region in the three orthogonal directions of the transverse, sagittal and coronal planes in the normalized weight matrix, calibrate and check the lesion region based on prior knowledge of imaging, and output a three-dimensional lesion region mask as the segmentation result.
[0014] Optionally, the image preprocessing module includes:
[0015] An image standardization unit is used to convert the CT values in the original image sequence into image grayscale values under a specific CT window to obtain a lung window standardization matrix for segmentation of the lung parenchyma region of interest;
[0016] A region of interest extraction unit, used for identifying the lung parenchyma region in the standardized CT image layer as a valid foreground region of interest;
[0017] The neighborhood layer slice sequence generating unit is used for processing the lung parenchyma foreground pixel matrix into multiple groups of neighborhood layer slice sequences along the directions of three orthogonal views of the cross section, sagittal plane and coronal plane.
[0018] Optionally, the spatial neighborhood feature recognition module includes:
[0019] A multi-scale feature encoding unit, which is used to take a neighborhood layer slice sequence as input and extract two-dimensional image features of each layer in the sequence in parallel;
[0020] The context feature fusion unit realizes multi-scale fusion of the encoded feature maps of the neighborhood layer slice sequence at different levels to identify the spatial feature information in the three-dimensional neighborhood.
[0021] Optionally, the context feature fusion unit is specifically used to:
[0022] For the encoded feature maps from the upper and lower neighborhoods, a three-dimensional convolution kernel is used to extract features from the local neighborhood to obtain the neighborhood context fusion feature sub-map, which is then batch normalized and activated using a linear rectifier activation function.
[0023] Repeat the above operation for each channel, and superimpose the calculation results of all channels in channel order to obtain the final context fusion feature map.
[0024] Optionally, the self-attention feature decoding module includes:
[0025] A self-attention control unit is used to take the cross-sectional decoding feature map and the context fusion feature map of the neighborhood layer slice sequence as input, and remap the lesion features corresponding to the original layer sequence based on the channel domain feature correlation;
[0026] The multi-scale feature decoding unit is used to take cross-sectional encoded feature maps of different scales as input, upsample the encoded feature maps after self-attention regulation to the original input size using a deconvolution operation, and map the image features to lesion category labels.
[0027] Optionally, the self-attention feature decoding module is specifically used to:
[0028] Adjust the weights of each channel of the fusion feature map to identify the correlation between feature channels:
[0029] The remapping matrix is convolved to restore the number of channels and input features Figure 1 Use the reshape operation to restore the matrix size to be consistent with the input feature map;
[0030] Output the contextual self-attention weighted feature map with the same size as the cross-sectional encoding feature map.
[0031] Optionally, the multi-scale feature decoding unit is specifically used to:
[0032] Taking cross-sectional encoding feature maps of different scales as input, the encoding feature maps after self-attention modulation are upsampled to the original input size using deconvolution operations, and the image features are mapped to lesion category labels;
[0033] The normalized category weight matrix Y that is consistent with the size of a single-layer CT image is output as the segmentation result.
[0034] Optionally, the multi-view area calibration module includes:
[0035] A multi-view normalization unit is used to normalize the weights of the lesion area from three orthogonal directions: the transverse plane, the sagittal plane, and the coronal plane;
[0036] The associated region calibration unit is used to calibrate and check the lesion region based on prior knowledge of imaging, and output a three-dimensional lesion region mask as a segmentation result.
[0037] Optionally, the multi-view normalization unit is specifically used to:
[0038] Parallel processing of the same set of CT images of the cross-section, sagittal, and coronal neighborhood layer slices, respectively, to obtain the cross-section segmentation result normalized weight matrix Y T , Normalized weight matrix Y of sagittal segmentation result C , Normalized weight matrix Y of coronal segmentation results S As the input of the multi-view feature fusion unit;
[0039] For any coordinate position x in three-dimensional space, T , x C , x S ), the corresponding normalized weight vectors of the transverse, sagittal, and coronal segmentation results are y T ,y C ,y S ;
[0040] The multi-view normalized weight matrix is Y = [y T ,y C,y S ], the multi-view lesion category weight distribution matrix is W = [w 0 , w 1 , ..., w N ], respectively represent the normalized weights of the segmentation results of N categories of lesions, and the multi-view fusion normalized weight matrix Z is calculated as:
[0041] Z=W T Y;
[0042] The multi-view fusion normalized weight matrix is summed up by column to obtain a multi-view fusion normalized weight vector of length 5, which represents the final normalized weights of the background area and each lesion, respectively. A threshold is set to filter and determine whether a pixel belongs to a certain lesion area.
[0043] Optionally, the associated area calibration unit is specifically used to:
[0044] Complete the missing areas between layers;
[0045] Based on the idea of image interpolation, the associated region calibration unit compares the front and back k-neighboring layers of non-lesion pixels according to the multi-view normalization matrix;
[0046] If the lesion category weights at the same position in the front and rear k neighboring layers all exceed a certain threshold, the pixel point is judged to meet the characterization of this type of lesion in this layer, and the category weight is corrected to the average of the corresponding pixel category weights in the front and rear neighboring layers.
[0047] Beneficial effects:
[0048] For the task of lung CT image segmentation, based on the analysis of the two-dimensional image features of a single CT layer, the present invention makes full use of the local three-dimensional spatial information between CT layers to improve the image segmentation accuracy of complex lesion tissue boundaries, and does not rely on complete three-dimensional annotation data, so the overall computational complexity is lower. At the same time, the imaging prior knowledge is used to complete and verify the associated regions of the multi-view fusion features, which ensures the accuracy of image segmentation and provides an explainable auxiliary analysis basis for clinical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 This is a schematic diagram of the structure of a lung CT image segmentation device based on spatial neighborhood analysis proposed in an embodiment of the present application;
[0051] Figure 2 A detailed structural diagram of the device proposed in the embodiment of the present application;
[0052] Figure 3 A flow chart showing the principle of the method proposed in the embodiment of the present application;
[0053] Figure 4 Schematic diagram of the module structure proposed in the embodiment of this application Figure 1 ;
[0054] Figure 5 Schematic diagram of the module structure proposed in the embodiment of this application Figure 2 . DETAILED DESCRIPTION
[0055] In order to make the structure and advantages of the present application clearer, the structure of the present application will be further described below in conjunction with the accompanying drawings.
[0056] Combined with Figures 1 to 5 The present application proposes a lung CT image segmentation device based on spatial neighborhood analysis, which includes an image preprocessing module, a spatial neighborhood feature recognition module, a self-attention feature decoding module and a multi-view region calibration module, wherein: the image preprocessing module normalizes the CT value under the lung window to the image pixel value according to the original lung CT image file, calculates the lung parenchyma foreground area mask corresponding to each layer, and merges the single foreground area layer and its front and back neighborhood layers into a group of neighborhood sequences for subsequent feature extraction process; the spatial neighborhood feature recognition module uses the encoding convolution block to extract the two-dimensional lesion image features of each neighborhood sequence in parallel, and extracts the two-dimensional lesion image features through three-dimensional convolution. The local three-dimensional spatial semantic features between neighborhood sequences are taken and fused to obtain encoding feature maps of lesion areas of different scales; the self-attention feature decoding module remaps the context fusion features to the two-dimensional image features corresponding to a single CT layer through the self-attention mechanism combined with channel correlation analysis, and performs multi-scale feature decoding based on the remapped features to finally obtain the normalized weight matrix corresponding to each lesion area; the multi-view area calibration module normalizes the weights of the lesion areas from three orthogonal directions: transverse, sagittal, and coronal, and calibrates and checks the lesion areas based on imaging prior knowledge, and finally outputs a three-dimensional lesion area mask as the segmentation result.
[0057] The image preprocessing module performs necessary image format standardization on the input original CT image file and extracts the region of interest (ROI) of the lung parenchyma, including an image standardization unit, a region of interest extraction unit, and a neighborhood sequence generation unit.
[0058] The image standardization unit converts the original CT image sequence into a processable digital image. First, the CT values in the original image sequence are converted into image grayscale values under a specific CT window to obtain a lung window standardization matrix for segmentation of the lung parenchyma region of interest.
[0059] The region of interest extraction unit identifies the lung parenchyma region in the standardized CT image layer as an effective foreground ROI. The present invention uses but is not limited to the flood filling method to segment the lung parenchyma foreground region, and applies the segmentation binary mask result to the lung window image standardized matrix to output the lung parenchyma foreground pixel matrix.
[0060] The neighborhood sequence generation unit processes the lung parenchyma foreground pixel matrix into multiple sets of neighborhood layer slice sequences (referred to as neighborhood sequences) along the directions of the three orthogonal views of the cross section, sagittal plane, and coronal plane. Specifically, the input lung parenchyma ROI foreground pixel matrix is denoted as L, which contains d layers of cross-sectional layers with a width of 512 pixels and a height of 512 pixels. The cross-sectional layers of the foreground pixel matrix are represented as The coronal layers are represented as The sagittal plane layers are represented as For any layer L in any view k , its only corresponding neighborhood layer sequence B k It is defined as the three-dimensional submatrix in its upper and lower neighborhoods, namely B k ={L k-1 , L k , L k+1}, the neighborhood of the boundary layer is filled with a zero matrix, and finally a sequence of d cross-section neighborhoods is generated 512 coronal neighbor sequences and 512 sagittal neighbor sequences The neighborhood sequence takes multiple adjacent cross-sectional layers as the basic unit of feature extraction, thereby expanding the local receptive field from the two-dimensional plane to the three-dimensional space, providing the original input for context feature extraction.
[0061] The spatial neighborhood feature recognition module extracts and fuses the two-dimensional image features and three-dimensional neighborhood features of the lesion area through an encoder network based on context feature analysis, and outputs a context fusion feature map corresponding to a single CT layer. Its structure includes a multi-scale feature encoding unit and a context feature fusion unit.
[0062] The multi-scale feature encoding unit takes the neighborhood sequence as input and extracts the two-dimensional image features of each layer in the sequence in parallel, where: any layer L in the sequence k The feature encoding unit contains 4 convolutional layers Convi (i=1,2,3,4), each layer uses three sets of continuous 3×3×C i (C i =64×i) residual convolutional blocks as the backbone network structure. For the i-th encoding convolutional layer, its input is the feature map from the previous layer The encoding feature map f of the current layer is extracted through the following processing i :
[0063]
[0064] Among them, Conv i is the encoding convolution operation with batch normalization for the corresponding layer, and uses the linear rectifier activation function ReLU=max(0,x) for activation; Maxpool is the maximum pooling operation. The encoder finally calculates the feature map representation of the single channel layer at four scales, from low to high.
[0065] The context feature fusion unit realizes multi-scale fusion of the encoded feature maps of the neighborhood sequence at different levels to identify the spatial feature information in the three-dimensional neighborhood. Different image channels reflect different feature information, so the fusion of two-dimensional image features can be achieved by channel domain cascading. However, for the encoded feature maps from the upper and lower neighborhoods, the image semantic features reflected by each channel are the same, and it is difficult to satisfy the representation of the three-dimensional features of complex lesions by relying solely on channel weighting. Therefore, the context feature fusion unit uses a three-dimensional convolution kernel to extract features from the local neighborhood. Specifically, the three feature maps input to the context feature fusion unit are denoted as f k-1 、f k 、f k+1 , whose size is H*W*C, for each channel c (c = 1, 2, ..., C), the two-dimensional feature map composed of its width and height is recorded as s c , the two-bit feature maps corresponding to the c-th channel of the three feature maps are superimposed in sequence in the channel dimension to obtain the neighborhood feature sub-map in Represents the two-dimensional feature map of the k-1th layer CT image in the cth channel, represents the channel dimension feature cascade. Then the neighborhood feature subgraph S is processed using a three-dimensional convolution kernel. c Perform feature extraction to obtain a neighborhood context fusion feature subgraph g with a size of H*W*1 c :
[0066]
[0067] Conv3d is a three-dimensional convolution operation, followed by a batch normalization operation and activation using the linear rectifier activation function ReLU=max(0,x). Repeat the above operation for each channel, and superimpose the calculation results of all channels in channel order to obtain the final context fusion feature map g. k :
[0068]
[0069] A context feature fusion operation is performed after each feature encoding convolution block in each layer. Therefore, the context feature fusion module finally outputs 4 scale fusion feature maps, from low to high.
[0070] The self-attention feature decoding module decodes the multi-scale context fusion features and embeds the context self-attention mechanism to remap the two-dimensional image feature components of the neighborhood layer from the fusion features, thereby restoring the context fusion features to the two-dimensional image features of the input layer, thereby guiding the feature decoding process. Its structure includes: a self-attention control unit and a multi-scale feature decoding unit. Among them, the self-attention control unit analyzes the feature correlation in the channel domain according to the cross-sectional feature map and the context fusion feature map, and uses the self-attention mechanism to identify the remapping of the two-dimensional image features in the spatial dimension to obtain the weight-adjusted lesion area feature map; the multi-scale feature decoding unit uses 4 decoding convolution blocks corresponding to the encoder to realize feature map upsampling, and finally maps the high-level feature map to the pixel-level label matrix of the lesion area.
[0071] The self-attention control unit takes the cross-sectional decoding feature map of the neighborhood sequence and the context fusion feature map as input, and remaps the lesion features corresponding to the original layer sequence based on the channel domain feature correlation. Since the context fusion feature map superimposes the 3D spatial feature extraction results of each neighborhood layer along the channel dimension, the self-attention control unit first adjusts the weights of each channel of the fusion feature map to identify the correlation between feature channels:
[0072] g e =sigmoid(Linear C / R→c (ReLU(Linear C→C / R (P(g)))))
[0073] Among them, g is the context fusion feature map from the input; P is the adaptive average pooling operation, and its general form is Linear X→Yis a fully connected layer, which maps the vector with input channel X to the vector with output channel Y; ReLU is a linear rectification activation function, and its general form is ReLU(x)=max(0,x); sigmoid is a logistic regression activation function, and its general form is Based on the context fusion features, the correlation analysis and weight mapping of the cross-sectional decoding features are performed: First, the global channel features of the two feature maps are calculated by adaptive average pooling, and the weight mapping process is implemented using the Softmax normalization function:
[0074] g θ =(reshape (H,W,C)→(HW,C) (P(Conv 1×1 (g e ))) T
[0075]
[0076]
[0077] Where, f is the cross-sectional decoding feature map from the input; g e Context fusion feature map after channel attention adjustment; reshape (H,W,C)→(HW,C) Linearization operation for channel dimension: For a given H×W×C three-dimensional matrix, linearize the first two dimensions into a HW×C two-dimensional matrix along the width and height directions; Conv 1×1 is a 1×1 convolution operation with batch normalization. The number of convolution kernels is half the number of input feature map channels to reduce the number of parameters. T is a matrix transpose operation. θ , Respectively represent the two global channel feature maps used for weight mapping; Softmax is a normalization function, and its form is where y i is the weight of the i-th lesion area category, y 0 Represents the non-lesion background area; Φ represents the self-attention weight mapping matrix. The channel domain feature representation map of the context fusion encoding feature is calculated in the same way. The feature representation map corresponds to the weight mapping matrix, so the multiplier is used to weight the mapping weight to the corresponding channel dimension representation of the encoding feature:
[0078] f c =reshape (H,W,C)→(HW,C) (P(Conv 1×1 (f)))
[0079] f Φ =Φ*f c
[0080] where fc is the channel dimension feature representation of the cross-sectional decoding feature, and Φ is the channel dimension remapping matrix of the encoded feature. The remapping matrix is restored to the number of channels and the input feature using a 1×1 convolution. Figure 1 The reshape operation is used to restore the matrix size and input features. Figure 1 To:
[0081] SA(f, g) = f + reshape (HW,C)→(H,W,C) (Conv 1×1 (f Φ ))
[0082] Where f is the original cross-sectional decoding feature map, reshape (HW,C)→(H,W,C) It is an inverse linearization operation: convert the HW×C two-dimensional matrix into a H×W×C three-dimensional matrix. Finally, the self-attention control unit outputs a contextual self-attention weighted feature map SA(f, g) that is consistent with the size of the cross-sectional encoding feature map.
[0083] The multi-scale feature decoding unit takes the cross-sectional encoding feature maps of different scales as input, uses the deconvolution operation to upsample the encoding feature maps after self-attention regulation to the original input size, and maps the image features to the lesion category label. Corresponding to the encoding process, the feature decoding unit contains a total of 4 decoding layers, and the input of the i-th layer is the weighted feature map h of the self-attention control unit i , the size and number of groups of the decoding convolution block are consistent with the corresponding layer encoding convolution block, followed by upsampling operation:
[0084]
[0085] Finally, a fully connected layer is used to convert the image features into a lesion category score vector and normalized using Softmax:
[0086] Y=Softmax(Linear 1→N (h 1 ))
[0087] Linear is a fully connected layer that maps each pixel in the 512×512×1 feature map to a lesion category score vector of length N, where N is the number of lesion area categories to be segmented. Softmax is a normalization function in the form of where y i is the weight of the i-th lesion area category, y 0 Represents the non-lesion background area. The final output is a normalized category weight matrix Y that is consistent with the size of a single-layer CT image as the segmentation result.
[0088] The multi-view region calibration module receives the normalized weight matrix of the lesion region segmentation results from different views, and uses prior knowledge to normalize, calibrate and check the results of different views. Its structure includes a multi-view normalization unit and an associated region calibration unit.
[0089] The slice image representations of different lesion areas in different views are different. In order to further utilize the image features of the lesion in three-dimensional space, the present invention processes the cross-sectional, sagittal, and coronal neighborhood layer slices of the same set of CT images in parallel during the implementation process, and obtains the normalized weight matrix Y of the cross-sectional segmentation result respectively. T , Normalized weight matrix Y of sagittal segmentation result C , Normalized weight matrix Y of coronal segmentation results S As the input of the multi-view feature fusion unit. For any coordinate position x in the three-dimensional space, T , x C , x S ), the corresponding normalized weight vectors of the transverse, sagittal, and coronal segmentation results are y T ,y C ,y S In order to assign appropriate weights according to the lesion image representations of different views, a weight vector of length 3 is set for the background category and each lesion category:
[0090]
[0091] Where X represents a lesion category or background area; w X Assign a weight vector to the category whose sum is 1; w r is the weight ratio of the category in the corresponding view. The multi-view normalized weight matrix is Y = [y T ,y C ,y S ], the multi-view lesion category weight distribution matrix is W = [w 0 , w 1 , ..., w N ], respectively represent the normalized weights of the segmentation results of N categories of lesions, then the multi-view fusion normalized weight matrix Z is calculated as:
[0092] Z=W T ·Y
[0093] By summing the multi-view fusion normalized weight matrix by column, we can get a multi-view fusion normalized weight vector of length 5, which represents the final normalized weights of the background area and each lesion respectively. By setting a threshold for screening, we can determine whether a pixel belongs to a certain lesion area.
[0094] The lung CT image segmentation network based on spatial neighborhood analysis has good supervised learning ability for the three-dimensional spatial features of lesions, but the morphological manifestations of lung tissue and lesion structures vary in different individuals and at different times. It is difficult to adapt to various complex diagnostic needs only based on the image features of training data. In order to improve the clinical practical value, the present invention designs an associated region calibration algorithm, which converts the prior knowledge of the structure to be segmented into image feature judgment rules, and uses it as a post-processing process for image segmentation to achieve interpretable lesion region correction and inspection.
[0095] The associated region calibration unit first completes the missing regions between layers. Since the segmentation network has poor discrimination between some highly confusing lesions and non-lesion tissues, there are missed recognitions due to local overfitting at some levels. Based on the idea of image interpolation, the associated region calibration unit compares the front and back k neighboring layers of non-lesion pixels according to the multi-view normalization matrix. If the lesion category weights at the same position in the front and back k neighboring layers exceed a certain threshold, it can be determined that the pixel also meets this type of lesion representation in the layer, and its category weight is corrected to the average of the corresponding pixel category weights of the front and back neighboring layers.
[0096] In order to ensure the accuracy of category calibration and image segmentation, based on the prior knowledge of imaging, the associated region calibration unit further checks the calibrated image segmentation results through a post-processing verification algorithm. Prior knowledge of imaging is based on statistical laws of different dimensions and can be applied to the basis for distinguishing lesion images in clinical practice, and can be implemented as a series of prior rules of digital image processing algorithms. Its descriptive elements include but are not limited to area, volume, CT value under different window widths and window positions, grayscale, density projection results, histogram analysis results, multi-plane reconstruction results, etc. The present invention performs a three-dimensional connected region analysis on the calibrated normalized matrix, and uses regression analysis or threshold binary classification methods to check whether each connected domain meets the prior rules and retains its weight. Finally, the associated region calibration module performs weight normalization on each three-dimensional connected sub-region, and sets the pixel points above the judgment threshold to the corresponding lesion category, and outputs the lesion three-dimensional region mask matrix.
[0097] Figure 2 This is a lung CT image segmentation system based on spatial neighborhood analysis involved in this embodiment, wherein the service layer implements an image preprocessing module, a spatial neighborhood feature recognition module, a self-attention feature decoding module, and a multi-view area calibration module, and each module is functionally divided into a feature preprocessor, a feature codec, and a feature postprocessor to implement the method flow of spatial neighborhood image segmentation; the data layer provides data persistence storage for the image segmentation service, and then realizes functions such as background model training and prior knowledge management; the application layer provides a service call interface for the image segmentation process.
[0098] The service layer implements the related functions of the image preprocessing module, spatial neighborhood feature recognition module, self-attention feature decoding module and multi-view region calibration module by instantiating feature preprocessors, feature codecs and feature postprocessors, and uses RabbitMQ message queues to process and schedule asynchronous requests. Specifically, the image preprocessing module implements pixel standardization of lung parenchyma and extraction of regions of interest, and generates neighborhood sequences in orthogonal directions. The relevant preprocessing parameters are dynamically loaded in the form of json configuration files, where the pixel standardization unit sets the window width value of 1500Hu and the window level value of -650Hu to convert the original CT image into a standard grayscale image under the lung window. The region of interest extraction unit sets 8 neighborhoods as the flood filling range, sets 20 as the threshold for grayscale binarization of the CT cross section under the bone window, and uses (10,10), (10,502), (256,10), (256,502), (502,10), (502,502) of each cross section as the starting seed point for multiple rounds of background filling. Morphological opening operation is applied to the cavity area with an area less than 100 to achieve filling, and finally the complete lung parenchyma region of interest mask is calculated. The neighborhood sequence generation unit sets the neighborhood size parameter to 1, and uses 3 threads to generate neighborhood sequence layers in parallel along the cross section, sagittal plane, and coronal plane respectively; the spatial neighborhood feature recognition module and the self-attention feature decoding module jointly realize the end-to-end lesion region feature encoding and decoding process, among which the maximum pooling operation of the feature recognition module uses a 3×3 convolution kernel with a step size of 2, and the feature extraction operation of the context feature fusion unit uses a 3×3×3 three-bit convolution kernel. The feature codec loads the self-attention segmentation network model and its related configuration parameters that have been trained offline, and extracts the spatial context features of three orthogonal neighborhood sequences in parallel, where the upsampling operation is achieved through 2x bilinear pooling interpolation. The single neighborhood sequence is sequentially subjected to multi-scale feature encoding, neighborhood spatial feature fusion, self-attention control, and multi-scale feature decoding to obtain the normalized decoding feature map of the lesion area. The intermediate results of the relevant feature maps are stored in the form of a multi-dimensional matrix; the multi-view region calibration module uses the region calibration algorithm to achieve the calibration and fusion of the results of different orthogonal views. The relevant region calibration parameters are dynamically loaded in the form of a json configuration file, and the evaluation algorithm is integrated into the post-processing process in the form of a dynamic link library so. Taking pulmonary fibrosis image segmentation (including four types of lesion areas: consolidation, ground-glass opacity, honeycomb opacity, and reticular opacity) as an application example, the segmentation category N is set to 4, and the weight vector of the multi-view normalization unit for each lesion area is set to: background [0.33, 0.33, 0.33], consolidation [0.5, 0.25, 0.25], ground-glass opacity [0.6, 0.2, 0.2], honeycomb opacity [0.33, 0.33, 0.33], reticular opacity [0.33, 0.33, 0.33].The associated region calibration unit sets the number of adjacent layers to be compared to 5, and converts the discrimination basis of various lesion regions in the prior knowledge base into the corresponding image analysis algorithm to ensure the accuracy of category correction. Among them, the consolidation shadow has a higher gray value and multi-directional spatial structure under the lung window, so the three-dimensional Gaussian filter is used to calculate and compare whether the gray value under the lung window is greater than 200; the ground-glass shadow has a higher density than the whole lung, so the relative average density of the local lesion and the whole lung can be calculated and compared. If the average density of the local lesion area exceeds 25% of the average density of the whole lung, it can be identified as an effective ground-glass shadow area; honeycomb shadow and reticular shadow both have the characteristics of uneven density of the lesion area, but the honeycomb shadow contains a low-density cavity and the reticular shadow has a higher overall CT value. Therefore, in order to distinguish the two types of lesions, the local area of the lesion is first converted into a binary image by the original CT image according to the window level -600 and the window width 1000. The low-density area under this window width and window level will be mapped to a lower pixel value, while the medium and high density areas will be mapped to high pixel values. Then, the grayscale histogram of the local area is statistically analyzed. First, the ratio of the number of pixels with the highest grayscale value to the maximum value of the number of pixels with other grayscale values is calculated. If the ratio is greater than 5 and has density unevenness, it can be used as a factor in determining whether it is a honeycomb or reticular shadow. Then, the proportion of pixels with a grayscale value lower than 50 is calculated. If the ratio is higher than 15%, it can be determined as a honeycomb shadow, otherwise it is a reticular shadow.
[0099] The data layer stores unstructured feature data and prior knowledge in the form of json configuration files based on MongoDB, and implements necessary resource management functions, including offline training of the model and conversion of prior knowledge to image features. Among them, the offline training process of the segmentation model uses random horizontal flipping and random vertical flipping of the neighborhood sequence granularity as data enhancement strategies, uses Dice as the loss function, sets the basic learning rate to 0.005, and the momentum hyperparameter is 0.9 to iteratively update the model weights; the image feature conversion of prior knowledge is based on OpenCV related digital image processing functions, and the calibration parameter interface file is provided in the form of a dynamic link library to the post-processing step for flexible calling.
[0100] The application layer receives the original lung CT image file from the user through the service call interface, and returns the image segmentation mask result after being processed by the service layer algorithm, thereby realizing other upper-layer applications. The call interface uses the medical image DICOM (Digital Imaging and Communications in Medicine) file as the standard input format, sends the original image file data to the service layer scheduling queue for subsequent processing, and encapsulates the processed result area mask matrix in the NIfTI (Neuroimaging Informatics Technology Initiative) standard image file format, and returns the result to the service call point through an asynchronous request.
[0101] The parameter comparison between the above implementation process and the prior art is shown in Table 1.
[0102] Table 1 Comparison of technical characteristics
[0103]
[0104]
[0105] Compared with the prior art, the present invention proposes a lung CT image segmentation device based on spatial neighborhood analysis. This method improves the accuracy of lung CT lesion area image segmentation, does not rely on complete three-dimensional lesion area annotation data, and has good ease of use and scalability. The present invention extracts the two-dimensional image features of a single CT layer and its front and back neighborhood layers in parallel, and fuses the spatial context features between neighborhood sequences through three-dimensional convolution to achieve the description of the spatial semantics of the three-dimensional lesion area; based on the self-attention mechanism, the context fusion features are remapped to the two-dimensional image features corresponding to the neighborhood layer to improve the accuracy of multi-scale feature decoding; based on the lesion prior knowledge, the three-dimensional lesion area segmentation results are completed and verified through multi-view result normalization and associated area calibration, and the scalability and interpretability of the algorithm are improved for different clinical diagnosis needs.
[0106] The above description is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A lung CT image segmentation device based on spatial neighborhood analysis, characterized in that: The device comprises: The image preprocessing module is used to standardize the image format of the input original CT image file to obtain the image pixel value, calculate the lung parenchyma foreground area mask corresponding to each layer in the original lung CT image file, and merge a single foreground area layer and its front and back neighboring layers into a set of neighboring layer slice sequences; The spatial neighborhood feature recognition module is used to extract the two-dimensional lesion image features in each neighborhood layer slice sequence in parallel using the preset coding convolution block, extract the local three-dimensional spatial semantic features between the neighborhood layer slice sequences, fuse the extracted local three-dimensional spatial semantic features through the three-dimensional convolution operation, and obtain the coding feature maps of the lesion area of different scales; The self-attention feature decoding module is used to combine the self-attention mechanism of channel correlation analysis, remap the fused features into two-dimensional image features corresponding to a single CT layer, perform multi-scale feature decoding based on the obtained two-dimensional image features, and obtain a normalized weight matrix corresponding to each lesion area; The multi-view region calibration module is used to normalize the weight values of the lesion region in the three orthogonal directions of the cross section, sagittal plane, and coronal plane in the normalized weight matrix, calibrate and check the lesion region based on the prior knowledge of imaging, and output the three-dimensional lesion region mask as the segmentation result; The self-attention feature decoding module includes: A self-attention control unit is used to take the cross-sectional decoding feature map and the context fusion feature map of the neighborhood layer slice sequence as input, and remap the lesion features corresponding to the original layer sequence based on the channel domain feature correlation; A multi-scale feature decoding unit, which is used to take cross-sectional encoded feature maps of different scales as input, upsample the encoded feature maps after self-attention modulation to the original input size using a deconvolution operation, and map the image features to lesion category labels; The self-attention feature decoding module is specifically used for: Adjust the weights of each channel of the fusion feature map to identify the correlation between feature channels: Use convolution to restore the number of channels of the remapped matrix to be consistent with the input feature map, and use reshape operation to restore the matrix size to be consistent with the input feature map; Output the contextual self-attention weighted feature map with the same size as the cross-sectional encoding feature map.
2. The lung CT image segmentation device based on spatial neighborhood analysis according to claim 1, characterized in that: The image preprocessing module comprises: An image standardization unit is used to convert the CT values in the original image sequence into image grayscale values under a specific CT window to obtain a lung window standardization matrix for segmentation of the lung parenchyma region of interest; A region of interest extraction unit, used for identifying the lung parenchyma region in the standardized CT image layer as a valid foreground region of interest; The neighborhood layer slice sequence generating unit is used for processing the lung parenchyma foreground pixel matrix into multiple groups of neighborhood layer slice sequences along the directions of three orthogonal views of the cross section, sagittal plane and coronal plane.
3. The lung CT image segmentation device based on spatial neighborhood analysis according to claim 1, characterized in that: The spatial neighborhood feature recognition module includes: A multi-scale feature encoding unit, which is used to take a neighborhood layer slice sequence as input and extract two-dimensional image features of each layer in the sequence in parallel; The context feature fusion unit realizes multi-scale fusion of the encoded feature maps of the neighborhood layer slice sequence at different levels to identify the spatial feature information in the three-dimensional neighborhood.
4. The lung CT image segmentation device based on spatial neighborhood analysis according to claim 3, characterized in that: The context feature fusion unit is specifically used for: For the encoded feature maps from the upper and lower neighborhoods, a three-dimensional convolution kernel is used to extract features from the local neighborhood to obtain the neighborhood context fusion feature sub-map, which is then batch normalized and activated using a linear rectifier activation function. Repeat the above operation for each channel, and superimpose the calculation results of all channels in channel order to obtain the final context fusion feature map.
5. The lung CT image segmentation device based on spatial neighborhood analysis according to claim 1, characterized in that: The multi-scale feature decoding unit is specifically used for: Taking cross-sectional encoding feature maps of different scales as input, the encoding feature maps after self-attention modulation are upsampled to the original input size using deconvolution operations, and the image features are mapped to lesion category labels; Output a normalized class weight matrix consistent with the size of a single-layer CT image As the segmentation result.
6. The lung CT image segmentation device based on spatial neighborhood analysis according to claim 1, characterized in that: The multi-view area calibration module comprises: A multi-view normalization unit is used to normalize the weights of the lesion area from three orthogonal directions: the transverse plane, the sagittal plane, and the coronal plane; The associated region calibration unit is used to calibrate and check the lesion region based on prior knowledge of imaging, and output a three-dimensional lesion region mask as a segmentation result.
7. The lung CT image segmentation device based on spatial neighborhood analysis according to claim 6, characterized in that: The multi-view normalization unit is specifically used for: Parallel processing of the cross-sectional, sagittal, and coronal neighborhood layer slices of the same set of CT images to obtain the normalized weight matrix of the cross-sectional segmentation results , Normalized weight matrix of sagittal segmentation results , Normalized weight matrix of coronal segmentation results As the input of the multi-view feature fusion unit; For any coordinate position in three-dimensional space , and the corresponding normalized weight vectors of the transverse, sagittal, and coronal segmentation results are , , ; The multi-view normalized weight matrix is , the multi-view lesion category weight assignment matrix is , respectively Normalized weights of the segmentation results of lesions of different categories, and normalized weight matrices of multi-view fusion Calculated as: ; The multi-view fusion normalized weight matrix is summed up by column to obtain a multi-view fusion normalized weight vector of length 5, which represents the final normalized weights of the background area and each lesion, respectively. A threshold is set to filter and determine whether a pixel belongs to a certain lesion area.
8. The lung CT image segmentation device based on spatial neighborhood analysis according to claim 6, characterized in that: The associated area calibration unit is specifically used for: Complete the missing areas between layers; Based on the idea of image interpolation, the associated region calibration unit normalizes the front and back pixels of non-lesion pixels according to the multi-view normalization matrix. Compare adjacent layers; If it is before and after If the lesion category weights at the same position in the adjacent layers all exceed a certain threshold, it is determined that the non-lesion pixel meets the characterization of this type of lesion in the layer where it is located, and the category weight is corrected to the average of the corresponding pixel category weights of the previous and next adjacent layers.
