Papers
Topics
Authors
Recent
Search
2000 character limit reached

UpKern: Efficient Kernel Upscaling in MedNeXt

Updated 7 July 2026
  • UpKern is a training technique that upscales small convolution kernels via trilinear interpolation, preserving learned representations.
  • It addresses data-scarce medical imaging by expanding the receptive field without the instability of training large kernels from scratch.
  • The method supports compound scaling in MedNeXt, yielding improved segmentation performance across CT, MRI, and DCE-MRI applications.

UpKern is an initialization and training technique introduced with MedNeXt for medical image segmentation. It iteratively increases convolution kernel sizes by upsampling the trained weights of a small-kernel MedNeXt network into a larger-kernel MedNeXt network, followed by fine-tuning. In the MedNeXt formulation, the larger-kernel model is otherwise identical to the smaller one, and the transfer is performed by trilinearly interpolating convolution filters whose spatial kernel changes while copying compatible parameters unchanged. The method was proposed for data-scarce medical settings, where large-kernel depthwise convolutions can support long-range spatial modeling but training large kernels from scratch often saturates or becomes unstable (Roy et al., 2023).

1. Definition and motivation

UpKern was introduced in the context of MedNeXt, a “Transformer-inspired large kernel segmentation network” that combines a fully ConvNeXt 3D encoder–decoder, residual ConvNeXt up and downsampling blocks, iterative kernel-size growth, and compound scaling in depth, width, and kernel size (Roy et al., 2023). Within that framework, UpKern is specifically the mechanism for scaling kernel size without discarding an already trained solution.

The motivation is tied to a characteristic tension in medical image segmentation. On one side, large-kernel depthwise convolutions in ConvNeXt-style blocks approximate the large attention windows of Transformers and widen the spatial footprint of the network. On the other side, the available datasets are often smaller and more heterogeneous across modalities and anatomy, which makes direct optimization of large parameterized kernels harder. UpKern addresses this by starting from a well-trained small-kernel model and then “inflating” kernels through interpolation, preserving learned representations while expanding receptive field (Roy et al., 2023).

The method is explicitly contrasted with three alternatives. Training large kernels from scratch is described as susceptible to saturation and optimization difficulty on limited data. Dilated convolutions enlarge receptive field without increasing kernel size, but they alter sampling pattern and frequency response and are described as often producing checkerboard artifacts and less smooth integration of context. Compound scaling without UpKern is also reported to give inconsistent gains when kernel size alone is increased in data-scarce regimes. This suggests that UpKern functions not merely as a convenience initialization, but as the mechanism that makes large-kernel scaling complementary to width and depth scaling in MedNeXt (Roy et al., 2023).

2. Algorithmic procedure

In its canonical MedNeXt form, UpKern is a train–expand–fine-tune procedure. The original description specifies the following sequence: train an initial MedNeXt with small depthwise kernels such as 3×3×33 \times 3 \times 3 to convergence; construct a larger-kernel model such as 5×5×55 \times 5 \times 5 with identical macro- and micro-architecture parameters; trilinearly upsample the trained kernel tensors for layers whose spatial kernel changes; copy unchanged all weights whose shapes remain compatible, such as normalization parameters and 1×1×11 \times 1 \times 1 convolutions; initialize the larger model with these transferred parameters; and fine-tune on the same task. The process can be iterated beyond one expansion step, with 353 \to 5 reported as the primary setting in the original work (Roy et al., 2023).

The transfer rule is deliberately conservative. Layers whose tensor shapes do not change are copied directly. Layers whose spatial support changes are remapped only along the spatial dimensions. In the supplementary implementation described for MedNeXt, the actual PyTorch code is a 20-line load_weights.py using torch.nn.functional.interpolate with mode='trilinear'; for 2D, the corresponding mode is bilinear (Roy et al., 2023).

A later application to breast tumor segmentation in DCE-MRI makes the two-stage structure explicit. Stage 1 trains a MedNeXt-M with 3×3×33 \times 3 \times 3 kernels using 5-fold cross-validation, deep supervision, stochastic gradient descent, cosine-annealed learning rate, Dice plus cross-entropy loss, and 250 epochs per fold. The fold with best mean Dice is selected for initialization. Stage 2 applies UpKern to convert all 3×3×33 \times 3 \times 3 convolution weights into 5×5×55 \times 5 \times 5, copies biases unchanged, increases padding by 1 on each axis to preserve spatial dimensions, and fine-tunes the entire model end-to-end on the full training set. No layer freezing or unfreezing is reported (Musah, 3 Aug 2025).

3. Mathematical formulation

The 3D convolutional setting used in the later MedNeXt application is stated as follows. Let xRCin×D×H×Wx \in \mathbb{R}^{C_{\mathrm{in}} \times D \times H \times W}, weights WRCout×Cin×Kd×Kh×KwW \in \mathbb{R}^{C_{\mathrm{out}} \times C_{\mathrm{in}} \times K_d \times K_h \times K_w}, and bias bRCoutb \in \mathbb{R}^{C_{\mathrm{out}}}. With stride 5×5×55 \times 5 \times 50, padding 5×5×55 \times 5 \times 51, and dilation 5×5×55 \times 5 \times 52, the output is

5×5×55 \times 5 \times 53

The typical setting in that study is 5×5×55 \times 5 \times 54 and 5×5×55 \times 5 \times 55. When moving from 5×5×55 \times 5 \times 56 to 5×5×55 \times 5 \times 57 at stride 1, padding increases from 1 to 2 along each axis so that spatial sizes remain unchanged (Musah, 3 Aug 2025).

UpKern itself is the mapping from a learned small kernel 5×5×55 \times 5 \times 58 to an expanded kernel 5×5×55 \times 5 \times 59 by trilinear interpolation. For each output channel 1×1×11 \times 1 \times 10, input channel 1×1×11 \times 1 \times 11, and target index 1×1×11 \times 1 \times 12, the continuous source coordinates are defined by the scale factor 1×1×11 \times 1 \times 13:

1×1×11 \times 1 \times 14

With lower and upper neighbors 1×1×11 \times 1 \times 15, 1×1×11 \times 1 \times 16, 1×1×11 \times 1 \times 17 and interpolation coefficients 1×1×11 \times 1 \times 18, the target weight is the trilinear combination of the 8 neighboring entries in 1×1×11 \times 1 \times 19. Biases are copied unchanged, 353 \to 50 (Musah, 3 Aug 2025).

The original MedNeXt description provides the same operational rule in implementation terms: trilinearly interpolate the small-kernel convolution filters to the new spatial size and copy all weights whose shapes are compatible, including normalization parameters and 353 \to 51 convolutions (Roy et al., 2023).

4. Role within MedNeXt scaling

UpKern is one of the defining scaling mechanisms of MedNeXt. The architecture is described as a modernized and scalable convolutional architecture customized to data-scarce medical settings, with compound scaling at multiple levels—depth, width, and kernel size. Within this design, UpKern is the technique that specifically enables kernel-size scaling without forcing large kernels to be learned from random initialization (Roy et al., 2023).

In practical terms, the layers affected are the convolutions whose spatial kernels change. In the original description this is stated to apply primarily to depthwise convolutions in MedNeXt blocks and to the strided depthwise or transposed convolutions in the residual upsampling and downsampling blocks. Layers whose shapes do not change, including compression and expansion convolutions and GroupNorm parameters, are copied directly (Roy et al., 2023).

The receptive-field effect is explicit in the later large-kernel MedNeXt study. For stride-1 layers, each convolution increases receptive field by 353 \to 52 per axis. Replacing 353 \to 53 with 353 \to 54 therefore adds 353 \to 55 per convolution per axis. In a stack of 353 \to 56 stride-1 convolutions, the receptive field per axis is

353 \to 57

Accordingly, replacing 3 with 5 increases the receptive field by 353 \to 58 for each affected layer. This suggests that UpKern is best understood as a receptive-field expansion mechanism that attempts to preserve function at initialization while increasing context aggregation capacity (Musah, 3 Aug 2025).

The same study also states a cost model for dense 3D convolution: parameter count and per-voxel MACs scale as 353 \to 59. Moving from 3×3×33 \times 3 \times 30 to 3×3×33 \times 3 \times 31 multiplies both by 3×3×33 \times 3 \times 32, while activation memory is unchanged if feature map sizes remain constant. The original MedNeXt motivation for iterative scaling can therefore be read as a response not only to optimization difficulty, but also to the practical need to make expensive larger kernels worthwhile (Musah, 3 Aug 2025).

5. Empirical use and reported results

The MedNeXt paper reports that the overall architecture, including UpKern-based kernel scaling, leads to state-of-the-art performance on four tasks on CT and MRI modalities and varying dataset sizes (Roy et al., 2023). The detailed UpKern description emphasizes that, in Table 1 of that work, “MedNeXt-B 3×3×33 \times 3 \times 33 + UpKern” is compared with training the same larger-kernel model “From scratch,” and that UpKern yields better or more reliable improvements in the data-scarce regime (Roy et al., 2023).

A later and more fully quantified use appears in breast tumor segmentation on the MAMA-MIA DCE-MRI dataset. There, inputs are the pre-contrast and first two post-contrast volumes, all images are resampled to 1.0 mm isotropic spacing, patches are 3×3×33 \times 3 \times 34, and preprocessing is performed via nnU-Net. The study reports the following results on the unseen validation set (Musah, 3 Aug 2025):

Model Dice NormHD
3×3×33 \times 3 \times 35 (5-fold ensemble) 0.64 0.30
3×3×33 \times 3 \times 36 (UpKern + fine-tune) 0.66 0.29
Ensemble 3×3×33 \times 3 \times 37 0.67 0.24

In that study, 3×3×33 \times 3 \times 38 uses Dice plus cross-entropy loss, while 3×3×33 \times 3 \times 39 adds Focal loss to penalize small-lesion errors. The final submission ensembles the two large-kernel models. The paper attributes the improvements to the larger receptive field enabled by UpKern, with additional gains from ensembling (Musah, 3 Aug 2025).

The same work characterizes the transfer as stable because trilinear interpolation preserves the spatial arrangement of learned filter responses and provides a smooth, low-frequency initialization of the larger kernel. It also notes specific failure modes: padding or shape mismatch can misalign features; increased parameter count can promote overfitting; and the transition from the smaller model can introduce optimization shocks. The reported mitigations are padding adjustment, reuse of the same losses and optimization settings, and end-to-end fine-tuning under the original SGD plus cosine schedule (Musah, 3 Aug 2025).

6. Scope, limitations, and terminological ambiguity

The MedNeXt literature presents UpKern as architecture-agnostic in the sense that it operates directly on convolution weight tensors and can be applied to other 3D CNNs and modalities, provided that source and target layers have the same input and output channels and the spatial kernel is expanded consistently. The interpolation formula is stated to generalize beyond 3×3×33 \times 3 \times 30 to any 3×3×33 \times 3 \times 31 multilinear interpolation, although larger kernels such as 3×3×33 \times 3 \times 32 were not evaluated in the breast DCE-MRI study (Musah, 3 Aug 2025).

Several limitations are explicit. The original MedNeXt work primarily uses two stages, 3×3×33 \times 3 \times 33, rather than longer curricula such as 3×3×33 \times 3 \times 34 (Roy et al., 2023). The later DCE-MRI paper does not explore alternative mapping schemes beyond trilinear interpolation, such as center-copy or learned inflation, and it notes the computational increase associated with larger kernels (Musah, 3 Aug 2025). This suggests that UpKern is a pragmatic scaling procedure rather than a fully general theory of kernel expansion.

The term itself is also ambiguous in later literature. In “Uniform Kernel Prober,” “UpKern” is stated to be simply a shorthand or alias for the Uniform Kernel Prober pseudometric, which compares learned representations through kernel ridge regression without labels (Mukherjee et al., 11 Feb 2025). In “A universal preprocessing algorithm of average kernel method with Gauss-Laguerre quadrature for double integrals,” “UpKern Algorithm” is used as a convenient name for a universal preprocessing kernel algorithm for computing the pre-exponential factor of the average kernel in the Smoluchowski equation (Pan et al., 19 Feb 2025). In “Kernels in digraphs with colored vertices,” the term is used for algorithms deciding and constructing up-color kernels in vertex-colored digraphs (Guevara et al., 24 Mar 2025). A plausible implication is that, outside the MedNeXt line of work, “UpKern” should not be assumed to denote the MedNeXt kernel-upsampling method unless the surrounding context makes the reference explicit.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to UpKern Algorithm.