Multi-scale context aggregation and dynamic supervision medical image segmentation method and application thereof
By using the ResUKAN+ network, B-spline functions, and a dynamic supervisory head, the problems of insufficient nonlinear fitting ability and multi-scale context aggregation in medical image segmentation are solved, achieving efficient and accurate medical image segmentation.
Patent Information
- Application Number
- CN202610008741.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2046-01-06
AI Technical Summary
Existing medical image segmentation techniques suffer from several problems when processing medical images with significant differences in target scale, blurred tissue boundaries, and varied morphological structures. These problems include insufficient nonlinear fitting ability of convolutional units, difficulty in adapting fixed-scale context aggregation mechanisms to varying targets, and inability of static weight supervision mechanisms to balance training convergence speed and refined segmentation accuracy.
We employ the ResUKAN+ network, combined with a full-level residual KAN encoder based on B-spline functions, and integrate a multi-scale context aggregation module (MSCA) with pyramid pooling and dual attention. We also design a dynamic auxiliary supervision head (DASH) based on exponentially decaying dynamic weights to enhance nonlinear feature representation, multi-scale context aggregation, and dynamic gradient control.
It significantly improves the edge segmentation accuracy and robustness of medical image segmentation, balances training convergence speed and segmentation accuracy, solves the segmentation challenges of fuzzy boundaries and multi-scale targets, and enhances the overall segmentation performance of the model.
Smart Images

Figure CN121458745A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and medical image processing technology, and in particular to a method for medical image segmentation involving multi-scale context aggregation and dynamic supervision, and its application. Background Technology
[0002] Medical image segmentation is a core component of computer-aided diagnostic (CAD) systems, and its accuracy directly determines the reliability of clinical diagnosis. However, medical ultrasound, CT, or MRI images typically possess complex characteristics such as significant differences in target scale (e.g., large organs against a small lesion), blurred tissue boundaries (severe grayscale gradations), and varied morphological structures. Existing deep learning-based segmentation techniques still face the following significant technical bottlenecks in addressing these challenges: First, traditional convolutional neural networks (CNNs) have a "linear upper limit" in feature extraction capabilities. Mainstream models (such as U-Net and its variants) rely on standard convolution operations, which are essentially local linear combinations of weights with simple activation functions (such as ReLU). This mechanism falls short when fitting strong nonlinear features commonly found in medical images (such as complex textures at lesion edges and nonlinear gray-level abrupt changes). Although emerging KAN (Kolmogorov-Arnold Networks) networks have stronger function approximation capabilities mathematically, current technologies have not effectively solved their application challenges in image tasks: either using them only locally in deep layers leads to the loss of shallow texture details, or applying them directly to the entire image results in an explosion of computational costs, failing to meet the real-time requirements of clinical practice.
[0003] Second, the aggregation mechanism of global contextual information is not perfect. Medical diagnosis relies heavily on long-range dependencies between anatomical structures. Although existing encoder-decoder architectures expand the receptive field through downsampling, they are often limited by fixed-scale convolution kernels or dilated convolutions (such as ASPP modules), leading to the "mesh artifact" problem. Furthermore, they are difficult to simultaneously achieve complete coverage of large-scale organs and accurate localization of small-scale lesions, resulting in missed detections of holes inside large targets or small targets.
[0004] Third, there is a contradiction between the training stability and detail recovery accuracy of deep networks. As networks become deeper, gradient vanishing and overfitting problems occur frequently. Existing deep supervision methods typically use fixed auxiliary loss weights, ignoring the differences in gradient signal requirements at different training stages: strong gradients are needed to guide convergence in the early stages of training, while excessive auxiliary supervision in the later stages of training can interfere with the main segmenter's fine-tuning of edge details, limiting the upper limit of the model's final performance.
[0005] Therefore, there is an urgent need to propose a medical image segmentation framework that integrates multi-scale context awareness and dynamic gradient control to solve the above problems and achieve efficient and accurate segmentation of complex medical images. Summary of the Invention
[0006] This invention provides a multi-scale context aggregation and dynamic supervision method for medical image segmentation and its application. It addresses the problems of existing medical image segmentation techniques, such as insufficient nonlinear fitting ability of convolutional units to handle fuzzy boundaries, difficulty of fixed-scale context aggregation mechanisms to adapt to variable targets, and inability of static weight supervision mechanisms to balance training convergence speed and fine segmentation accuracy.
[0007] The core technology of this invention is to construct a medical image segmentation network called ResUKAN+. Its core lies in combining a full-level residual KAN encoder based on B-spline function to enhance nonlinear feature representation, integrating a multi-scale context aggregation module (MSCA) with pyramid pooling and dual attention to capture global dependencies, and designing an auxiliary supervisor head (DASH) based on an exponential decay dynamic weight mechanism to optimize training dynamics.
[0008] In a first aspect, the present invention provides a multi-scale contextual aggregation and dynamically supervised medical image segmentation method, the method comprising the following steps: Step S1: Acquire the medical image data to be processed and perform standardized preprocessing; Step S2: Input the preprocessed medical image into the constructed segmentation network; The segmentation network consists of an encoder, a bottleneck layer, and a decoder. The encoder contains multi-level feature extraction units, each of which embeds a residual KAN convolution module to replace standard convolution for non-linear feature extraction and downsampling, generating multi-level encoded features. The bottleneck layer is located at the end of the encoder and contains a multi-scale context aggregation module for multi-scale information extraction and global context fusion of deep encoded features. The decoder restores feature resolution through multi-level upsampling and fuses it with the encoded features of the corresponding level through skip connections. Step S3: Perform dual-head prediction on the feature map output by the decoder, generating the main prediction result through the main segmentation head and the auxiliary prediction result through the dynamic auxiliary supervision head; The dynamic auxiliary supervision head contains a multi-branch heterogeneous receptive field structure for extracting complementary features; Step S4: Calculate the total network loss based on the main prediction results and the auxiliary prediction results; Among them, the weight of the auxiliary loss corresponding to the auxiliary prediction result in the total loss is determined by the dynamic weight parameter, which shows a non-linear decay trend as the network training cycle progresses. Step S5: Update the network parameters based on the total loss until convergence, and use the trained master segmenter to segment the medical image.
[0009] Furthermore, in step S2, the residual KAN convolution module includes residual convolution units and linear KAN units; The residual convolutional unit adopts a dual-branch structure, in which the main branch performs convolutional feature extraction and the shortcut branch performs identity mapping or dimension adjustment. The outputs of the two branches are added element-wise to achieve residual connection. The linear KAN unit flattens the input feature vector and performs a nonlinear mapping on each position in the feature map; the nonlinear mapping consists of a weighted sum of the basis function part and the spline function part. The basis function part transforms the features using a nonlinear activation function; the spline function part transforms the features using a linear combination of B-spline basis functions.
[0010] Furthermore, the order of the B-spline basis function is set to k=3 to generate a smooth fitting curve that adapts to the gradual boundary changes of medical images; the grid size G of the spline function is set to an integer between 8 and 32, and the grid density is adjusted to balance fitting accuracy and computational complexity.
[0011] Furthermore, the processing steps of the multi-scale context aggregation module include: A set of adaptive average pooling layers with different target sizes is used to generate multi-path pyramid features, and the features are aligned by convolution and upsampling operations before channel stitching. Spatial attention weights and channel attention weights are applied sequentially to the spliced features; The features that have undergone dual attention weighting are processed by exponential moving average, and the feature distribution is smoothed by maintaining channel-level moving average statistics to suppress image noise.
[0012] Furthermore, the specific calculation logic for exponential moving average processing is as follows: During training, the mean statistic µ for each channel is based on the momentum coefficient β. c Update:
[0013] Where t is the current time, This is the feature input for the c-th channel at the current time. The value range is from 0.9 to 0.99; During the inference process, the feature map is standardized using a fixed mean statistic obtained during the training phase.
[0014] Furthermore, the dynamic auxiliary supervision head is constructed as follows: The feature map output from the decoder is received, and features are extracted through multiple parallel convolutional branches; the multiple parallel convolutional branches contain convolutional kernels of different sizes or dilated convolutions with different dilation rates to cover heterogeneous receptive fields. An attention network is used to generate fusion weights for each branch, and the features of each branch are weighted and fused based on these weights. Channel recalibration and convolutional prediction are performed on the fused features to obtain auxiliary prediction results.
[0015] Furthermore, in step S4, the formula for calculating the dynamic weight parameter λ is:
[0016] in, The loss value of the main segmentation head. As an auxiliary loss value, Let T be the current training iteration number, and T be the total training iteration number. and For hyperparameters, To prevent division by zero constants, this formula makes the strength of auxiliary supervision higher in the early stage of training to accelerate convergence, and automatically reduced in the later stage of training to reduce interference to the main segmentation head. The total network loss is composed of a weighted average of cross-entropy loss and Dice loss, which are used to constrain pixel classification accuracy and region overlap, respectively.
[0017] Secondly, the present invention provides a multi-scale context aggregation and dynamically supervised medical image segmentation apparatus, comprising: A multi-scale contextual aggregation and dynamically supervised medical image segmentation device includes: The data processing module is configured to acquire medical images and perform standardized preprocessing. The network construction module is configured to build a segmentation network, which includes an encoder, a bottleneck layer, and a decoder. The encoder contains multi-level feature extraction units, each of which embeds a residual KAN convolution module to replace standard convolution for non-linear feature extraction and downsampling, generating multi-level encoded features. The bottleneck layer is located at the end of the encoder and contains a multi-scale context aggregation module for multi-scale information extraction and global context fusion of deep encoded features. The decoder restores feature resolution through multi-level upsampling and fuses it with the encoded features of the corresponding level through skip connections. The training module is configured to perform dual-head prediction on the feature map output by the decoder, generating a main prediction result through a main segmentation head and an auxiliary prediction result through a dynamic auxiliary supervision head. The dynamic auxiliary supervision head contains a multi-branch heterogeneous receptive field structure for extracting complementary features. The total network loss is calculated based on the main prediction result and the auxiliary prediction result. The network parameters are updated according to the total loss until convergence. Among them, the weight of the auxiliary loss corresponding to the auxiliary prediction result in the total loss is determined by the dynamic weight parameter, which shows a non-linear decay trend as the network training cycle progresses. The inference module is configured to segment and output medical images using a pre-trained network segmentation system.
[0018] Thirdly, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the above-described multi-scale context aggregation and dynamic supervision medical image segmentation method.
[0019] Fourthly, the present invention provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the multi-scale context aggregation and dynamic supervised medical image segmentation method described above.
[0020] The main contributions and innovations of this invention are as follows: 1. Overcoming the nonlinear bottleneck of feature extraction and significantly improving edge segmentation accuracy: This invention innovatively introduces a residual KAN convolution module (RDC+KANLinear) at all levels of the encoder. Utilizing the smooth fitting characteristics of the cubic B-spline function (k=3) and the adaptive interpolation capability of a configurable grid (G=8-32), it replaces the linear combination of traditional convolutions. This design can more accurately respond to the gray-level gradations of lesion edges in medical images, effectively solving the "staircase effect" and hard boundary errors caused by activation functions such as ReLU. The HD95 index on datasets such as DDTI is significantly reduced, demonstrating its powerful ability to capture blurred boundaries.
[0021] 2. Achieves efficient and stable aggregation of multi-scale contexts: The MSCA module of this invention abandons the dilated convolution scheme that easily produces mesh artifacts, and instead adopts a dynamic pyramid pooling combined with a spatial-channel dual attention mechanism. In particular, it introduces exponential moving average (EMA) processing for channel statistics, which not only effectively integrates multi-scale information from local fine structures to global anatomical context, but also suppresses noise interference in medical images by smoothing feature distribution, significantly improving the model's robustness to targets of different sizes.
[0022] 3. A dynamically optimized training mechanism was established, balancing convergence speed and generalization ability: The Dynamic Auxiliary Supervisory Head (DASH) proposed in this invention adopts a heterogeneous receptive field design (fusing features from convolutional kernels of different sizes) and pioneers a dynamic weight function λ that decays exponentially with the training epoch. This mechanism provides strong auxiliary gradients to accelerate convergence in the early stages of training and automatically reduces the weight of the auxiliary head in the later stages of training to avoid interfering with the fine-tuning of the main segmentation head. This not only solves the gradient vanishing problem in deep networks but also serves as a regularization method to prevent overfitting on small sample data, effectively improving the overall segmentation performance of the model (both IOU and F1 scores are superior to the state-of-the-art model).
[0023] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description
[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart of a multi-scale context aggregation and dynamic supervised medical image segmentation method according to an embodiment of the present invention; Figure 2 This is a diagram of the overall framework structure of the segmentation network according to an embodiment of the present invention; Figure 3 This is an architecture diagram of a multi-scale context aggregation module according to an embodiment of the present invention; Figure 4 This is a diagram of the dynamic auxiliary supervision head architecture according to an embodiment of the present invention; Figure 5 This is a comparison chart of DDTI data segmentation visualization results according to an embodiment of the present invention; Figure 6 This is a comparison chart of TN3K data segmentation visualization results according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0026] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0027] Example 1: A Deep Learning-Based Multi-Scale Context Aggregation and Dynamically Supervised Medical Image Segmentation Method This embodiment provides a medical image segmentation method called ResUKAN+, which aims to solve the problems of poor nonlinear fitting ability for blurred boundaries, loss of multi-scale context, and unstable convergence of deep network training in the prior art.
[0028] like Figure 1 As shown, the method in this embodiment mainly includes four stages: data preparation, network construction, model training, and inference prediction.
[0029] I. Data Preparation and Preprocessing (Step S1) First, obtain the medical image dataset to be segmented (e.g., the DDTI thyroid ultrasound dataset or the TN3K dataset), containing the original images and their corresponding pixel-level gold standard masks (Ground Truth). To adapt to the network's input requirements and accelerate convergence, the images undergo normalization preprocessing: 1. Size Adjustment: Adjust all input images to a uniform fixed resolution (e.g., 256×256 pixels) to meet batch processing requirements.
[0030] 2. Normalization: Using max-min normalization or Z-score normalization, image pixel values are mapped to a specific range (e.g., [0, 1]). This step is particularly important for medical images, as it can eliminate intensity differences caused by imaging from different devices.
[0031] II. Segmentation Network Construction (Step S2) The ResUKAN+ network constructed in this embodiment adopts an encoder-decoder architecture, mainly composed of three parts: a full-level residual KAN encoder, a multi-scale context aggregation module (MSCA), and a decoder with a dynamic auxiliary supervision head (DASH). The network first performs feature extraction and downsampling through the encoder: Let the input image be... It undergoes five levels of encoding processing, each level containing a residual convolutional layer and a KAN convolutional block, accompanied by a downsampling operation with a stride of 2, ultimately yielding a high-dimensional deep feature map. .then, The features are fed into the MSCA (Multi-Scale Context Aggregation) bottleneck layer for feature enhancement, outputting features rich in multi-scale contextual information. .Then, The image enters the decoder, where it undergoes five levels of upsampling (e.g., transposed convolution) and is fused with the corresponding level feature maps from the encoder via skip connections. This process gradually restores the spatial resolution, ultimately yielding a feature map with the same resolution as the input image. .
[0032] 1. Full-level residual KAN encoder The encoder is responsible for extracting image features step by step and reducing the resolution (downsampling). For example... Figure 2 As shown, the encoder contains five cascaded levels (e.g., Stage 1 to Stage 5). It completely changes the traditional U-Net encoder's approach of using only ordinary convolutions (CNNs). In each level, this invention innovatively embeds a Residual KAN Convolution Module to replace the traditional standard convolutional units.
[0033] Specifically, the residual KAN convolution module consists of residual convolution branches and linear KAN units (KANLinear): The residual convolution branch (i.e., the residual bi-branch convolution in the diagram, or RDC module for short): retains a ResNet-like structure, used to extract basic texture features and prevent gradient vanishing. Specifically, the output of the RDC module is:
[0034] in:
[0035]
[0036]
[0037] in, The input feature map has a dimension of . (batch size) Number of input channels High space (Spacious space).
[0038] This is the first layer of convolution operations. The convolution kernel weight matrix has dimensions of . .
[0039] This is the second convolution operation. The convolution kernel weight matrix has dimensions of . .
[0040] This is the ReLU activation function, used to introduce nonlinearity.
[0041] This is a shortcut branch (residual connection) used for identity mapping. If the number of input channels... Equal to the number of output channels Then output directly. If they are not equal, then by Convolution (weights) Adjust the number of channels.
[0042] The RDC module outputs the feature map as follows:
[0043] After spatial flattening, the data is input into KANLinear (Kolmogorov–Arnold Network Linear module):
[0044] in, This is the flattened feature sequence. This is equivalent to mapping each spatial location (h, w) to an element in the sequence, generating a sequence of dimension [B, P, C] (P = H × W is the number of locations):
[0045] in, .
[0046] Linear KAN Unit: This is the core feature extraction unit of this invention. Unlike the locally linear weighting of traditional convolution, KANLinear uses a B-spline function to perform non-linear mapping on features, which can more accurately fit the gray-level gradient of lesion edges. The specific calculation process of KANLinear is as follows: Assume the input feature map is .
[0047] (1) Flattening operation: First, flatten the spatial dimensions to reshape the feature map into a sequence. This allows for independent function transformation of the feature vector at each pixel location.
[0048] (2) Nonlinear mapping: For each feature element x in the sequence, perform the following mapping:
[0049] in: Basis function part :
[0050] in It is the feature vector at position p (i.e., the feature of a certain pixel position, used as the input feature vector). It is the basis activation function, which defaults to the SiLU function. It is the basis function weight matrix (dimension 1). SiLU activation function (Sigmoid Linear Unit):
[0051] spline function part Fitting local details using B-spline basis functions:
[0052] Among them, w i These are learnable spline weights. x is the input feature value (scalar or vector; in this invention, each element of the feature vector is processed independently, but x in the formula refers to the input in general).
[0053] G is the grid size, defining the number of intervals the spline function divides. For medical images (e.g., grayscale values normalized to [0,1]), G is typically an integer between 8 and 32, such as G=10 or G=16. The choice of value is based on balancing fitting accuracy and computational complexity—a denser grid (larger G) enhances detail capture but increases computational burden, while a sparser grid (smaller G) may lead to underfitting. In medical images, lesion edges often exhibit gradual grayscale changes (e.g., blurred areas at tumor boundaries). A larger G (e.g., G=16) can accurately fit this continuous change through finer grid division, reducing segmentation errors.
[0054] k is the spline order, which controls the smoothness of the B-spline basis function. A commonly used value is k=3 (cubic spline) because cubic splines exhibit excellent continuity and differentiability, avoiding the fitting rigidity problem of low-order splines (such as linear splines with k=1). Splines with k=3 can generate smooth fitting curves, making them very suitable for the gradual boundaries of organs or lesions in medical images (such as the blurred contours of thyroid nodules in the TN3K dataset), avoiding the "staircase effect" caused by functions such as ReLU. Higher-order splines (k>3) may overfit noise, while k=3 strikes a balance between smoothness and flexibility, aiding in model generalization. In experiments, EMA layers (exponential moving average) were used to further stabilize training, synergistically enhancing robustness with splines of k=3.
[0055] In this embodiment, the spline order k=3 (cubic spline) is preferably set to generate a smooth C2 continuous curve, naturally conforming to the physical gradient of tissue density in medical images; the grid size G is set to an integer between 10 and 16 (e.g., G=10) to control the computational load while ensuring fitting accuracy. B-spline basis functions Calculated using a recursive formula:
[0056] k-order B-spline (k≥1):
[0057] Where: t i The node sequence is determined by the grid size G and the spline order k, and is usually uniformly distributed within the input value range.
[0058] The total output is:
[0059] in, Batch Index ; For location index ;and" "" indicates the channel dimension, and operations are performed on all channels. Output .
[0060] (3) Spatial reconstruction: The mapped sequence Y is restored to a spatial feature map. and through Convolution performs channel fusion. Specifically, it restores the sequence output to a spatial feature map:
[0061] Spatial information is fused using 1x1 convolution:
[0062] in This is used to blend features extracted by KAN along the channel dimension.
[0063] The final output of this layer after batch normalization: .
[0064] in, Batch Normalization is used to standardize the feature distribution and accelerate convergence.
[0065] The above process is carried out sequentially in the five levels of the encoder, realizing layer-by-layer feature abstraction and nonlinear transformation.
[0066] 2. Multi-scale Context Aggregation Module (MSCA) like Figure 3 As shown, the MSCA module is located at the bottleneck layer at the end of the encoder to address the problem of limited receptive field. The processing flow of this module includes: (1) Multi-scale feature extraction: using a set of different target sizes (e.g. The adaptive average pooling layer processes the input features in parallel, generating feature maps containing contextual information at different scales. These features are then upsampled to a uniform size and concatenated with the original features.
[0067] In this embodiment, the input features (i.e., the deep feature map output by the encoder) ), using a set of different target sizes The adaptive average pooling layer generates multi-scale features:
[0068] in, This is an upsampling operation to the original size. For dimensionality reduction convolution. All With original features After concatenating the channels, preliminary fused features are obtained through 1x1 convolution. :
[0069] (2) Dual attention mechanism: Spatial attention (generated by depth-separable convolution) and channel attention (generated by SE module) are applied sequentially to the spliced features to adaptively suppress background noise and enhance the features of the lesion area.
[0070] In this embodiment, spatial attention weights are first generated using a depthwise separable convolution and a sigmoid function. :
[0071] Apply weights to features:
[0072] in This indicates element-wise multiplication. Next, ... Input a Squeeze-and-Excitation (SE) module to compute channel attention weights. :
[0073] in, For global average pooling, It is a fully connected layer.
[0074] (3) Exponential Moving Average (EMA) processing: In order to further stabilize the feature distribution and suppress speckle noise in medical images, this embodiment introduces an EMA layer to smooth the feature channel statistics.
[0075] The final output is , (Exponential Moving Average) is an exponential moving average layer used for stable training. Its specific operation is on the feature tensor after being weighted by both spatial and channel attention. (dimension is) By maintaining channel-level moving average statistics (such as the mean of each channel) Achieving dynamic smoothing: During training, EMA is based on momentum coefficient. (Typically set to 0.9-0.99) Update the eigenvalues of each channel using an exponentially weighted average (i.e., ...). And during inference, the feature map is standardized using fixed statistics. This suppresses noise and intensity inhomogeneity commonly found in medical images, thereby enhancing the stability and continuity of feature representation.
[0076] Where t is the current iteration step, For the current input feature, momentum coefficient The preferred value is between 0.9 and 0.99. During the inference phase, a fixed statistic accumulated during training is used. Standardize the features to ensure the stability of the prediction.
[0077] 3. Decoder and Dynamic Auxiliary Supervision Head (DASH) The decoder gradually recovers the resolution through multi-level upsampling (such as transposed convolution) and fuses shallow features from the encoder through skip connections. Specifically, the feature map Fdec output by the decoder is simultaneously fed into the main segmentation head and a DASH auxiliary head. The main segmentation head generates the final segmentation probability map through a 1×1 convolutional layer. DASH, through its internal multi-branch heterogeneous receptive field and adaptive weight fusion structure, from Extract auxiliary features and generate auxiliary predictions. .
[0078] At the end of the decoder, this embodiment designs a dual-head prediction mechanism: Main segmentation head: Outputs the final fine-grained segmentation result (segmentation probability map). .
[0079] Dynamic Auxiliary Supervisory Head (DASH) (e.g.) Figure 4 (As shown): Used to assist training. DASH employs a multi-branch heterogeneous receptive field structure, including... Ordinary convolution and dilation rate of 2 The dilated convolution has four parallel branches. A lightweight attention network is used to compute the weights of each branch, and multi-scale features are weighted and fused to generate auxiliary prediction results. .
[0080] In this embodiment, the DASH structure receives the feature map output by the decoder. First, complementary features are extracted through multiple parallel branches (1×1, 3×3, 5×5 convolutions, etc.):
[0081]
[0082]
[0083]
[0084] in, For convolution operations of different sizes. To focus on single-pixel features, the computational cost is minimized. This is the standard local receptive field. To achieve a larger receptive field, it captures medium-sized targets. dilation=2 is dilated convolution, which expands the receptive field to [a higher value] without increasing the number of parameters. Even larger (depending on the number of layers) are used to capture longer-term context. BN (Batch Normalization) is a batch normalization method that speeds up convergence. is the activation function (usually ReLU).
[0085] Subsequently, a lightweight attention network is used to generate the fusion weights for each branch. (in (Number of branches)
[0086] in, For global average pooling, For a fully connected layer, Concat concatenates the feature maps of the four branches along the channel dimension.
[0087] Weighted fusion of feature maps for:
[0088] Will Channel recalibration is performed using a SE module to further enhance feature representation capabilities. Finally, a predictive convolutional layer outputs an auxiliary segmentation map. .
[0089] III. Model Training and Dynamic Loss Calculation (Steps S3-S4) This is the key innovation of this embodiment. To balance the need for convergence speed in the early stages of model training with the need for detail accuracy in the later stages, this invention introduces auxiliary loss weights that dynamically change with the training cycle. An optimizer is used to minimize the total loss. The network's weight parameters are updated via gradient backpropagation until the model converges. During the inference phase, only the master segmentation head is used. The output is used as the final segmentation result.
[0090] The total loss function is defined as:
[0091] Among them, the main (segment head) loss And auxiliary (segmentation head) loss Both are caused by cross-entropy loss (CELoss). ) and Dice loss ( Weighted composition, λ represents the true label, and λ is the balancing hyperparameter (i.e., the dynamic weight λ that follows).
[0092] The formula for calculating the dynamic weight λ is:
[0093] in, T represents the current number of Epochs (or iterations) during training, and T represents the total number of Epochs (or total training iterations). This is the initial scaling factor (e.g., 0.5-1.0). This is the decay rate factor (e.g., 2-5). To prevent division by zero of small constants (such as 1e-6).
[0094] Specifically, the exponential term (time decay term) This causes λ to decay non-linearly with training. In the early stages of training ( Smaller λ, larger λ, strong auxiliary supervision signals help gradient backpropagation and prevent gradient vanishing in deep networks; in the later stages of training ( By approaching T and λ approaching 0, the interference of the auxiliary head on the main segmentation head is reduced, allowing the main head to focus on fine-tuning the lesion edges. Simultaneously, adaptive adjustment is performed using the ratio term of the loss value to ensure that the auxiliary head receives more attention when the main loss is large.
[0095] IV. Reasoning and Prediction (Step S5) During the inference phase, only the output of the main segment head is retained. As the final segmentation mask, the DASH auxiliary header is discarded, thus adding no inference computation cost.
[0096] To verify the effectiveness of the proposed ResUKAN+ network in medical image segmentation tasks, particularly its advantages in handling blurred boundaries and multi-scale targets, this embodiment conducted extensive comparative experiments on two publicly available medical image datasets (DDTI thyroid ultrasound dataset and TN3K thyroid nodule dataset). Tables 1-2 and [other examples are provided]. Figure 5-6 Comparison of segmentation metrics and segmentation visualization results on different public datasets: Table 1 DDTI Dataset
[0097] Table 2 TN3K Dataset
[0098] in: 1. Evaluation Indicators and Comparison Model The experiment selected commonly used evaluation metrics in the field of medical image segmentation, including: IOU (Intersection over Union): The IOU measures the degree of overlap between the predicted region and the actual region.
[0099] F1 score (Dice Coefficient): Measures the overall similarity of segmentation results.
[0100] HD95 (95% Hausdorff Distance): Measures the maximum distance between the predicted boundary and the true boundary (excluding 5% outliers). The smaller this metric is, the more accurate the edge segmentation is, and it directly reflects the model's ability to fit shapes and boundaries.
[0101] Recall and Precision.
[0102] The comparison models include the classic U-Net, the adaptive nnU-Net, and the basic KAN-based models UKAN and ResUKAN.
[0103] 2. Quantitative Results Analysis (Based on Tables 1 and 2) (1) Performance of the DDTI dataset (see Table 1) On the DDTI dataset, this invention demonstrates superior overall performance and boundary detection capabilities: Optimal overall performance: The F1 score of this invention reaches 0.7943, which is better than all the comparison models (nnU-Net is 0.7860, ResUKAN is 0.7601). This indicates that the present invention achieves the best balance between positive sample determination and overall shape recovery.
[0104] Significantly improved boundary fitting accuracy: On the HD95 metric, which reflects edge error, this invention achieved the lowest value of 14.3231. Compared to U-Net (16.3265) and ResUKAN (16.7485), the error is significantly reduced. This directly proves the effectiveness of the "Residual KAN Convolution Module" in this invention in fitting nonlinear fuzzy boundaries using B-spline functions.
[0105] Lower false negative rate: The Recall index of this invention is as high as 0.8454, which is significantly higher than that of the second-ranked UKAN (0.8192), indicating that this invention has a stronger detection capability for small or vague lesion areas.
[0106] (2) Performance of the TN3K dataset (see Table 2) On the TN3K dataset, this invention leads in all core metrics: Both IOU and F1 scores are optimal: the IOU of this invention reaches 0.7146 and the F1 score reaches 0.8063, both ranking first. Compared with the directly improved object ResUKAN (IOU 0.7063, F1 0.8014), the improvement is significant, verifying the gains brought by the MSCA module and the DASH dynamic supervision mechanism.
[0107] Edge error was significantly reduced: the HD95 index dropped to 15.7516, far lower than U-Net's 18.6864 and nnU-Net's 17.6309. This further confirms the robustness of the present invention in handling thyroid nodules, which are morphologically variable and have irregular edges.
[0108] 3. Qualitative Visualization Analysis (based on) Figure 5 and Figure 6 ) To visually demonstrate the segmentation effect, Figure 5 and Figure 6The images show a comparison of the segmentation results of different models on the DDTI and TN3K datasets. The columns in the images are, in order: original image, ground truth, prediction, and overlay (where red represents ground truth, green represents prediction, and yellow represents the overlapping correctly predicted regions).
[0109] (1) DDTI Visualization Analysis (see) Figure 5 ) like Figure 5 As shown, the sample contains a lesion with indistinct borders and an irregular shape.
[0110] Existing technical limitations: Unet's prediction results (green) show significant overflow, misclassifying surrounding non-lesion tissue as lesions; although UKAN's prediction area is more compact than Unet's, it fails to effectively cover the elongated portion on the right side of the lesion, resulting in a significant red missed detection area; while ResUKAN reduces misjudgments, it still misses detection in the elongated portion on the right side of the lesion (the red area is not covered).
[0111] Advantages of this invention: In the overlay graph of this invention, the yellow area accounts for the highest proportion, while the red (missed detection) and green (false detection) areas are the least. Especially in the fitting of lesion edges, the predicted contour of this invention closely matches the true value, without jagged edges, demonstrating the excellent fitting ability of the B-spline function for smooth curves.
[0112] (2) TN3K Visualization Analysis (see) Figure 6 ) like Figure 6 As shown, the sample is a large thyroid nodule with uneven internal texture.
[0113] Existing technical limitations: The UKAN model shows obvious defects (missed detections) at the bottom of the lesion, resulting in incomplete shape; the segmentation boundary of U-Net is relatively coarse and cannot well fit the natural physiological curve of the organ.
[0114] Advantages of this invention: The mask generated by this invention completely covers the entire lesion area, resulting in extremely high recall. Furthermore, observing the edges of the overlay image reveals that the segmentation boundaries of this invention are smooth and continuous, excellently restoring the morphological features of the nodules. This is attributed to the aggregation of multi-scale contextual information by the MSCA module, ensuring that the network does not develop holes due to variations in the texture within the lesion, and also to the nonlinear representation capability of the KAN module for complex topological structures.
[0115] 4. Experimental Conclusions In summary, whether considering objective quantitative indicators (Tables 1 and 2) or subjective visual effects (…), Figure 5 , Figure 6 From the perspective of [data / information], the ResUKAN+ method proposed in this invention outperforms the current state-of-the-art (SOTA) models. In particular, the significant reduction in the HD95 index and the improvement in edge fit in the visualization fully demonstrate the creativity and practicality of this invention in solving the core technical problems of "blurred boundaries in medical images" and "multi-scale target segmentation".
[0116] Example 2 Based on the same concept, this invention also proposes a multi-scale context aggregation and dynamically supervised medical image segmentation device, comprising: Data processing module: Configured to read medical image data (such as DICOM format) and perform normalization, cropping and data augmentation (such as flipping and rotating) operations.
[0117] Network building block: Used to instantiate the ResUKAN+ network model in computer memory, including initializing the B-spline parameter grid and weights of the KANLinear layer.
[0118] Training module: An ensemble optimizer (such as Adam) is configured to compute the forward propagation results in each training step, calculate the total loss according to the dynamic weight formula described in Example 1, and perform backpropagation to update the parameters.
[0119] Inference module: Used to load the trained model weights, segment new medical images, and output a visual mask of the lesion region.
[0120] Example 3 This embodiment also provides an electronic device, see reference. Figure 7 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.
[0121] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement embodiments of the present invention.
[0122] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0123] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.
[0124] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any of the multi-scale context aggregation and dynamic supervision medical image segmentation methods in the above embodiments.
[0125] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.
[0126] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0127] Input / output device 408 is used to input or output information.
[0128] Example 4 This embodiment also provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the multi-scale context aggregation and dynamic supervision medical image segmentation method according to Embodiment 1.
[0129] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0130] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0131] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 1 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0132] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0133] The above embodiments are merely illustrative of several implementations of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the appended claims.
Claims
1. A multi-scale contextual aggregation and dynamically supervised medical image segmentation method, characterized in that, Includes the following steps: Step S1: Acquire the medical image data to be processed and perform standardized preprocessing; Step S2: Input the preprocessed medical image into the constructed segmentation network; The segmentation network includes an encoder, a bottleneck layer, and a decoder. The encoder contains multi-level feature extraction units, each of which embeds a residual KAN convolution module to replace standard convolution for non-linear feature extraction and downsampling, generating multi-level encoded features. The bottleneck layer is located at the end of the encoder and contains a multi-scale context aggregation module for multi-scale information extraction and global context fusion of deep encoded features. The decoder restores feature resolution through multi-level upsampling and performs skip connections to fuse the encoded features of the corresponding level. Step S3: Perform dual-head prediction on the feature map output by the decoder, generating the main prediction result through the main segmentation head and the auxiliary prediction result through the dynamic auxiliary supervision head; The dynamic auxiliary supervision head includes a multi-branch heterogeneous receptive field structure for extracting complementary features; Step S4: Calculate the total network loss based on the main prediction results and the auxiliary prediction results; The weight of the auxiliary loss corresponding to the auxiliary prediction result in the total loss is determined by the dynamic weight parameter, which shows a non-linear decay trend as the network training cycle progresses. Step S5: Update the network parameters according to the total loss until convergence, and use the trained master segmenter to segment the medical image.
2. The multi-scale context aggregation and dynamically supervised medical image segmentation method as described in claim 1, characterized in that, In step S2, the residual KAN convolution module includes residual convolution units and linear KAN units; The residual convolutional unit adopts a dual-branch structure, in which the main branch performs convolutional feature extraction, the shortcut branch performs identity mapping or dimension adjustment, and the outputs of the two branches are added element-wise to achieve residual connection. The linear KAN unit flattens the input feature vector and performs a nonlinear mapping on each position in the feature map; the nonlinear mapping is composed of a weighted sum of a basis function part and a spline function part. The basis function part transforms the features using a nonlinear activation function; the spline function part transforms the features using a linear combination of B-spline basis functions.
3. The multi-scale context aggregation and dynamic supervised medical image segmentation method as described in claim 2, characterized in that, The order of the B-spline basis function is set to k=3 to generate a smooth fitting curve that adapts to the boundary gradient of the medical image; the grid size G of the spline function is set to an integer between 8 and 32, and the grid density is adjusted to balance the fitting accuracy and computational complexity.
4. The multi-scale context aggregation and dynamically supervised medical image segmentation method as described in claim 1, characterized in that, The processing steps of the multi-scale context aggregation module include: A set of adaptive average pooling layers with different target sizes is used to generate multi-path pyramid features, and the features are aligned by convolution and upsampling operations before channel stitching. Spatial attention weights and channel attention weights are applied sequentially to the spliced features; The features that have undergone dual attention weighting are processed by exponential moving average, and the feature distribution is smoothed by maintaining channel-level moving average statistics to suppress image noise.
5. The multi-scale context aggregation and dynamically supervised medical image segmentation method as described in claim 4, characterized in that, The specific calculation logic for the exponential moving average processing is as follows: During training, the mean statistic µ for each channel is based on the momentum coefficient β. c Update: Where t is the current time, This is the feature input for the c-th channel at the current time. The value range is from 0.9 to 0.99; During the inference process, the feature map is standardized using a fixed mean statistic obtained during the training phase.
6. The multi-scale context aggregation and dynamically supervised medical image segmentation method as described in claim 1, characterized in that, The dynamic auxiliary supervision head is constructed as follows: The feature map output from the decoder is received, and features are extracted through multiple parallel convolutional branches; the multiple parallel convolutional branches contain convolutional kernels of different sizes or dilated convolutions with different dilation rates to cover the heterogeneous receptive field. An attention network is used to generate fusion weights for each branch, and the features of each branch are weighted and fused based on these weights. Channel recalibration and convolutional prediction are performed on the fused features to obtain auxiliary prediction results.
7. The multi-scale context aggregation and dynamic supervised medical image segmentation method as described in any one of claims 1 to 6, characterized in that, In step S4, the formula for calculating the dynamic weight parameter λ is: in, The loss value of the main segmentation head. As an auxiliary loss value, Let T be the current training iteration number, and T be the total training iteration number. and For hyperparameters, To prevent division by zero constants, this formula makes the strength of auxiliary supervision higher in the early stage of training to accelerate convergence, and automatically reduced in the later stage of training to reduce interference to the main segmentation head. The total network loss is composed of a weighted average of cross-entropy loss and Dice loss, which are used to constrain pixel classification accuracy and region overlap, respectively.
8. A multi-scale contextual aggregation and dynamic supervised medical image segmentation device, characterized in that, include: The data processing module is configured to acquire medical images and perform standardized preprocessing. The network construction module is configured to build a segmentation network, which includes an encoder, a bottleneck layer, and a decoder. The encoder contains multi-level feature extraction units, each of which embeds a residual KAN convolution module to replace standard convolution for non-linear feature extraction and downsampling, generating multi-level encoded features. The bottleneck layer is located at the end of the encoder and contains a multi-scale context aggregation module for multi-scale information extraction and global context fusion of deep encoded features. The decoder restores feature resolution through multi-level upsampling and performs skip connections to fuse the encoded features of the corresponding level. The training module is configured to perform dual-head prediction on the feature map output by the decoder, generating a main prediction result through a main segmentation head and an auxiliary prediction result through a dynamic auxiliary supervision head; the dynamic auxiliary supervision head includes a multi-branch heterogeneous receptive field structure for extracting complementary features. Calculate the total network loss based on the main prediction result and the auxiliary prediction result; update the network parameters according to the total loss until convergence; The weight of the auxiliary loss corresponding to the auxiliary prediction result in the total loss is determined by the dynamic weight parameter, which shows a non-linear decay trend as the network training cycle progresses. The inference module is configured to segment and output medical images using a pre-trained network segmentation system.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the multi-scale context aggregation and dynamic supervision medical image segmentation method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program, the computer program including program code for controlling the process to execute the process, the process including the multi-scale context aggregation and dynamic supervised medical image segmentation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Medical image segmentation method and device, computer equipment and storage medium
CN120526136A
Mama-based spectrum dynamic fusion and double attention enhancement medical image segmentation method
CN120876849A
Medical image segmentation method and system based on feature extraction optimization
CN121170302A
Lane boundary detection method based on trainable line anchors and KAN network detection heads and computer-readable storage medium
JP7782903B1
Medical image segmentation method based on multi-scale feature fusion
US20250095828A1
Cited By
Key structure image segmentation method and system for obstetrical ultrasound
CN122049379A