UpKern: Efficient Kernel Upscaling in MedNeXt
- 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 to convergence; construct a larger-kernel model such as 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 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 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 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 convolution weights into , 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 , weights , and bias . With stride 0, padding 1, and dilation 2, the output is
3
The typical setting in that study is 4 and 5. When moving from 6 to 7 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 8 to an expanded kernel 9 by trilinear interpolation. For each output channel 0, input channel 1, and target index 2, the continuous source coordinates are defined by the scale factor 3:
4
With lower and upper neighbors 5, 6, 7 and interpolation coefficients 8, the target weight is the trilinear combination of the 8 neighboring entries in 9. Biases are copied unchanged, 0 (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 1 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 2 per axis. Replacing 3 with 4 therefore adds 5 per convolution per axis. In a stack of 6 stride-1 convolutions, the receptive field per axis is
7
Accordingly, replacing 3 with 5 increases the receptive field by 8 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 9. Moving from 0 to 1 multiplies both by 2, 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 + 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 4, 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 |
|---|---|---|
| 5 (5-fold ensemble) | 0.64 | 0.30 |
| 6 (UpKern + fine-tune) | 0.66 | 0.29 |
| Ensemble 7 | 0.67 | 0.24 |
In that study, 8 uses Dice plus cross-entropy loss, while 9 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 0 to any 1 multilinear interpolation, although larger kernels such as 2 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, rather than longer curricula such as 4 (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.