
The attention mechanism augments perceptual features from a prior generator encoder network \(g_1(\cdot )\)  computed over input images \(X_i\) . The aim is to establish a convex combination of quality-enhanced condensed representations of the input image for real time training. We begin by describing the channel attention in PAM, which is based on the CBAM module [1]}. PAM involves two steps: first, per-channel “summary statistics” \(F_{global}\)  obtained from a 2-layer residual block \(RB_1\) , is calculated to yield the global feature attention vector \( U \in \mathbb {R} ^{1 \times 1 \times C}\) . Secondly, a multi-head network \(head_{i} = Attention(Aw_i^{A},Bw_i^{B} )\)  applies a non-linear multi-head attention transformation which allows the model to jointly attend to information \(A\)  and \(B\)  from different representation sub-spaces \(w_i^{A}\)  and \(w_i^{B}\)  of the bottleneck [2]}. The channel-based attention output is given as \(h\)  = softmax \((head_i \odot U)\)  which is multiplied with the encoder output \(E \in \mathbb {R}^{H \times W \times C}\)  from \(g_1\)  and processed by the residual block \(RB_2\)  to produce the channel-based attention embeddings, denoted as \( Z = RB_2( E \odot {h})\)  where \( Z \in \mathbb {R}^{H \times W \times C}\) .
