Papers
Topics
Authors
Recent
Search
2000 character limit reached

1D U-Net with FiLM Conditioning

Updated 14 November 2025
  • 1D U-Net with FiLM is a convolutional encoder-decoder architecture that integrates per-sample conditioning via affine modulation of feature maps.
  • The model applies Feature-wise Linear Modulation using an MLP on decoder blocks, adapting scales and biases after skip fusion to improve performance in low data regimes.
  • Empirical studies demonstrate enhanced segmentation metrics, such as improved Dice scores, and effective source separation performance with minimal extra complexity.

A 1D U-Net architecture with Feature-wise Linear Modulation (FiLM) is a variant of the U-Net model for signal processing that enables per-sample conditioning using external vectors—typically metadata or control signals—by modulating feature maps via affine transformations at selected stages of the network. Originally studied in 2D imaging contexts for segmentation and audio source separation, the application to 1D U-Nets leverages the same architectural principles using 1D convolutions, batch normalization layers, and appropriate gating of feature flow. Modulation is achieved by generating per-channel scaling and bias parameters via a small multilayer perceptron (MLP) conditioned on the external data; these parameters are then broadcast and applied to the intermediate activations. This methodology is particularly advantageous in settings with limited training data, where it demonstrably improves generalization by adapting network responses based on auxiliary information (Jacenków et al., 2019, Meseguer-Brocal et al., 2019).

1. Mathematical Formulation of Feature-wise Linear Modulation

Let xn,ℓ,cx_{n,\ell,c} denote the activation for batch nn, sequence position (length) ℓ\ell, and channel cc in a 1D U-Net. Let z∈Rdz\in\mathbb{R}^d represent the conditioning vector (e.g., metadata, control signals). FiLM computes scaling γc(z)\gamma_c(z) and bias βc(z)\beta_c(z) per channel by applying a small MLP to zz: FiLM(x)n,ℓ,c=γc(z) xn,ℓ,c+βc(z)\mathrm{FiLM}(x)_{n,\ell,c} = \gamma_c(z)\, x_{n,\ell,c} + \beta_c(z) where [γ(z),β(z)]=MLP(z)∈R2C[\gamma(z), \beta(z)] = \mathrm{MLP}(z) \in \mathbb{R}^{2C}. For 1D signals, the nn0 and nn1 vectors are reshaped to nn2 and broadcast along the sequence dimension (nn3).

2. 1D U-Net Backbone and FiLM Integration Strategy

The 1D U-Net retains the canonical encoder-decoder structure, adapted as follows:

  • Encoder path: nn4 resolution reduction via Conv1D+stride or pooling per block, typically with channel progression nn5, nn6, nn7, nn8, nn9. Each block comprises Conv1D â„“\ell0 BatchNorm1D â„“\ell1 ReLU.
  • Decoder path: Resolution increased symmetrically via ConvTranspose1D (or upsample+Conv1D), concatenating skip connections from the corresponding encoder blocks, followed by two Conv1D â„“\ell2 BN1D â„“\ell3 ReLU layers.
  • FiLM insertion: In the configuration experimentally found optimal, FiLM conditioning is applied exclusively in decoder blocks—specifically, after skip fusion and the convolutional stack, just before the next upsampling. No FiLM is applied in the encoder or latent/bottleneck representations. Optionally, an additional FiLM ("late FiLM") may be inserted at the logits stage, with effects on performance dependent on task (Jacenków et al., 2019).

Layerwise overview in 1D:

Stage Input Shape Operation Notes
Encoder block â„“\ell4 â„“\ell5 Conv1D â„“\ell6 BN1D â„“\ell7 ReLU No FiLM applied
Decoder block ℓ\ell8 ℓ\ell9 (Upsample/TransConv), concat skip; 2×(Conv1D cc0 BN1D cc1 ReLU); FiLM FiLM via MLPcc2, broadcast
Final layer cc3 cc4 Conv1D, optional late FiLM Produces segmentation/output logits

Skip connections from encoder to decoder are not modulated; the FiLM layer acts on the merged features in the decoder, allowing the model to dynamically gate or re-weight multi-scale features conditioned on cc5. Empirically, "decoder fusion" with FiLM significantly outperforms encoding- or bottleneck-side conditioning.

3. Conditioning Vector Handling and FiLM Parameter Generation

The conditioning vector cc6 can be any set of non-imaging features (e.g., metadata, control signals, task specifiers, one-hot labels). Practical implementations suggest:

  • For low-dimensional cc7 (cc8), cc9 is embedded via a small MLP to dimensionality z∈Rdz\in\mathbb{R}^d0 or z∈Rdz\in\mathbb{R}^d1.
  • Each FiLM MLP per decoder block receives the shared z∈Rdz\in\mathbb{R}^d2 representation and outputs z∈Rdz\in\mathbb{R}^d3 values (scales and shifts for all z∈Rdz\in\mathbb{R}^d4 channels).

Each FiLM MLP comprises two hidden layers with widths close to z∈Rdz\in\mathbb{R}^d5, ReLU activations, and produces per-channel (z∈Rdz\in\mathbb{R}^d6) z∈Rdz\in\mathbb{R}^d7 and z∈Rdz\in\mathbb{R}^d8 parameters per sample. For source separation scenarios where the condition is categorical (e.g., instrument selection), the control input is one-hot and embedded via either a fully-connected net or 1D CNN, with parallel heads for generating all block-level or channel-level FiLM parameters (Meseguer-Brocal et al., 2019).

4. Practical Adaptation from 2D to 1D for Signal Processing

Transitioning from 2D to 1D to service tasks such as biomedical signal segmentation or audio, adjustments are:

  • Conv2D z∈Rdz\in\mathbb{R}^d9 γc(z)\gamma_c(z)0 Conv1D γc(z)\gamma_c(z)1
  • BatchNorm2D γc(z)\gamma_c(z)2 BatchNorm1D
  • TransposedConv2D γc(z)\gamma_c(z)3 ConvTranspose1D (stride=2) or Upsample+Conv1D
  • Tensor shape: γc(z)\gamma_c(z)4 γc(z)\gamma_c(z)5 γc(z)\gamma_c(z)6
  • FiLM parameter broadcast: reshape γc(z)\gamma_c(z)7 to γc(z)\gamma_c(z)8

Hyperparameter choices:

  • Channels: 64γc(z)\gamma_c(z)9128βc(z)\beta_c(z)0256βc(z)\beta_c(z)1512βc(z)\beta_c(z)21024 for βc(z)\beta_c(z)3 scales
  • Kernel size: 3 or 5
  • Depth: 4–5 downsampling/upsampling blocks
  • MLP for FiLM: two hidden layers of width βc(z)\beta_c(z)4; output βc(z)\beta_c(z)5
  • For metadata with few scalars: initial embedding to βc(z)\beta_c(z)6 or βc(z)\beta_c(z)7 via a small MLP

A typical receptive field is βc(z)\beta_c(z)8. The use of FiLM is notably effective in small data regimes, as quantified on the cardiac MRI ACDC dataset, where mean Dice jumped from βc(z)\beta_c(z)9 (baseline) to zz0 (FiLM-U-Net) at zz1 training size (Jacenków et al., 2019). This suggests the benefit is amplified where supervision is scarce.

5. Empirical Performance and Application Scenarios

On 2D medical segmentation (ACDC), decoder-side FiLM produced a mean Dice of zz2 versus zz3 for unconditioned U-Nets (full training data). Dramatic relative improvements emerged as training data decreased—implying strong utility in domains where labeled examples are rare. For audio source separation, the Conditioned-U-Net architecture with FiLM equaled or exceeded the performance of specialized, single-task U-Nets across separation metrics SDR, SIR, and SAR, despite using a single parameter-shared model (Meseguer-Brocal et al., 2019). The results demonstrate that feature-wise modulation enables sample-wise adaptation, increasing model flexibility without increasing base model complexity.

6. Architectural Trade-offs and Limitations

Findings from direct experiments are:

  • Decoder fusion (FiLM on decoder side) is more effective and stable than encoder- or bottleneck-side integration. Applying FiLM before skip concatenation is suboptimal; post-fusion application after convolution is preferred.
  • Skip connections are left unmodulated, and FiLM learns to gate the combined encoder-decoder representations.
  • Removing skip connections entirely can allow FiLM to outperform baseline U-Nets (in 2D settings with segmentation), but this is task-dependent.
  • In high-data regimes, absolute performance benefits of FiLM may be modest or not statistically significant. Conversely, low-data scenarios realize more tangible gains (Jacenków et al., 2019).
  • In source separation, no significant difference was observed between conditioned and single-task U-Nets in global performance metrics (Tukey test; Pearson zz4, zz5).

7. Implementation Guidelines and Typical Hyperparameters

For practical deployment of a 1D U-Net with FiLM for conditional signal segmentation or source separation, key implementation guidelines are as follows:

  • Use five encoder/decoder blocks with channels 64→1024, Conv1D kernel size 3 or 5.
  • Downsample (stride=2) per block; upsample symmetrically with ConvTranspose1D or upsampling followed by Conv1D.
  • After decoder skip fusion and after the convolution stack, apply FiLM:
    • Inputs: shared embedded zz6 (via MLP, zz7)
    • Per-block FiLM MLP: 2-layer, width zz8 channels, output zz9.
    • Broadcast scales/shifts along the sequence dimension.
  • Optionally, a late FiLM may be applied at the output head.
  • For training, Adam optimizer, batch size of 16, learning rate FiLM(x)n,â„“,c=γc(z) xn,â„“,c+βc(z)\mathrm{FiLM}(x)_{n,\ell,c} = \gamma_c(z)\, x_{n,\ell,c} + \beta_c(z)0; L1 loss on appropriate outputs.
  • For categorical conditions (e.g., instrument selection), one-hot encode and embed through a small net paralleling the main architecture (Meseguer-Brocal et al., 2019).
  • Progressive conditioning noise may aid robustness: regularly inject small perturbations in FiLM(x)n,â„“,c=γc(z) xn,â„“,c+βc(z)\mathrm{FiLM}(x)_{n,\ell,c} = \gamma_c(z)\, x_{n,\ell,c} + \beta_c(z)1 during training.

In sum, 1D U-Nets with feature-wise linear modulation introduce a powerful, architectural mechanism for test-time adaptive behavior via auxiliary signals, with proven benefits in both medical and audio signal processing domains, particularly under limited-data and multi-task settings.

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 1D U-Net Architecture with Feature-wise Linear Modulation.