ADJSCC — Architecture & Live Internals

Neural architecture behind this reproduction of “Wireless Image Transmission Using Deep Source-Channel Coding With Attention Modules”. One autoencoder sends a CIFAR-10 image straight over a noisy channel — no JPEG, no LDPC — and Attention Feature (AF) modules feed the channel SNR into the network so one model covers 0–20 dB. Everything in the explorer below is real data pulled from the trained checkpoint. See the full model architecture & training curves.

Pages: Architecture & live internals (this page) · Interactive SNR explorer · Model architecture & training curves

Image
3 × 32 × 32
→
Encoder
5 conv + AF
→
Code
C × 8 × 8
→
Power norm
avg pwr = 1
→
AWGN
+ noise(SNR)
→
Decoder
5 deconv + AF
→
Image ĥ
3 × 32 × 32

Live explorer — watch the internals move with SNR

Pick an image, drag the SNR slider. Every panel is precomputed from the trained C=16 model at that SNR — the encoder feature maps, the 16-channel codeword actually put on air, the AF gates, and the reconstruction. Only the channel noise scatter is redrawn live.

Channel SNR — dB

0 Input · RGB channels

input
R
R
G
G
B
B

The 3×32×32 image the encoder sees, split into its colour planes.

1 Encoder layer-1 feature maps

encoder features

16 of layer-1’s 256 channels (16×16 each). Coolwarm = signed activation. These shift with SNR — the AF gates are already steering.

−+

2 Codeword sent · C=16 @ 8×8

codeword

The full bottleneck the network transmits: all 16 channels, 8×8 each = 1024 real values → 512 complex symbols. This is the message on air.

3 AF gates · bottleneck layer

Per-channel attention weights (0–1) the SNR produces for the 16 code channels. Watch them rebalance as you drag — this is how one model adapts.

4 Received constellation

Each dot = one complex symbol + live AWGN. Low SNR → fat noise cloud.

5 Reconstruction

reconstruction

PSNR at this SNR: — dB

Bandwidth ratio R — the one number that sets the size

For a 32×32 image the encoder outputs a C × 8 × 8 tensor = C·64 real values. Split into complex symbols (real + imag), that is the channel budget. The bandwidth ratio is

R = C / 96          # channel symbols per source dimension
ratio_to_C(R) = round(R · 96)     # R = 1/6  →  C = 16

Lower C = harder compression, fewer symbols on air, lower quality. This single knob (--ratio) is the whole quality-vs-bandwidth tradeoff. Default reproduction: R = 1/6 → C = 16 (the 16 heatmaps in panel 2).

Encoder pixels → channel symbols

Five convolutional layers. First two stride-2 blocks shrink 32→16→8 spatially; the last three keep 8×8 and squeeze channel depth down to C. Every layer is Conv → PReLU → AF.

Layerkernel / strideout shaperole
Conv 15×5 / s2F × 16 × 16downsample (panel 1)
Conv 25×5 / s2F × 8 × 8downsample
Conv 35×5 / s1F × 8 × 8refine
Conv 45×5 / s1F × 8 × 8refine
Conv 55×5 / s1C × 8 × 8project to budget (panel 2)

F is net width (default 256, --filters). PReLU is a leaky-ReLU whose negative slope is learned per channel. After each activation an AF module re-weights the channels using the current SNR.

Power normalization + AWGN channel

The C×8×8 map is flattened to a vector z of length C·64 and power-normalized so average power per element is exactly 1 — enforcing the transmit power budget the SNR is defined against:

scale = sqrt( k / (Σ zᵢ²) )        # k = C·64
z_norm = z · scale                 # mean(z_norm²) = 1

The vector is read as complex symbols (first half real, second half imag). The AWGN channel adds Gaussian noise set by the SNR in dB:

σ² = 1 / 10^(SNR_dB / 10)           # noise power at unit signal power
per-component std = σ / √2          # split across real & imag
y = z_norm + N(0, σ²)
This is the only place noise enters, and it is a plain + randn — fully differentiable, so gradients flow straight back through the channel into the encoder. That is what lets the encoder learn a code robust to noise instead of compressor + separate error code. (Rayleigh fading is stubbed; AWGN is the core result.)

Decoder received symbols → image

Mirror of the encoder: five transposed convolutions. Three keep 8×8, then two stride-2 blocks upsample 8→16→32. Layers 1–4 are ConvT → PReLU → AF; the final layer uses sigmoid to bound outputs into [0,1] (panel 5).

AF module — how SNR steers the network

The paper’s contribution and the reason one model spans all SNRs. An Attention Feature module is a squeeze-and-excitation gate conditioned on the SNR. For a feature map x of shape (B, Ch, H, W) and scalar SNR:

xB·Ch·H·W avg-pool→ ctx (B·Ch) concat SNR FC → ReLUCh FC → sigmoidgate s∈[0,1] x · sgated output
ctx = x.mean(dim=(H,W))              # global avg pool  → (B, Ch)
s   = concat([ctx, snr])            # append SNR       → (B, Ch+1)
s   = relu( fc1(s) )                # Linear(Ch+1 → Ch)
s   = sigmoid( fc2(s) )            # Linear(Ch → Ch)  → gate in [0,1]
out = x * s[:, :, None, None]       # per-channel rescale

What it does

  • Squeeze: global average pool → one number per channel, a compact summary.
  • Condition: the SNR scalar is concatenated, so the gate sees content and channel quality.
  • Excite: two FC layers give one weight per channel in [0,1]; each feature channel is scaled by its weight (panel 3).

Why it matters

  • At low SNR the net emphasizes robust, low-detail channels; at high SNR it passes fine detail. The gate learns this per-SNR.
  • One weight set serves the whole range — no separate model per SNR (the baseline’s weakness).
  • Costs only 2·Ch² parameters per module — tiny next to the conv stack.

AF modules sit after every conv/deconv activation: 5 in the encoder (widths F,F,F,F,C) and 4 in the decoder (all width F). The same SNR is broadcast to all of them and also sets the channel noise — the network is told exactly the condition it must survive.

Training objective

End-to-end MSE between input and reconstruction; SNR sampled uniformly from the training range each step (ADJSCC) or fixed (baseline). Metrics: PSNR and single-scale SSIM — CIFAR’s 32×32 is too small for MS-SSIM’s 5-scale pyramid.

ADJSCC :  train SNR ~ Uniform[0, 20] dB,  AF modules on   → one model, full range
baseline: train SNR = fixed (e.g. 1 or 19 dB), AF off      → one model per SNR
Headline experiment. A baseline trained at 19 dB collapses when tested at 1 dB (and vice-versa) — SNR mismatch. ADJSCC, told the true SNR through its AF gates, tracks the best fixed-SNR model at every point with a single set of weights.

Explorer data baked live from ckpt/adjscc_r16.pt via scripts/viz_internals.py. Architecture: adjscc/models.py + adjscc/channel.py. Reproduction of arXiv:2012.00533, CIFAR-10 / AWGN.