Colorectal cancer auxiliary staging method and system based on CT image
By using an improved UNet network model, combined with dense connections and multi-scale attention mechanisms, the problem of insufficient lesion feature extraction in colorectal cancer CT image staging was solved, achieving highly accurate lesion segmentation and automatic T-staging classification, thus improving the diagnostic efficiency and consistency of colorectal cancer staging.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies for staging colorectal cancer using CT images suffer from insufficient extraction of lesion features and inadequate fusion of multi-level information, resulting in low staging accuracy.
An improved UNet network model is adopted, which combines a dense connection mechanism and a multi-scale attention mechanism. Through dual-path channel attention and a lightweight spatial attention module, combined with a multi-scale combined loss function and a deep supervision mechanism, the network model is optimized to achieve accurate lesion segmentation and automatic T-staging classification.
It significantly improves the accuracy and robustness of auxiliary diagnosis of colorectal cancer, provides an objective and reliable computer-aided diagnostic tool, and enhances the efficiency and consistency of staging diagnosis.
Smart Images

Figure CN121685482A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image processing, and in particular to a colorectal cancer auxiliary staging method and system based on CT images. BACKGROUND
[0002] Colorectal cancer is the third most common malignant tumor worldwide, and accurate preoperative staging is crucial for treatment plan selection and prognosis evaluation. Traditional colorectal cancer T staging mainly relies on the subjective interpretation of CT images by radiologists, but this approach has obvious limitations: poor diagnostic consistency between physicians, easily influenced by personal experience and subjective factors; for complex and variable tumor morphology, there is a lack of standardized recognition templates; in cases where the contrast between the tumor and the surrounding normal tissue is low and the boundary is blurred, accurate positioning and staging judgment are very challenging; in addition, traditional methods are difficult to fully exploit the deep feature information in CT images, and cannot provide objective and consistent staging basis for clinical practice.
[0003] Existing automatic colorectal cancer staging techniques based on CT images mainly use deep learning methods for improvement, such as the existing patent CN202210315512.1 discloses a colorectal cancer staging method based on CBAM attention mechanism and 3D U-Net, which includes the following steps: CT image preprocessing to construct an initial dataset; data cleaning to correct the positive and negative sample ratio in the dataset; data augmentation of the dataset; using CBAM attention mechanism to screen the importance of channel features and spatial features, and using residual connection; selecting the class with the maximum prediction probability as the final prediction class of each element to determine the location of the colorectal tumor region and non-colorectal tumor region in the output image; using a block reasoning method on the predicted image; based on the data fusion idea, merging the CT image containing the tumor region and the original CT image in the channel dimension, inputting into the optimized 3D UNet segmentation model for inference, and obtaining the final colorectal cancer staging result. However, the existing technology still has the following shortcomings: first, the colorectal cancer lesions present complex feature distribution of multiple scales and multiple morphologies in CT images, and the existing image processing methods are difficult to effectively capture and integrate feature information at different levels, resulting in insufficient recognition accuracy of lesion boundaries and internal structures; second, there are complex spatial relationships and subtle imaging differences between colorectal cancer lesions and surrounding normal tissues, and existing methods often fail to fully preserve and utilize key detail information when dealing with such complex image features, affecting the accuracy of staging judgment; in addition, medical image data usually has the characteristics of limited samples and high labeling cost, and existing technologies are prone to insufficient feature learning and poor model generalization ability in small sample scenarios, making it difficult to meet the stability and reliability requirements of clinical applications. SUMMARY
[0004] Therefore, the application provides a colorectal cancer auxiliary staging method and system based on a CT image to solve the technical problem of low staging accuracy caused by insufficient extraction of colorectal cancer lesion features and insufficient multi-level information fusion in the prior art.
[0005] The technical scheme of the application is implemented in the following manner: S1, acquiring an abdominal CT image of a colorectal cancer patient, labeling a colorectal cancer lesion region in the CT image, and obtaining CT image data containing lesion labeling information; S2, preprocessing the CT image data containing lesion labeling information, and constructing a CT image data set containing a training set, a validation set and a test set; S3, constructing an improved UNet network model based on a UNet network architecture, the improved UNet network model fusing a dense connection mechanism and a multi-scale attention mechanism, training and optimizing the improved UNet network model using the CT image data set, and obtaining a trained improved UNet network model; S4, inputting a CT image to be staged into the trained improved UNet network model, and outputting a colorectal cancer T staging result corresponding to the CT image to be staged.
[0006] On the basis of the above technical scheme, preferably, in step S2, the preprocessing includes: data augmentation processing, including rotation transformation and mirror transformation to expand the data set size; and data enhancement processing, including cutting to remove redundant parts and gamma transformation to enhance image contrast.
[0007] On the basis of the above technical scheme, preferably, the improved UNet network model comprises an input layer, an encoder layer, a decoder layer and an output layer connected in sequence: The input layer is used to receive the preprocessed CT image data; The encoder layer is provided with four parallel convolution encoders for extracting multi-level feature representations of different resolutions; The decoder layer is provided with four parallel convolution decoders for restoring feature resolution and fusing encoder features; The skip connection layer connects the corresponding encoder and decoder for transmitting detailed feature information; and the output layer generates a segmentation mask of the colorectal cancer lesion and a T staging classification result.
[0008] On the basis of the above technical scheme, preferably, the encoder layer comprises four parallel convolution encoders and a bottom layer encoder, each convolution encoder comprising a down-sampling layer, a dense connection block and an attention block, and the bottom layer encoder comprising a down-sampling layer and a dense connection block. The decoder layer comprises four parallel convolutional decoders, each of which comprises an up-sampling layer, a densely connected block and a feature fusion module; the decoder recovers the feature resolution layer by layer and fuses the features with the corresponding encoder through a jump connection; The jump connection layer connects the corresponding convolutional encoder and convolutional decoder through a feature calibration module.
[0009] On the basis of the above technical scheme, preferably, the attention block comprises a dual-path channel attention module and a lightweight spatial attention module: The dual-path channel attention module comprises a global channel attention branch and a local channel attention branch, the global channel attention branch generates global channel weights using a global average pooling and a fully connected layer, the local channel attention branch generates local channel weights using an adaptive average pooling and a fully connected layer, and the channel weights of the two branches are fused through a learnable parameter alpha; The lightweight spatial attention module comprises a global spatial attention branch and a local spatial attention branch, the global spatial attention branch generates global spatial weights using a max pooling, an average pooling and a convolution layer, the local spatial attention branch generates local spatial weights using a depthwise separable convolution and a convolution layer, and the spatial weights of the two branches are fused through a learnable parameter beta; The residual gate fusion module performs gate fusion on the channel attention weighted features and the spatial attention weighted features, and the fusion result and the input features are connected through a residual connection to obtain the final output features.
[0010] On the basis of the above technical scheme, preferably, the specific execution process of training and optimizing the improved UNet network model using the CT image dataset comprises: S31, input the preprocessed CT image into the improved UNet network model, extract low-level features through an initial convolutional layer, and obtain basic feature representation through normalization and activation function processing; S32, the encoder layers sequentially process the basic feature representation through the densely connected block and the attention block, and then down-sample, thereby reducing the feature resolution layer by layer and extracting multi-level semantic features; S33, the decoder layers recover the resolution of the multi-level semantic features through up-sampling, fuse the features with the corresponding encoder layers through a jump connection, and obtain the recovered features through the densely connected block processing; S34, an auxiliary output branch is arranged at multiple levels of the decoder, a multi-scale combined loss function is calculated based on the recovered features, and the network parameters are optimized through a deep supervision mechanism.
[0011] On the basis of the above technical scheme, preferably, the specific process of the encoder layer by layer down-sampling feature extraction is: The base feature representation is sent to a dense connection block, the output of each convolutional layer in the dense connection block is spliced with the output of all previous layers in the channel dimension, forming a layer-by-layer accumulated dense feature representation, and the channel number is controlled to grow through the bottleneck layer convolution; The dense feature representation is sent to an attention block for feature weighting, the attention block weights the dense features through a double-path channel attention mechanism and a lightweight spatial attention mechanism, and obtains a weighted feature representation through a residual gate fusion module; The weighted feature representation is down-sampled to reduce the feature resolution, and the output feature of the encoder is obtained as the input feature of the next layer encoder.
[0012] On the basis of the above technical scheme, preferably, the specific process of the decoder layer-by-layer up-sampling feature recovery is: The multi-level semantic feature is up-sampled to restore the feature resolution, and the up-sampled feature is obtained; The up-sampled feature is fused with the corresponding encoder layer feature through a skip connection, the skip connection uses a feature calibration module to adjust the scale difference between the encoder and the decoder feature, the feature calibration module includes a convolutional layer for channel alignment and feature refinement, and a calibrated fusion feature is obtained; An incremental feature fusion strategy is used to process the calibrated fusion feature, a weighted fusion mechanism is used instead of simple channel splicing, the fusion weight is automatically learned through an attention mechanism, and an incremental fusion feature is obtained; The incremental fusion feature is input into a dense connection block for processing, and the output feature of the decoder layer is obtained.
[0013] On the basis of the above technical scheme, preferably, the mathematical expression of the multi-scale combined loss function is: Wherein, is the loss function of the i-th scale, is the corresponding weight coefficient, and the loss function of each scale is defined as: Wherein, the Dice loss function is defined as: The cross-entropy loss function is defined as: The boundary loss function is defined as: Wherein, represents the prediction probability of the n-th pixel, represents the true label of the n-th pixel, and N represents the total number of pixels, represents a smoothing factor for preventing the denominator from being zero, denotes the distance transform value of the nth pixel to the nearest boundary, 、 、 respectively denote the weight coefficients of the Dice loss, the cross-entropy loss and the boundary loss.
[0014] The application provides a CT image-based colorectal cancer auxiliary staging system, which is used to implement the CT image-based colorectal cancer auxiliary staging method according to any one of the above, and comprises: A data acquisition module is configured to acquire abdominal CT images of colorectal cancer patients from a hospital system, and perform labeling to generate CT image data containing lesion labeling information. A data preprocessing module is configured to preprocess the CT image data containing lesion labeling information and construct a CT image dataset. A model construction module is configured to construct an improved UNet network model based on a UNet network architecture, and train and optimize the improved UNet network model using the CT image dataset to obtain a trained improved UNet network model. A staging prediction module is configured to input a CT image to be staged into the trained improved UNet network model to output a colorectal cancer T staging result. A storage module is configured to store the CT image dataset, network model parameters and staging prediction results. A processor is configured to control the coordinated work of the modules and perform corresponding computing and processing tasks.
[0015] The CT image-based colorectal cancer auxiliary staging method and system of the application have the following beneficial effects relative to the prior art: (1) The application realizes accurate lesion segmentation and automatic T staging classification of colorectal cancer CT images by fusing a dense connection mechanism and a multi-scale attention mechanism in the UNet network architecture, combining a multi-scale combined loss function and a deep supervision mechanism. This method can fully utilize the multi-level feature representation of CT images, effectively improve the accuracy and robustness of colorectal cancer auxiliary diagnosis, and provide an objective and reliable computer-aided diagnosis tool for clinicians, which helps to improve the efficiency and consistency of colorectal cancer staging diagnosis.
[0016] (2) The dense connection mechanism used in the application concatenates the output of each convolutional layer with the output of all previous layers in the channel dimension to form a layer-by-layer cumulative dense feature representation, while using a bottleneck layer convolution to control the growth of the number of channels. This mechanism effectively alleviates the gradient vanishing problem in deep networks, enhances the propagation and reuse of feature information, and enables the network to better learn lesion features of different scales, thereby improving the recognition ability of complex lesion regions.
[0017] (3) The dual-path channel attention branch and the lightweight spatial attention branch of the application capture different ranges of attention information through global and local branches respectively, and adaptively fuse them by using learnable parameters a and b. This mechanism can effectively focus on the channel features and spatial positions related to the lesions, suppress the interference of redundant information, and balance the contributions of channel and spatial attention through the residual gating fusion module, significantly improving the network's perception of key lesion features.
[0018] (4) The multi-scale combined loss function designed in the application combines Dice loss, cross-entropy loss and boundary loss, and sets auxiliary output branches at multiple levels of the decoder to realize a deep supervision mechanism. This loss function can constrain network learning from different angles. The Dice loss optimizes the overall segmentation performance, the cross-entropy loss balances the class distribution, the boundary loss enhances the boundary details, and the multi-scale supervision ensures that the network is effectively optimized at different resolution levels, significantly improving the accuracy and boundary clarity of lesion segmentation. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0020] Figure 1 The flow chart of the CT image-based colorectal cancer auxiliary staging method of the present application; Figure 2 The overall structure diagram of the improved UNet network model of the present application; Figure 3 The structure diagram of the dense connection block of the present application; Figure 4 The structure diagram of the attention block of the present application; Figure 5 The structure diagram of the CT image-based colorectal cancer auxiliary staging system of the present application. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present application will be described in detail below. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0022] As Figure 1As shown, the application proposes a CT image-based colorectal cancer auxiliary staging method, comprising the following steps: S1, acquiring abdominal CT images of colorectal cancer patients, labeling the colorectal cancer lesion area in the CT images, and obtaining CT image data containing lesion labeling information; S2, preprocessing the CT image data containing lesion labeling information, and constructing a CT image dataset containing a training set, a validation set and a test set; S3, constructing an improved UNet network model based on the UNet network architecture, the improved UNet network model fuses a dense connection mechanism and a multi-scale attention mechanism, and the CT image dataset is used to train and optimize the improved UNet network model, to obtain a trained improved UNet network model; S4, inputting the CT image to be staged into the trained improved UNet network model, and outputting the colorectal cancer T staging result corresponding to the CT image to be staged.
[0023] In an embodiment, step S1 specifically comprises: acquiring abdominal CT images of colorectal cancer patients, and the CT image data is derived from a hospital PACS system; searching for CT image data in DICOM format that meets the conditions; for the labeling work of the colorectal cancer lesion area, using the Labelme toolbox guided by professional imaging physicians for accurate labeling. The boundary delineation and T staging labeling of the lesion area are independently completed by two experienced radiologists, and the labeling process is strictly in accordance with the TNM staging standard for judgment. For cases with differences, a consensus is reached through consultation and discussion. The labeling information includes the accurate boundary contour of the colorectal cancer lesion and the corresponding T staging labeling information. The CT image data containing lesion labeling information obtained through the above process not only contains rich image feature information, but also has accurate lesion positioning and staging labels.
[0024] In an embodiment, the preprocessing of the CT image data containing lesion labeling information in step S2 specifically includes two main links of data augmentation processing and data enhancement processing. In the data augmentation processing stage, the data set size is expanded by rotation transformation and mirror transformation, wherein the rotation transformation includes random rotation within-15° to +15° around the image center as the axis, and the mirror transformation includes horizontal mirror and vertical mirror operations. The original data set is expanded through these transformation operations, effectively improving the diversity of the data set and the generalization ability of the model.
[0025] The data enhancement processing mainly includes two steps of cropping and gamma transformation. The cropping operation is used to remove the redundant part in the CT image, specifically, the original image of 512x512 pixels is cropped to the effective area containing the lesion area, the background noise and irrelevant information at the edge are removed, and the training efficiency is improved. Gamma transformation is used to enhance the contrast of the image, so that the lesion area is more prominent, the gamma value is set in the range of 0.8 to 1.2, the contrast difference between the colorectal cancer lesion and the surrounding normal tissue is highlighted by adjusting the brightness distribution of the image, which facilitates the network model to better identify and segment the lesion boundary.
[0026] The preprocessed data is divided into training set, validation set and test set according to the ratio of 7:1.5:1.5, the training set is used for model parameter learning, the validation set is used for hyperparameter tuning and model selection, and the test set is used for final performance evaluation. Each data set contains tumor region CT image and corresponding T staging label information, ensuring the integrity of the data set and the effectiveness of the training process.
[0027] In an embodiment, as shown in Figure 2 The improved UNet network model includes an input layer, an encoder layer, a decoder layer and an output layer connected in turn, wherein the input layer is used to receive the preprocessed CT image data; the encoder layer is provided with four parallel convolutional encoders for extracting multi-level feature representations of different resolutions; the decoder layer is provided with four parallel convolutional decoders for restoring feature resolution and fusing encoder features; a skip connection layer connects the corresponding encoder and decoder for transmitting detailed feature information; and the output layer generates a segmentation mask of the colorectal cancer lesion and a T staging classification result.
[0028] More preferably, the encoder layer includes four parallel convolutional encoders and a bottom layer encoder, each convolutional encoder includes a down-sampling layer, a dense connection block and an attention block, and the bottom layer encoder includes a down-sampling layer and a dense connection block. The specific structure is: the first encoder includes an initial convolutional layer, a first dense connection block and a first attention block, the initial convolutional layer uses a 7x7 convolutional kernel to extract initial features, the first dense connection block extracts multi-scale features, and the first attention block performs feature weighting; the second encoder includes a first down-sampling layer, a second dense connection block and a second attention block, the first down-sampling layer reduces the feature resolution, and the second dense connection block extracts middle layer semantic features; the third encoder includes a second down-sampling layer, a third dense connection block and a third attention block, which are used to extract high layer semantic features; the fourth encoder includes a third down-sampling layer, a fourth dense connection block and a fourth attention block, which are used to extract the highest layer abstract features; and the bottom layer encoder includes a fourth down-sampling layer and a fifth dense connection block, which are used to extract the deepest layer semantic representation.
[0029] In an embodiment, the dense connection mechanism is fused in each layer of the encoder and the decoder, and the traditional double convolution module is replaced by a dense connection block. As shown inFigure 3 As shown, within the densely connected block, the output of each convolutional layer is concatenated with the outputs of all preceding layers along the channel dimension, forming a densely accumulated feature representation layer by layer. Taking the first layer of the encoder as an example, let the input features be... , No. Layer output features It can be represented as ,in Representing the Convolution operations of layers, This represents feature concatenation along the channel dimension. A bottleneck layer design controls the growth of the feature map channel number. Each densely connected block uses a 1×1 convolution as the bottleneck layer to compress the feature dimension, and then a 3×3 convolution is used to extract spatial feature information. This effectively avoids the parameter explosion problem while ensuring that shallow boundary and texture information can be directly transmitted to the deep network.
[0030] like Figure 4 As shown, the attention block includes a dual-path channel attention module and a lightweight spatial attention module: The dual-path channel attention module includes a global channel attention branch and a local channel attention branch. The global channel attention branch uses global average pooling and fully connected layers to generate global channel weights, while the local channel attention branch uses adaptive average pooling and fully connected layers to generate local channel weights. The channel weights of the two branches are fused using a learnable parameter α. The lightweight spatial attention module includes a global spatial attention branch and a local spatial attention branch. The global spatial attention branch uses max pooling, average pooling, and convolutional layers to generate global spatial weights, while the local spatial attention branch uses depthwise separable convolutions and convolutional layers to generate local spatial weights. The spatial weights of the two branches are fused using a learnable parameter β. The residual-gated fusion module performs gated fusion of channel attention-weighted features and spatial attention-weighted features. The fused result is then connected to the input features via residuals to obtain the final output features.
[0031] Specifically, the dual-path channel attention module is designed to address the characteristic of colorectal cancer lesions in CT images, which exhibit both local high contrast and global low contrast. It includes a global channel attention branch and a local channel attention branch. The global channel attention branch employs global average pooling. The feature map is compressed into 1×1×C global features, and global channel weights are generated through a fully connected layer: Where F is the input feature map, and H, W, and C are the height, width, and number of channels of the input feature map, respectively. It is the Sigmoid activation function. It is the ReLU activation function. and is the full connection layer weight matrix, and r is the channel compression ratio.
[0032] The local channel attention branch extracts local detail features using a 2x2 adaptive average pooling, and generates local channel weights through a full connection layer after flattening: wherein is an adaptive average pooling operation, and is a local full branch full connection layer weight matrix, is a flattening operation. The learnable parameters fuse the channel weights of the two branches: to achieve adaptive balance of global semantic information and local detail information.
[0033] The lightweight spatial attention module also adopts a dual-branch design to handle the irregular problem of colorectal cancer lesion boundaries. The global spatial attention branch generates global spatial weights through max-pooling and average-pooling operations: wherein denotes a 1x1 convolution operation, and denote max-pooling and average-pooling operations, respectively, denotes channel dimension concatenation. The local spatial attention branch uses a depthwise separable convolution instead of a deformable convolution, and generates local spatial weights through grouped convolution and subsequent 1x1 convolution: wherein denotes a depthwise separable convolution, denotes the number of groups, denotes integer division. The learnable parameters fuse the global and local spatial weights: The residual gating fusion module gates the channel attention weighted features and the spatial attention weighted features , wherein denotes an element-wise multiplication operation. The gating weights are generated through a 1x1 convolution: wherein, denotes the gating weight map, the fused features are: The fusion result and the input feature are connected by a residual connection to obtain a final output feature: wherein The initial value of the learnable residual weight is set to 0.1, The input feature of the module ensures smooth gradient propagation.
[0034] The decoder layer includes four parallel convolutional decoders, each of which includes an up-sampling layer, a dense connection block and a feature fusion module; the decoder recovers the feature resolution layer by layer and performs feature fusion with the corresponding encoder through a jump connection. The specific structure is: the first decoder includes a first up-sampling layer, a sixth dense connection block and a first feature fusion module, the first up-sampling layer recovers the feature resolution, the sixth dense connection block processes the fused feature, and the first feature fusion module fuses the jump connection feature from the fourth encoder; the second decoder includes a second up-sampling layer, a seventh dense connection block and a second feature fusion module, the second up-sampling layer further recovers the feature resolution, the seventh dense connection block processes the fused feature, and the second feature fusion module fuses the jump connection feature from the third encoder; the third decoder includes a third up-sampling layer, an eighth dense connection block and a third feature fusion module, which is used to recover the medium resolution feature and fuse the jump connection feature from the second encoder; the fourth decoder includes a fourth up-sampling layer, a ninth dense connection block and a fourth feature fusion module, which is used to recover the original resolution feature and fuse the jump connection feature from the first encoder.
[0035] The jump connection layer connects the corresponding convolutional encoder and convolutional decoder through a feature fusion module, and the feature fusion module adopts a feature calibration and progressive fusion strategy to process the feature scale difference between the convolutional encoder and the convolutional decoder.
[0036] Further, the specific execution process of training and optimizing the improved UNet network model by using the CT image dataset includes: S31, input the preprocessed CT image into the improved UNet network model, extract low-level features through the initial convolutional layer, and obtain the basic feature representation after normalization and activation function processing. Specifically, the input CT image of 512x512x1 is subjected to a convolution operation with a 7x7 convolution kernel and a step of 2 to obtain a basic feature representation of 256x256x64, which is then processed by batch normalization and ReLU activation function to provide standardized feature input for subsequent encoder processing.
[0037] S32, the encoder layers sequentially process the basic feature representation through the dense connection block and the attention block, and then down-sample to reduce the feature resolution layer by layer and extract multi-level semantic features. Among them, the specific process of the encoder to extract features by down-sampling layer by layer is: The base feature representation is sent to a dense connection block, the output of each convolutional layer in the dense connection block is spliced with the output of all previous layers in the channel dimension, forming a layer-by-layer accumulated dense feature representation, and the channel number is controlled to grow through the bottleneck layer convolution; each dense connection block contains 4 growth layers, the growth rate is set to 32, and the channel number is compressed to 4 times the growth rate through a 1x1 convolution bottleneck layer, and then feature extraction is performed through a 3x3 convolution.
[0038] The dense feature representation is sent to an attention block for feature weighting. The attention block weights the dense features through a double-path channel attention mechanism and a lightweight spatial attention mechanism, and obtains a weighted feature representation through a residual gate fusion module. The weight calculation of the attention mechanism is performed using the aforementioned formula.
[0039] The weighted feature representation is downsampled to reduce the feature resolution. 2x2 max pooling or convolution downsampling with a step of 2 is used to obtain the output feature of the encoder, which is used as the input feature of the next layer of encoder, and a multi-level feature representation with resolutions of 256x256x128, 128x128x256, 64x64x512 and 32x32x1024 is obtained.
[0040] S33, each layer of the decoder up-samples the multi-level semantic feature to restore the resolution, fuses the up-sampled feature with the corresponding encoder layer feature through a skip connection, and obtains a restored feature through a dense connection block. The specific process of the decoder for restoring the resolution of the up-sampled feature is as follows: The multi-level semantic feature is up-sampled to restore the feature resolution. Bilinear interpolation up-sampling or transposed convolution operation is used to increase the feature resolution by 2 times to obtain the up-sampled feature.
[0041] The up-sampled feature is fused with the corresponding encoder layer feature through a skip connection. The skip connection uses a feature calibration module to adjust the scale difference between the encoder and the decoder feature. The feature calibration module includes a 1x1 convolution for channel alignment and a 3x3 convolution for feature refinement, and obtains a calibrated fusion feature.
[0042] The calibrated fusion feature is processed using a progressive feature fusion strategy. A weighted fusion mechanism is used instead of simple channel splicing, and the fusion weight is automatically learned through an attention mechanism to obtain a progressive fusion feature. Finally, the progressive fusion feature is input into a dense connection block for processing, and the same dense connection structure as the encoder is used to obtain the output feature of the decoder. The resolution is restored to 64x64x512, 128x128x256, 256x256x128 and 512x512x64, respectively.
[0043] S34, auxiliary output branches are set in multiple levels of the decoder, a multi-scale combined loss function is calculated based on the recovered features, and the network parameters are optimized through a deep supervision mechanism. Specifically, auxiliary output branches are set in the 2nd, 3rd and 4th layers of the decoder, each auxiliary output branch contains a 1x1 convolutional layer and an up-sampling layer, the feature map of the corresponding layer is recovered to the same 512x512 resolution as the final output, and then a probability prediction map is generated through a Softmax activation function. The mathematical expression of the multi-scale combined loss function is: wherein, is the loss function of the ith scale, is the corresponding weight coefficient, and the loss function of each scale is defined as: wherein, is the Dice loss function, is the cross-entropy loss function, is the boundary loss function, is the weight coefficient of the Dice loss function, is the weight coefficient of the cross-entropy loss function, is the weight coefficient of the boundary loss function, and the balanced weight distribution of the Dice loss, the cross-entropy loss and the boundary loss is realized through , and .
[0044] The optimization process of the deep supervision mechanism is realized through a backpropagation algorithm, and the gradient of the total loss function to the network parameters is , the gradient of each auxiliary output branch is calculated independently and added to the corresponding network layer, so that the shallow feature extractor can directly receive the supervision signal. This deep supervision mechanism effectively alleviates the gradient vanishing problem in deep network training, especially in medical image segmentation tasks, where shallow features are crucial for extracting boundary and detail information.
[0045] The Dice loss function is defined as: The cross-entropy loss function enhances the supervision of pixel-level classification and is defined as: The boundary loss function is specifically designed to optimize the accuracy of colorectal cancer lesion boundary segmentation and is defined as: wherein, Pn represents the prediction probability of the nth pixel, yn represents the true label of the nth pixel, N represents the total number of pixels, represents a smoothing factor used to prevent the denominator from being zero, represents the distance transform value of the nth pixel to the nearest boundary, and the prediction accuracy of the network is paid more attention to the boundary area through distance weighting.
[0046] The training process uses the Adam optimizer, the initial learning rate is set to 0.001, and the cosine annealing learning rate decay strategy is used, and the learning rate is adjusted as follows Adjustment is made, wherein , , is the total number of training rounds. Set the early stopping mechanism, stop training when the validation set loss does not improve for 10 consecutive epochs, to prevent overfitting. Improve the generalization ability of the model through data augmentation, Dropout regularization and weight decay, etc. The Dropout probability is set to 0.1, and the weight decay coefficient is set to 1e-4. During the training process, the segmentation performance indicators and staging accuracy on the validation set are continuously monitored, and the model parameters with the best performance on the validation set are selected as the final trained improved UNet network model, which provides reliable feature extraction and segmentation ability for subsequent colorectal cancer T staging prediction.
[0047] In an embodiment, step S4 specifically comprises: after preprocessing the CT image to be staged, inputting the trained improved UNet network model, extracting multi-level features through the encoder-decoder architecture and restoring the resolution, and finally outputting the layer through the 1×1 convolution layer and the Softmax activation function to generate the segmentation probability map of the colorectal cancer lesion.
[0048] Set the threshold value 0.5 to binarize the probability map and generate a lesion segmentation mask, where the pixel value 1 represents the lesion area and the pixel value 0 represents the non-lesion area. Perform morphological post-processing on the segmentation mask, including connected component analysis to remove noise regions with an area less than 100 pixels, hole filling to improve the integrity of the lesion area, and open and close operations with a 3×3 structure element to smooth the boundary to ensure the accuracy and continuity of the segmentation result.
[0049] Based on the generated lesion segmentation mask, multi-dimensional features are extracted for T staging. Geometric morphological features include the three-dimensional volume of the tumor calculated by voxel statistics, the surface area calculated by boundary integration, and the spherical degree defined as where V is the volume, A is the surface area, and the compactness is defined as These geometric parameters can quantify the morphological complexity and regularity of the tumor. Texture features include contrast, correlation, energy and entropy values calculated based on gray level co-occurrence matrix, texture complexity and uniformity extracted based on local binary pattern, and texture statistical features extracted based on wavelet transform at multiple scales, which reflect the heterogeneity and pathological characteristics of the tumor. Position relationship features are calculated by analyzing the three-dimensional Euclidean distance between the tumor centroid and important anatomical structures such as intestinal wall, blood vessels and lymph nodes, and calculating the depth ratio and range of tumor invasion of each layer of the intestinal wall. These spatial parameters are directly related to the T stage judgment basis in the TNM staging standard.
[0050] The extracted feature vector is input into the T stage classifier for final staging judgment. The T stage classifier adopts a multi-layer perceptron structure, with an input feature dimension of 256, including geometric and morphological features of 64, texture features of 128, and position relationship features of 64. The classifier contains two hidden layers, the first hidden layer with 256 neurons uses ReLU activation function for non-linear transformation, the second hidden layer with 128 neurons uses ReLU activation function to further extract high-level semantic features, and the output layer with 4 neurons uses Softmax activation function to generate probability distribution corresponding to T1-T4 four staging categories. The classifier is trained through end-to-end supervised learning, and the loss function uses cross-entropy loss wherein is the true staging label, is the predicted probability. The class with the maximum probability is selected as the final colorectal cancer T stage result, and the confidence scores of each stage category are output for reference by clinicians.
[0051] The final output includes the accurate segmentation mask of the colorectal cancer lesion, the corresponding T stage result, the confidence of each stage category, and the visualization results of key features. The segmentation mask is superimposed on the original CT image in the form of color overlay, and the lesion area is highlighted in red, and the boundary is marked with a yellow outline, providing intuitive visual feedback. The T stage result is output in the format of "T1 / T2 / T3 / T4", and the corresponding clinical interpretation is provided, including specific description of tumor invasion depth and diagnostic basis. The system also generates a structured diagnostic report containing tumor geometric parameters, texture feature analysis and position relationship evaluation, which provides objective reference for clinicians in selecting treatment options.
[0052] Example 1 The present embodiment uses CT image data of colorectal cancer provided by a certain third-grade class-A hospital for verification. In the data acquisition stage, 90 patients' abdominal portal venous phase CT enhanced images were obtained from the hospital PACS system, including 65 patients with colorectal cancer, 25 patients in the normal control group, 42 male patients and 23 female patients, with an age range of 36-89 years old, of which 46 patients were in the age range of 50-80 years old, accounting for 76.67% of the total number of people. Among the 65 patients with colorectal cancer, 51 patients had colon cancer, accounting for 78.46% of the total number of patients with colorectal cancer, and 14 patients had rectal cancer, accounting for 21.54%. Among the colon cancer patients, 24 patients had sigmoid colon cancer, accounting for 47.06% of the total number of colon cancer patients. The CT images of the lesion area of the patient's colorectal cancer showed irregular thickening of the intestinal wall, and the lesion area was distributed in the rectum, sigmoid colon, ascending colon, hepatic flexure of colon, transverse colon, descending colon, etc., of which 24 patients had rectal lesions, accounting for 36.92% of the total number of patients, and 14 patients had sigmoid colon lesions, accounting for 21.54%, and the lesion area showed diversity characteristics.
[0053] Each patient contains 60-85 layers of CT image slices, and the image acquisition parameters are tube voltage 120 kVp, tube current 250 mAs, layer thickness 1.25 mm, and pixel pitch 0.7 mm x 0.7 mm. Two experienced radiologists used the Labelme tool to accurately label the lesion area, with a labeling consistency of more than 95.8%. In the data preprocessing stage, the original DICOM format images were converted to PNG format with 512x512 pixels, a total of 4550 colorectal cancer lesion images and 1475 normal abdominal images, totaling 6025 images. Data augmentation processing was performed on the images, including-15° to +15° random rotation transformation and horizontal and vertical mirror image transformation, expanding the dataset to 18075. Data enhancement processing was performed, including cropping to remove redundant edge regions of the image and gamma value 0.8-1.2 gamma transformation to enhance contrast. The dataset was divided according to a ratio of 7:1.5:1.5, with 12653 training set images, 2711 validation set images, and 2711 test set images.
[0054] The constructed dataset was input into the improved UNet network model for training, using the Adam optimizer with an initial learning rate of 0.001 and training for 200 epochs. The experimental results on the test set showed that the lesion segmentation Dice coefficient reached 0.847, the IoU coefficient reached 0.735, and the boundary accuracy reached 0.812. The T stage prediction accuracy reached 85.6%, of which the T1 stage accuracy was 89.7%, the T2 stage accuracy was 84.3%, the T3 stage accuracy was 83.8%, and the T4 stage accuracy was 84.5%, meeting the clinical real-time diagnosis requirements and verifying the effectiveness and practical value of the method.
[0055] On the other hand, as Figure 5As shown, the present application also provides a CT image-based colorectal cancer auxiliary staging system, characterized in that the system is used to realize a CT image-based colorectal cancer auxiliary staging method as described above, and comprises: A data acquisition module is configured to acquire abdominal CT images of colorectal cancer patients from a hospital system, support automatic import and analysis of DICOM format data, and perform labeling to generate CT image data containing lesion labeling information. The module integrates a professional imaging labeling tool, supports accurate labeling of colorectal cancer lesion regions in CT images by physicians, automatically generates CT image data containing lesion boundary contours and T stage labeling information, and establishes a high-quality training data basis.
[0056] A data preprocessing module is configured to preprocess CT image data containing lesion labeling information and construct a CT image dataset.
[0057] A model construction module is configured to construct an improved UNet network model based on a UNet network architecture, train and optimize the improved UNet network model using the CT image dataset, and obtain a trained improved UNet network model. The module integrates a complete deep learning training framework, supports multi-scale combined loss function optimization, deep supervision mechanism training, and hyperparameter automatic tuning, can automatically monitor the training process and save the model parameters with the best performance, and generates a trained improved UNet network model.
[0058] A staging prediction module is configured to input a CT image to be staged into the trained improved UNet network model and output a colorectal cancer T stage result. The module integrates a complete prediction pipeline, including image preprocessing, lesion segmentation, feature extraction, and T stage classification, can automatically output lesion segmentation masks, T stage results, confidence scores, and structured diagnostic reports, and provides objective diagnostic references for clinicians.
[0059] A storage module provides data management functions for the system, adopts a hierarchical storage architecture, and includes raw image data storage, preprocessed data caching, network model parameter storage, and prediction result archiving. The module supports fast data retrieval and backup recovery, and ensures the safety and reliability of system data.
[0060] A processor serves as the control center of the system, is responsible for coordinating the work processes of various functional modules, and manages computing resource allocation and task scheduling.
[0061] The above only describes preferred embodiments of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, 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 method for CT image-based assisted staging of colorectal cancer, characterized in that, The method comprises the following steps: S1, acquiring an abdominal CT image of a colorectal cancer patient, labeling a colorectal cancer lesion area in the CT image, and obtaining CT image data containing lesion labeling information; S2, preprocessing the CT image data containing lesion labeling information, and constructing a CT image dataset containing a training set, a validation set, and a test set; S3, constructing an improved UNet network model based on a UNet network architecture, the improved UNet network model fusing a dense connection mechanism and a multi-scale attention mechanism, training and optimizing the improved UNet network model using the CT image dataset, and obtaining a trained improved UNet network model; S4, inputting a CT image to be staged into the trained improved UNet network model, and outputting a colorectal cancer T staging result corresponding to the CT image to be staged.
2. The method for CT image-based assistant staging of colorectal cancer according to claim 1, wherein, In step S2, the preprocessing includes: data augmentation processing, including rotation transformation and mirror transformation to expand the data set size; data enhancement processing, including cutting to remove redundant parts and gamma transformation to enhance image contrast.
3. The method for CT image-based colorectal cancer assist staging of claim 1, wherein, The improved UNet network model comprises an input layer, an encoder layer, a decoder layer, and an output layer connected in sequence: The input layer is used to receive the preprocessed CT image data; The encoder layer is provided with four parallel convolutional encoders for extracting multi-level feature representations at different resolutions; The decoder layer is provided with four parallel convolutional decoders for restoring feature resolution and fusing encoder features; The skip connection layer connects the corresponding encoder and decoder for transmitting detailed feature information; The output layer generates a segmentation mask of the colorectal cancer lesion and a T staging classification result.
4. The colorectal cancer auxiliary staging method based on a CT image according to claim 3, wherein The encoder layer comprises four parallel convolutional encoders and a bottom layer encoder, each convolutional encoder comprising a down-sampling layer, a dense connection block, and an attention block, and the bottom layer encoder comprising a down-sampling layer and a dense connection block; The decoder layer comprises four parallel convolutional decoders, each convolutional decoder comprising an up-sampling layer, a dense connection block, and a feature fusion module; The decoder restores the feature resolution layer by layer and fuses the features with the corresponding encoder through the skip connection; The skip connection layer connects the corresponding convolutional encoder and convolutional decoder through a feature calibration module.
5. A CT image-based colorectal cancer assist staging method according to claim 4, wherein, The attention block comprises a double-path channel attention module and a lightweight spatial attention module: The double-path channel attention module comprises a global channel attention branch and a local channel attention branch, the global channel attention branch generating global channel weights using global average pooling and a full connection layer, the local channel attention branch generating local channel weights using adaptive average pooling and a full connection layer, and the channel weights of the two branches being fused through a learnable parameter α; The lightweight spatial attention module comprises a global spatial attention branch and a local spatial attention branch, the global spatial attention branch generating global spatial weights using maximum pooling, average pooling, and a convolution layer, the local spatial attention branch generating local spatial weights using a depth separable convolution and a convolution layer, and the spatial weights of the two branches being fused through a learnable parameter β. The residual gate fusion module fuses the channel attention weighted feature and the spatial attention weighted feature, and the fusion result and the input feature are connected through a residual connection to obtain a final output feature.
6. The method for CT image-based colorectal cancer assist staging of claim 1, wherein, The specific execution process of training and optimizing the improved UNet network model by using the CT image data set comprises: S31, inputting the preprocessed CT image into the improved UNet network model, extracting low-level features through an initial convolutional layer, and obtaining a basic feature representation through normalization and an activation function processing; S32, the encoder layers sequentially process the basic feature representation through a dense connection block and an attention block, and then perform down-sampling, thereby reducing the feature resolution layer by layer and extracting multi-level semantic features; S33, the decoder layers perform up-sampling on the multi-level semantic features to restore the resolution, fuse the features through a skip connection and the corresponding encoder layer features, and obtain restored features through a dense connection block processing; S34, an auxiliary output branch is arranged at multiple levels of the decoder, a multi-scale combined loss function is calculated based on the restored features, and the network parameters are optimized through a deep supervision mechanism.
7. A CT image-based colorectal cancer assist staging method according to claim 6, wherein, The specific process of the encoder for extracting features through layer-by-layer down-sampling comprises: The basic feature representation is sent to the dense connection block, the output of each convolutional layer in the dense connection block is spliced with the outputs of all previous layers in the channel dimension, forming a layer-by-layer accumulated dense feature representation, and the channel number growth is controlled through a bottleneck layer convolution; The dense feature representation is sent to the attention block for feature weighting, the attention block weights the dense features through a double-path channel attention mechanism and a lightweight spatial attention mechanism, and obtains a weighted feature representation through a residual gate fusion module; The weighted feature representation is down-sampled to reduce the feature resolution, and the output feature of the encoder at this layer is obtained as the input feature of the next layer encoder.
8. The method for CT image-based assistant staging of colorectal cancer according to claim 6, wherein, The specific process of the decoder for restoring features through layer-by-layer up-sampling comprises: The multi-level semantic features are up-sampled to restore the feature resolution, and the up-sampled features are obtained; The up-sampled features are fused with the corresponding encoder layer features through a skip connection, the skip connection adopts a feature calibration module to adjust the scale difference between the encoder and the decoder features, the feature calibration module includes a convolutional layer for channel alignment and feature refinement, and calibrated fusion features are obtained; The calibrated fusion features are processed by using a progressive feature fusion strategy, a weighted fusion mechanism is used instead of simple channel splicing, the fusion weight is automatically learned through an attention mechanism, and progressive fusion features are obtained; the progressive fusion features are input into the dense connection block for processing, and the output feature of the decoder at this layer is obtained.
9. The method for CT image-based assistant staging of colorectal cancer of claim 6, wherein, The mathematical expression of the multi-scale combined loss function is: wherein, is the loss function for the i-th scale, is the corresponding weight coefficient, and the loss function for each scale is defined as: The Dice loss function is defined as: The cross-entropy loss function is defined as: The boundary loss function is defined as: wherein, Pn represents the predicted probability of the nth pixel, yn represents the true label of the nth pixel, and N represents the total number of pixels, β represents a smoothing factor for preventing the denominator from being zero, dn represents the distance transform value of the nth pixel to the nearest boundary, , , respectively represent the weight coefficients of the Dice loss, the cross-entropy loss, and the boundary loss.
10. A CT image-based colorectal cancer assistant staging system, characterized in that, The system is used to implement the colon cancer auxiliary staging method based on CT images according to any one of claims 1-9, comprising: A data acquisition module is configured to acquire abdominal CT images of colon cancer patients from a hospital system and perform labeling to generate CT image data containing lesion labeling information; A data preprocessing module is configured to preprocess the CT image data containing lesion labeling information and construct a CT image data set; The model construction module is configured to construct an improved UNet network model based on a UNet network architecture, and train and optimize the improved UNet network model by using a CT image dataset, so as to obtain a trained improved UNet network model; The staging prediction module is configured to input the CT image to be staged into the trained improved UNet network model, and output a colorectal cancer T staging result; The storage module is configured to store the CT image dataset, the network model parameters and the staging prediction result; The processor is configured to control the coordinated work of the modules and perform corresponding calculation and processing tasks.
Citation Information
Patent Citations
Colorectal cancer automatic staging method and system based on CT image, medium and equipment
CN114638814A
Cited By
Construction method and application of endometrial cancer CT image segmentation model
CN121937475A
Construction method and application of endometrial cancer CT image segmentation model
CN121937475B
Construction method and application of rectal cancer pathological image segmentation model based on cross-layer channel collaboration
CN122048961A