  The reliability of segmentation models in the medical domain depends on the
model's robustness to perturbations in the input space. Robustness is a
particular challenge in medical imaging exhibiting various sources of image
noise, corruptions, and domain shifts. Obtaining robustness is often attempted
via simulating heterogeneous environments, either heuristically in the form of
data augmentation or by learning to generate specific perturbations in an
adversarial manner. We propose and justify that learning a discrete
representation in a low dimensional embedding space improves robustness of a
segmentation model. This is achieved with a dictionary learning method called
vector quantisation. We use a set of experiments designed to analyse robustness
in both the latent and output space under domain shift and noise perturbations
in the input space. We adapt the popular UNet architecture, inserting a
quantisation block in the bottleneck. We demonstrate improved segmentation
accuracy and better robustness on three segmentation tasks. Code is available
at
\url{https://github.com/AinkaranSanthi/Vector-Quantisation-for-Robust-Segmentation}
