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
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.
The 3×32×32 image the encoder sees, split into its colour planes.
16 of layer-1’s 256 channels (16×16 each). Coolwarm = signed activation. These shift with SNR — the AF gates are already steering.
The full bottleneck the network transmits: all 16 channels, 8×8 each = 1024 real values → 512 complex symbols. This is the message on air.
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.
Each dot = one complex symbol + live AWGN. Low SNR → fat noise cloud.
PSNR at this SNR: — dB
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).
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.
| Layer | kernel / stride | out shape | role |
|---|---|---|---|
| Conv 1 | 5×5 / s2 | F × 16 × 16 | downsample (panel 1) |
| Conv 2 | 5×5 / s2 | F × 8 × 8 | downsample |
| Conv 3 | 5×5 / s1 | F × 8 × 8 | refine |
| Conv 4 | 5×5 / s1 | F × 8 × 8 | refine |
| Conv 5 | 5×5 / s1 | C × 8 × 8 | project 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.
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, σ²)
+ 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.)
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).
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:
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
[0,1]; each
feature channel is scaled by its weight (panel 3).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.
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
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.