Upsampling
Upsampling is a process that increases the number, density, or spatial or temporal resolution of samples or values in a dataset or representation by adding, duplicating, or estimating them.
Natural Language Processing in Action, Second Edition
Oversampling the minority class increases the representation of underrepresented classes in training data, often by duplicating or resampling examples.
- How it is used
- Balances nationality frequencies so an RNN treats common and underrepresented names more equally during training.
- How deep it goes
- Defines duplication as a brute-force balancing method and demonstrates its dataset effect, but does not detail alternative resampling algorithms.
- Examples
- Uses Arabic surnames including repeated Abadi and Zogby entries within a 37-nationality dataset.
- What you can do after
- Apply it via duplicated or balanced surname samples before training a nationality-prediction RNN.
Read how Natural Language Processing in Action, Second Edition explains upsampling →
Local Image Generation
Hi-res upscaling is the process of increasing an image’s resolution while using additional generative denoising to add or modify visual detail.
- How it is used
- Enlarges low-resolution Stable Diffusion generations for high-resolution output or deliberately transformed imagery.
- How deep it goes
- Explains scale choices, hi-res steps, denoising adjustment, and image-to-image workflow without low-level model internals.
- Examples
- Uses a sci-fi wallpaper and a five-step image enlarged 4x with ten hi-res steps.
- What you can do after
- Apply it via A1111 or ComfyUI to enlarge images, tune variation, and reproduce image-to-image workflows.
Evolutionary Deep Learning: Genetic algorithms and neural networks
An upsampling layer increases the spatial resolution of an intermediate feature representation, typically without learning a convolutional filter.
- How it is used
- Reconstructs full-resolution images from compressed latent views in convolutional autoencoders.
- How deep it goes
- Explains UpSampling as pooling’s opposite and demonstrates repeated 2× resizing, without detailing resizing internals.
- Examples
- Uses a 28×28×1 Fashion-MNIST autoencoder decoder with three UpSampling2D((2, 2)) stages.
- What you can do after
- Apply it via Keras by pairing UpSampling2D with convolutional layers in an autoencoder decoder.
Read how Evolutionary Deep Learning: Genetic algorithms and neural networks explains upsampling →
Build AI Drug Discovery Pipelines
Random oversampling is a sampling technique that duplicates minority-class instances to reduce class imbalance.
- How it is used
- Balances minority and majority classes during training for imbalanced classification.
- How deep it goes
- Defines duplication, contrasts alternatives, and demonstrates implementation while stopping short of advanced synthetic-sampling details.
- Examples
- Uses cytochrome P450 inhibitor data, duplicated inhibitor rows, decision trees, and precision–recall evaluation.
- What you can do after
- Apply random oversampling to rebalance training data and compare its classification performance against alternative strategies.
Read how Build AI Drug Discovery Pipelines explains upsampling →
Grokking AI Algorithms, Second Edition
Upsampling is the process of increasing the spatial resolution of a structured representation such as an image or feature map.
- How it is used
- Uses upsampling in a U-Net decoder to enlarge compressed feature maps during image reconstruction.
- How deep it goes
- Explains pixel duplication, learned patch projection, overlap addition, and a NumPy-style implementation, without covering training details.
- Examples
- Uses 4×4-to-8×8 feature maps, pixel duplication, an artist analogy, diagrams, and transposed-convolution pseudocode.
- What you can do after
- Build it from scratch using array operations for transposed convolution and connect the resulting maps to decoder reconstruction.
Read how Grokking AI Algorithms, Second Edition explains upsampling →
Deep Learning with R, Third Edition
Upsampling is the expansion of a representation's spatial resolution by generating or restoring values at additional spatial locations.
- How it is used
- Restores spatial resolution for pixel-level segmentation and denoising models after convolutional downsampling.
- How deep it goes
- Explains learned transposed convolutions, tensor shapes, mirrored U-Net stages, and skip connections without deriving their internal arithmetic.
- Examples
- Uses a 200 × 200 segmentation output, a 100-to-50-to-100 shape reversal, and a 128 × 128 U-Net denoising architecture.
- What you can do after
- Build it from scratch with R/Keras Conv2DTranspose layers and mirrored U-Net blocks for segmentation or denoising.
Read how Deep Learning with R, Third Edition explains upsampling →
Also covered in
- Geometry for Programmers
- Build a Text-to-Image Generator (from Scratch)
- Learn Generative AI with PyTorch
- Transformers in Action
- Math and Architectures of Deep Learning
- Machine Learning Algorithms in Depth
- WordPress Power Toolkit: Harness AI to build next-level websites
- Financial AI in Practice
- Designing AI SystemsIn early access (MEAP)
- Generative AI in Action
- LLM Customization and Fine-TuningIn early access (MEAP)
What to know first
- accuracyAccuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
- convolutional neural networkA convolutional neural network is a neural-network architecture that processes structured inputs with convolutional operations, typically using learned local filters to capture patterns.
- convolution kernelA convolution kernel is an array or tensor of weights applied to local regions of structured input to compute convolution responses.
- recallRecall is the proportion of all relevant or actual positive items that a system successfully retrieves or correctly identifies.
Related concepts
- SMOTEincludes · SMOTE is an oversampling technique that generates synthetic examples for a minority class by interpolating between existing minority-class examples and their nearest neighbors.
- undersamplingalternative to · Undersampling is a resampling technique that reduces a class’s representation in a dataset by removing examples.
- class imbalanceaddressed by · Class imbalance is a condition in a classification dataset where classes have substantially unequal numbers of examples.
- Conv2DTransposeimplemented by · Conv2DTranspose is a neural-network layer that applies a learned two-dimensional transposed convolution to increase the spatial resolution of feature maps.
- data balancingused by · Data balancing adjusts the representation of classes or groups in a dataset, or the learning procedure, to address disproportionate representation.
- image-to-image generationalternative to · Image-to-image generation is the process of transforming an input image into a new or modified image using a generative model and optional conditioning.
Questions about upsampling
What is upsampling?
Upsampling is a process that increases the number, density, or spatial or temporal resolution of samples or values in a dataset or representation by adding, duplicating, or estimating them.
Which Manning books explain upsampling?
Natural Language Processing in Action, Second Edition, Local Image Generation, Evolutionary Deep Learning: Genetic algorithms and neural networks, Build AI Drug Discovery Pipelines, Grokking AI Algorithms, Second Edition and Deep Learning with R, Third Edition.
What should I know before learning upsampling?
Manning books that teach upsampling usually introduce accuracy, convolutional neural network, convolution kernel and recall first.
What is the difference between upsampling and undersampling?
Upsampling is a process that increases the number, density, or spatial or temporal resolution of samples or values in a dataset or representation by adding, duplicating, or estimating them. Undersampling is a resampling technique that reduces a class’s representation in a dataset by removing examples.
What kinds of upsampling are there?
Kinds of upsampling include SMOTE.
What is upsampling also called?
Upsampling is also called oversampling, upscale, upsample or upscaling.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





