Random Convolutions: A Simple Way to Boost Generalization

SVG Icon Editor

Figure 1: Source: [2]

AI and deep learning have recently transformed medical imaging by enabling automated analysis of complex radiological data, such as detecting lesions, segmenting organs, and predicting disease progression. These methods learn visual representations directly from large datasets and have achieved impressive results across many clinical tasks.

In standard computer vision tasks, deep learning models often suffer from overfitting, where they learn dataset-specific patterns instead of generalizable visual concepts. For example, an object recognition model trained only on images taken with a specific camera or under certain lighting conditions may perform poorly when evaluated on images from a different camera, environment, or background. Although the objects remain the same, subtle changes in image statistics can cause a significant drop in performance.

A similar problem occurs in AI for medical imaging, where domain shift arises when training and test data differ due to variations in scanner vendors, magnetic field strengths, acquisition protocols, or reconstruction pipelines. In clinical tasks such as multiple sclerosis (MS) lesion segmentation, these differences can substantially alter image appearance, leading models to fail when deployed across institutions or imaging centers.

Standard data augmentations like rotations, flips, and intensity perturbations help to some extent, but they often fail to capture realistic variations in imaging characteristics. Random Convolutions (RC) offer a simple yet powerful alternative by exposing models to a wide range of plausible texture and intensity variations while preserving the global structure of anatomical objects [1, 2]. In this blog article, we present our recent work on RC in medical imaging and discuss its practical implications in detail [2].


What Are Random Convolutions and How Are They Used in Practice?

As shown in Figure 1, A convolutional neural network (CNN) is a type of neural network commonly used for image analysis that processes images using small filters (called convolutions) to detect patterns such as edges, textures, and shapes. Random Convolutions (RC) augment an input image by passing it through a shallow convolutional network with randomly sampled filters. The network has depth L, where depth refers to the number of convolutional layers in the CNN, and each convolution uses random kernels of spatial size k × k.

The input image can be viewed as a tensor of size C × H × W, where C denotes the number of channels and H and W denote the spatial dimensions. Each random convolution layer applies a kernel that spans all C channels and has spatial size k × k. The kernel values are randomly sampled from a zero-mean Gaussian distribution with variance σ², and a new set of kernels is drawn for each layer ℓ = 1, …, L.

The RC transformation is obtained by sequentially applying the L random convolution layers to the input image, resulting in a transformed image that preserves the overall anatomical structure but exhibits altered texture statistics. The kernels are re-sampled for each mini-batch, gradients are not propagated through them, and only the parameters of the downstream segmentation network are optimized.

In practice, RC is used as a preprocessing augmentation. The input image is first transformed by the random convolution module and then processed by a standard segmentation framework. At inference time, the RC module is removed and the network operates on the original, unaltered images. Empirically, RC preserves anatomical structures while introducing significant textural variation, improving robustness to domain shift without degrading in-domain performance.


Random Convolutions for Domain Randomization and Improved Generalization

RC can be viewed as a form of implicit domain randomization. Instead of explicitly modeling scanner physics or performing computationally expensive style transfer, RC generates new domains by perturbing texture statistics in a simple and task-agnostic manner. This highlights an important insight: robustness does not require realistic simulations of new domains—often, it is sufficient to prevent the model from relying on spurious appearance cues.

Convolutional neural networks are known to rely heavily on local texture cues. Although this inductive bias can improve performance on in-distribution data, it becomes problematic under domain shift, where texture statistics differ between training and deployment data, as is common in medical imaging. By applying L random convolutions with kernel size k, RC introduces strong textural variability while preserving underlying anatomical structure. This encourages the network to rely more on shape, spatial context, and global morphology, which tend to be more invariant to scanner and protocol variability.


Limitations and Extensions

The effectiveness of RC depends on the choice of depth L and kernel size k. Very large values can distort semantic content, while overly small values may not introduce sufficient variability.

To address this, later work proposed progressive random convolutions, which carefully control the depth and strength of random filtering to balance appearance diversity and structural fidelity.


Key Takeaways

  • Random convolutions use a shallow network of depth L with random kernels of size k as a data augmentation strategy.
  • They introduce strong textural variability while preserving anatomical structure.
  • In medical imaging tasks such as MS lesion segmentation, they significantly improve robustness to domain shift.
  • Their simplicity and low computational cost make them well suited for real-world deployment with heterogeneous data.

Random convolutions show that carefully controlled randomness at the input level can substantially improve how models generalize beyond the data they were trained on.


References

[1] Choi, S., Das, D., Choi, S., Yang, S., Park, H., & Yun, S. (2023).
Progressive Random Convolutions for Single Domain Generalization.
Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 10312–10322.

[2] Varma, A., Scholz, D., Erdur, A. C., Peeken, J. C., Rueckert, D., and Wiestler, B. (2026).
Improving out-of-domain generalization in Multiple Sclerosis detection and segmentation using Random Convolutions.
Pattern Recognition Letters, Elsevier (ScienceDirect).

RELATED

  • Exploring XAI Methods for Interpretability of Large Language Models

    Large Language Models can summarise text, answer questions, and classify sentiment with impressive accuracy, but their reasoning often feels like a black box. Why did the model land on that prediction? This post walks through four complementary approaches from Explainable AI (XAI) that help open up the box. Together, these methods make LLMs less opaque and more trustworthy. Full post
  • Robotic Decision Making via Diffusion Models

    Robots are increasingly expected to operate in complex, real-world environments, but the machine learning methods that drive their decision-making, like reinforcement and imitation learning, often struggle with training stability and capturing the multimodal nature of behavior. This post introduces diffusion models as a powerful alternative for robotic decision making, explaining their core denoising mechanism and surveying their applications in several contexts. Full post
  • A Beginner’s Guide to Certifiable Robustness

    Machine learning models, such as ChatGPT and those used in autonomous driving, are becoming essential tools in our daily lives. However, the existence of "adversarial examples" demonstrates that these systems are not free from vulnerabilities. The post, introduces the concept of adversarial examples and discusses Certifiable Robustness, a methodology designed to combat them. Full post
  • Responsible Textual Generative Models (Part I): Generating Truthful Content

    This post introduces hallucination in large language models—why fluent outputs can still be wrong, what distinguishes intrinsic from extrinsic errors, and how training data, model design, inference, and alignment contribute. It surveys detection and mitigation approaches and sets up later posts on toxicity, bias, and inclusivity in responsible textual generative AI. Full post
  • Neuromorphic Computing: A Brain-inspired Approach to Robot Intelligence

    This post offers a high-level walkthrough of neuromorphic computing, why it matters for energy-efficient robot intelligence, and how SNNs, event cameras, and neuromorphic chips fit together Full post
  • Introduction to Embodied Instruction Following

    This work explores how AI systems bridge the gap between understanding human instructions and performing real actions by learning through direct interaction with their environment. Full post
  • From Unlucky Strikers to Statistical Learning Theory

    Using the analogy of football striker, this post explains how statistical learning theory helps us understand when we can trust model predictions and empirical averages, highlighting the challenges of generalization in modern machine learning, especially with complex models like deep neural networks. Full post
  • Performative Prediction

    Machine learning systems are increasingly used to support decision-making processes. Yet, these systems do not merely reflect the world—they also reshape it. Once deployed, predictions can influence behaviors, alter policies, and redirect resources, creating feedback loops that change the very data-generating processes they aim to model. Full post
  • What even is differential privacy?

    A concise introduction to differential privacy which offers provably privacy guarantees for training machine learning models. Full post
  • Mitigating Domain shifts

    Adapting a deep neural network to unseen data and tasks is imperative these days, however access to target data is often available. Common target adaptation techniques including domain adaptation and generalization train for meaningful representations during source training. Recent paradigms such as Test-time training/adaptation focus on optimizing the source model on unseen data. To do so, they finetune the model on the streaming unsupervised data which is useful for practical scenarios. Moreover, these techniques can be applied to variety of tasks such as regression, classification and segmentation. Full post
  • A gentle introduction to uncertainty quantification

    Uncertainty Quantification (UQ) is considered indispensable for predictive models in safety-critical applications. Modern models, though high-performing, struggle with providing meaningful uncertainty estimates due to a number of reasons. Full post
  • Welcome to the relAI Blog

    Welcome to the relAI blog of the Konrad Zuse School of Excellence in Reliable AI (relAI). This blog will serve as a platform to share cutting-edge research and developments from our school, highlighting the significant strides we are making towards making AI systems safer, more trustworthy, and privacy-preserving. Full post