Communication systems designed for reliable data reconstruction, rather than task-oriented communication, typically rely on separate source and channel coding and incur high latency under limited spectrum availability and fading channels. To address this, we propose a transmission framework with opportunistic spectrum access, in which the transmitter sends discrete latent representations learned via a vector-quantized variational autoencoder (VQ-VAE) over idle licensed channels using standard digital modulation. The AI-powered receiver is still able to reconstruct task-related information from the heavily compressed data. We develop a cross-layer latency model that accounts for compression, block errors, retransmissions, and stochastic channel access. Results on latency-accuracy trade-offs show that the proposed scheme achieves at least 79- and 3.3-fold latency reductions with only 5.7% and 2.4% drops in classification accuracy compared to benchmarks using conventional source and channel coding. The framework enables low-latency communication and reliable task execution even under limited spectrum availability and challenging channel conditions.
Task-oriented communication, cognitive radio, remote inference, variational inference, vector quantization.
The convergence of wireless communications and ai has led to the paradigm of task-oriented communication, where the objective is to efficiently support downstream tasks rather than to reliably reconstruct transmitted data [1]. In this context, performance is measured through metrics that jointly capture task accuracy and communication efficiency, which is particularly relevant for computer vision applications such as image classification, object detection, and scene understanding.
For many emerging applications, communication must support latency-sensitive tasks, where end-to-end delay is the primary performance metric. Achieving low latency requires reducing the communication payload while preserving task-relevant information, which challenges conventional transmission schemes employing separate source and channel coding.
Recent works on jscc have shown that learned representations can provide compact and robust data compression tailored to downstream tasks [2]–[4]. In particular, vq-vae [5] enables compression into a discrete latent space, allowing the resulting representations to be transmitted using standard digital modulation schemes and integrated into link adaptation frameworks. Moreover, such representations have been shown to preserve task-relevant features, enabling competitive classification performance even under compression and channel-induced distortions [2].
Most existing studies assume dedicated or continuously available communication resources. However, in cognitive radio systems, transmission occurs through opportunistic access to licensed channels, where availability depends on primary user activity [6], [7]. This introduces an additional source of randomness, as communication opportunities are intermittent. Consequently, the communication latency depends not only on compression and transmission reliability, but also on channel availability, making its characterization more involved.
In this work, we consider a pair of cognitive users that exchange images for remote inference under opportunistic spectrum access. System performance is evaluated in terms of task accuracy and communication latency, defined as the time required to deliver a batch of images for processing. To enable low-latency communication, we adopt a vq-vae-based transmission framework that generates discrete latent representations, reducing the number of transmitted bits while remaining compatible with digital communication pipelines.
Our main contribution is a statistical analysis of the communication latency for task-oriented data transmission with opportunistic spectrum access. The analysis captures the impact of compression, block errors, retransmissions, and stochastic channel access, and applies to both the proposed framework and standard benchmarks. It enables the evaluation of latency-accuracy trade-offs in scenarios with limited and unreliable spectrum access. Applying this analysis, we show that the proposed framework achieves communication latency gains of at least \(79\times\) and \(3.3\times\) with marginal task-accuracy drops of 5.7% and 2.4% compared to standard schemes using lossless and lossy source compression, respectively.
The rest of the paper is organized as follows. Section 2 presents the system model. Sections 3 and 4 describe the proposed framework and the analysis of the communication latency, respectively. Numerical results are discussed in Section 5, and Section 6 concludes the paper.
We consider the scenario in Fig. 1, where a ctx sends a batch of data samples for remote inference to a crx. Both ctx and crx have a single antenna and use slotted communication over \(C\) licensed channels of total bandwidth \(B\), with frame duration \(T_0\). lus are willing to share part of their radio resources with cognitive users. The ctx performs spectrum sensing to detect lu activity on each channel and access idle ones. This is performed at the start of every frame, leaving \(T<T_0\) for data transmission. To model spectrum availability accounting for the lu activity and sensing performance, we define the channel non-access probability for the ctx.
Definition 1 (Channel non-access probability). We denote by \(p_c\) the probability that the ctx does not send data over channel \(c\) in a given frame due to the detection of lu activity. Regardless of the spectrum sensing method, this probability depends on the method’s true and false positive rates, as well as on the distribution of lu activity. For simplicity, we assume stationary processes and that lu activity is i.i.d. across frames, so that \(p_c\) remains constant over time.
Each data sample is an RGB image \(\boldsymbol{S} \in \mathbb{R}^{H \times W \times 3}\), where \(H\) and \(W\) are the image height and width in pixels, and 3 is the number of color components. An uncompressed communication batch is denoted by \(\boldsymbol{\Sigma} \in \mathbb{R}^{S\times H \times W \times 3}\) with \(S\) samples, and it represents the minimum data unit for the crx to start inference. The batch contains \(b_0\) bits, compressed to \(b<b_0\) bits after source compression, giving a compression ratio of \(b_0/b\). The ctx splits the \(b\)-bit batch into \(n\)-bit data blocks, each carrying \(k\leq n\) information bits; \(k=n\) if uncoded, while \(k<n\) when channel coding is used.
Before transmission over physical channels, the data blocks are mapped to symbols of a m-pam constellation. We assume block-fading channels with a dominant line-of-sight component and perfect power control. Therefore, the channels are equivalent additive white Gaussian noise channels with snr \(\gamma\), where ber is approximated by [8] \[P_b \approx \frac{2(M-1)}{M \log_2 M} Q \left( \sqrt{\frac{6}{M^2-1} \gamma} \right),\] and \(Q\) denotes the Gaussian Q-function.
For uncoded transmissions, the bler for \(n\)-bit blocks is approximated as \[\epsilon_0 \approx 1 - (1 - P_b)^n,\] assuming independent bit errors. With channel coding, the bler \(\epsilon\) depends on \(k\), \(n\), and the coding scheme, and is typically lower than \(\epsilon_0\). To trade communication latency for reliability, the ctx can enable or disable retransmissions of erroneously received data blocks and the corresponding feedback signaling. When enabled, we assume that the crx can perfectly detect block errors and send instantaneous, error-free, per-block requests that result in immediate retransmissions.
In what follows, we introduce the proposed framework for low-latency image transmission based on vq-vae.
In this section, we introduce the proposed transmission framework as shown in Fig. 2. To enable low-latency communication, the framework relies on compressed image representations obtained by a vq-vae trained offline. The learned encoder and decoder networks are deployed in the ctx and crx, respectively, while the learned latent space functions as a codebook shared between the cognitive users.
To transmit data, the ctx passes an image through the vq-vae encoder and quantizer, obtaining a discrete representation based on latent vectors in the codebook. The indices of the latent vectors, which are scalars in the domain \([1,K]\), are then binary-encoded as sequences of \(\log_2 K\) bits, and the resulting bitstream is mapped to m-pam symbols. Finally, the symbols are sent over the idle channels detected during spectrum sensing. Subsequently, to receive the data, the crx applies the inverse operations to the received symbols, recovering the discrete representation and feeding it to the vq-vae decoder to obtain the reconstructed image. This operation is performed for all samples in the communication batch, and the reconstructed images are forwarded to the downstream task.
Now, we present the vq-vae model used to obtain the compressed image representations. Importantly, during offline training, the model is trained in the absence of the wireless communication pipeline. Evaluations of communication latency and task accuracy will show later that this approach leads to stable learning and competitive performance during system operation.
Given an input image \(\boldsymbol{S}\), the encoder network maps it into a continuous latent representation as: \[\boldsymbol{Z}_e = f_{\theta}(\boldsymbol{S}), \quad \boldsymbol{Z}_e \in \mathbb{R}^{H' \times W' \times \Delta},\] where \(f_{\theta}\) denotes the encoder parameterized by \(\theta\), \(H'\times W'\) is the spatial dimension of the latent representation, and \(\Delta\) is the dimensionality of the latent space. Each spatial location \(\left(i,j \right)\) of the tensor \(\boldsymbol{Z}_e\) is then quantized using a learned discrete latent space \(\mathcal{E} = \{ \boldsymbol{e}_l \in \mathbb{R}^\Delta \}^{K}_{l=1}\), resulting in a discrete latent representation \(\boldsymbol{Z}_q \in \mathbb{R}^{H' \times W' \times \Delta}\): \[\boldsymbol{Z}_q^{(i,j)} = \mathop{\mathrm{arg\,min}}_{\boldsymbol{e}_l \in \mathcal{E}} \| \boldsymbol{Z}_e^{(i,j)} - \boldsymbol{e}_l \|_2.\] Naturally, the quantized feature map \(\boldsymbol{Z}_q\) can be equivalently represented by a matrix of indices: \[\boldsymbol{I}^{(i,j)} = \mathop{\mathrm{arg\,min}}_{l \in \{1,\dots,K\}} \| \boldsymbol{Z}_e^{(i,j)} - \boldsymbol{e}_l \|_2,\] which, during system operation, can be transmitted more efficiently than the full latent vectors. Hence, since each sample is compressed to \(H'W'\) indices, each encoded using \(\log_2 K\) bits, the resulting compressed communication batch has \(b = H'W'\log_2 K\) bits.
To reconstruct the compressed image, the indices are mapped back to their corresponding latent vectors using \(\mathcal{E}\), yielding the latent discrete representation: \[\hat{\boldsymbol{Z}}_q^{(i,j)} = \boldsymbol{e}_{\hat{\boldsymbol{I}}^{(i,j)}},\] where \(\hat{\boldsymbol{Z}}_q\) and \(\hat{\boldsymbol{I}}\) are used to emphasize that during system operation, reconstruction may rely on partially erroneous received data. Finally, the decoder network \(g_{\phi}\), parameterized by \(\phi\), produces the reconstructed image as \(\hat{\boldsymbol{S}} = g_{\phi} ( \hat{\boldsymbol{Z}}_e )\).
The loss function of vq-vae consists of three terms and is defined as follows [5], where \(\text{sg}\{\cdot\}\) denotes the stop-gradient operator: \[\begin{align} \mathcal{L} = - \log\Pr(\boldsymbol{S}|\boldsymbol{Z}_q) & + \sum_{(i,j)} \|\text{sg}\{\boldsymbol{Z}_e^{(i,j)}\} - \boldsymbol{e}_{\boldsymbol{I}^{(i,j)}}\|_2^2~+\\ & + \beta \sum_{(i,j)} \|\boldsymbol{Z}_e^{(i,j)} - \text{sg}\{\boldsymbol{e}_{\boldsymbol{I}^{(i,j)}}\}\|_2^2, \nonumber \end{align}\] where \((i,j) \in H'\times W'\). The first term is the variational lower bound with constant terms omitted, which reduces to the mean-squared error between \(\boldsymbol{S}\) and \(\hat{\boldsymbol{S}}\) [5]. The second term is the vector quantization loss, which moves the latent space vectors toward the encoder outputs. Meanwhile, the third term is the commitment loss weighted by \(\beta\), which encourages the encoder to generate outputs that are close to the latent space vectors. By minimizing this loss during offline, unsupervised training, we obtain the discrete latent space and the encoder and decoder networks used for low-latency image transmission.
In this section, we statistically characterize the communication latency of the investigated system for opportunistic wireless transmission over licensed channels. The characterization considers the general setup and is applicable to analyze the latency of the proposed framework, as well as other transmission schemes that employ, e.g., separate source and channel coding, with retransmissions enabled or disabled.
To model the communication latency, we first derive the number of block transmissions required to send a batch of samples, including retransmissions due to block errors. We then derive the number of channel accesses required to deliver these blocks, accounting for the spectrum availability constrained by lu activity. Hence, given the compressed batch of \(b\) bits and the block structure with \(k\) information bits, the resulting number of blocks is \(D_t = \lceil b/k \rceil\).
During reception, each data block is subject to a bler \(\epsilon\). In this context, when retransmissions are enabled, erroneously received blocks are detected and retransmitted, thereby increasing the communication latency. In this case, the number of retransmissions follows a negative binomial distribution of the form \(\text{NB}(D_t,1-\epsilon)\). Consequently, depending on whether retransmissions are enabled or disabled, the number of retransmitted blocks is modeled as \[\begin{cases} D_r \sim \text{NB}(D_t,1-\epsilon), & \text{if retransmissions are enabled}\\ D_r = 0, & \text{if retransmissions are disabled} \end{cases}.\] This gives a total of \(D_t+D_r\) block transmissions per batch. Accordingly, as each block comprises \(n\) bits, the ctx must send \((D_t+D_r)n\) bits over the idle channels in order to deliver an entire batch of samples.
Since communication is carried out over time-constrained frames, a batch transmission might span across multiple frames. Hence, given that each channel access supports the transmission of \(BTC^{-1} \log_2 M\) bits, the number of accesses required to complete a batch transmission is given by \[F_a = \left\lceil \frac{(D_t+D_r)n}{BTC^{-1} \log_2 M} \right\rceil.\] The number of idle channels detected per frame depends on the lu activity and the spectrum sensing performance, meaning that the ctx might achieve fewer than \(C\) channel access decisions per frame interval. Given that, let \(F_n\) denote the number of channel non-access decisions made by the ctx before making \(F_a\) access decisions. \(F_n\) depends on \(F_a\), \(C\), and the channel non-access probabilities \(\{p_c\}_{c=1}^C\) as in Definition 1. In particular, assuming identical non-access probabilities across channels, i.e., \(p_1=\dots=p_C=p\), \(F_n\) can be defined such that \(F_n \sim \text{NB}(F_a,1-p)\). Then, given that the system has \(C\) channels and each frame has a duration \(T_0\), the latency to transmit an entire batch is given by \[\label{eq:latency} L = \left\lceil \frac{F_a+F_n}{C} \right\rceil T_0.\tag{1}\]
As noted earlier, this latency analysis applies either to a system with separate source and channel coding or to the proposed transmission framework. In the case of the proposed framework, we set \(n = k = \log_2 K\) and retransmissions are disabled, resulting in \(D_r=0\). In the next section, we use the model in 1 to evaluate the latency of the proposed framework and the benchmarks.
In this section, we present numerical results to evaluate the latency and task performance of the proposed framework and to compare it with benchmark transmission schemes.2
In the simulations, we assume image transmissions from the 160 px version of the Imagenette3 dataset, with 9469 images in the training split and 3925 in the test split, all centrally cropped to \(128\times128\) pixels. All models are implemented in PyTorch 2.10.0 and optimized with the Adam [9] algorithm. For the vq-vae, the training batch size, learning rate, and commitment loss weight are set to 128, \(3\times10^{-4}\), and 0.25, respectively. Moreover, two codebook sizes are considered so that \(K\in\{8,512\}\), while the latent dimension is kept constant at \(\Delta=64\). The vq-vae encodes each \(128 \times 128\) pixel image with an 8-bit color depth into \(32 \times 32\) latent vectors, achieving a compression ratio of \(b_0/b=384/\log_2 K\).
Regarding the communication parameters, we assume binary phase shift keying modulation (\(M=2\)), a bandwidth of \(B=10\) MHz, and frames of \(T_0=10\) ms, of which \(T=9\) ms are used for data transmission and the rest for spectrum sensing. Each communication batch contains 100 images, while the number of channels, snr, and channel non-access probability are swept such that \(C\in[1,10]\), \(\gamma\in[-6,15]\) dB, and \(p\in[0,0.99]\).
As benchmarks, we consider transmission schemes that employ ldpc channel coding with \((n,k)=(100,90)\) combined with lossless or lossy compression, or without source coding. png is adopted for lossless compression, achieving a compression ratio of 1.7 in the considered dataset. For lossy compression, jpeg is considered with the quality parameter set per image to achieve a compression ratio of 40. Lastly, for the case without source coding, we assume the transmission of raw RGB image data. Retransmissions are enabled only for the methods that employ png or jpeg. We start by discussing the latency results.
Figs. [fig:latency-SNR], [fig:latency-p], and [fig:latency-C] depict the communication latency as a function of the snr, the channel non-access probability, and the number of channels, respectively. These results reveal that the proposed framework achieves substantial latency gains compared to all the considered benchmarks. The gains are more pronounced with a smaller codebook, as fewer bits are required to represent the indices of the latent vectors. The latency benefits of the proposed scheme remain consistent with different spectrum availability, as shown in Figs. [fig:latency-p] and [fig:latency-C].
In Fig. [fig:latency-SNR], we observe that the latency of the benchmarks that employ png and jpeg increases rapidly as snr drops below 7 dB, driven by a surge in retransmissions due to block errors. This does not occur in the proposed framework or the raw-RGB benchmark, where latency is independent of snr because retransmissions are disabled. As shown later, this latency benefit comes at the cost of increased distortion and degraded task accuracy. Furthermore, for snr above 7 dB, the latency of the jpeg benchmark approaches that of vq-vae(512), due to their similar compression ratios of 40 and 42.66, respectively. Despite this, none of the considered benchmarks outperforms the low latency of the proposed framework with a codebook size of 8, which achieves a compression ratio of 128. Especially, Fig. [fig:latency-SNR] reveals that vq-vae(8) achieves latency gains of at least \(134\times\), \(79\times\), and \(3.3\times\) compared to the raw-RGB, png, and jpeg benchmarks, respectively.
We now evaluate the task accuracy achieved by the crx for the proposed framework and benchmarks. For the downstream task, we consider image classification by a MobileNetV3-Large model [10]. In the implementation, we adopt a transfer learning approach by initializing the model with weights pre-trained on a large-scale dataset and, for each scenario, fine-tuning the model on the received images of the target dataset. Fine-tuning is performed with a training batch size of \(64\) and a learning rate of \(10^{-3}\). The performance metric captures both the receiver’s ability to decode images, even with distortion, and the resulting classification accuracy. Thus, the task accuracy is zero when an image cannot be decoded and equals the classification accuracy otherwise.
Fig. 4 shows the task accuracy as a function of snr, while Fig. 5 depicts the psnr of the successfully decoded images as a function of snr. To limit latency in this evaluation, we set the maximum number of retransmissions per block to 2 for the png and jpeg benchmarks. Under this constraint, these schemes cannot decode the images when snr is below 6 dB, resulting in a zero task accuracy.4 This does not occur in the proposed framework or in the raw-RGB benchmark, where task performance and distortion degrade gracefully as snr decreases, allowing task execution even under channel fading. When snr is above 6 dB, the proposed framework with a codebook size of 512 achieves task accuracy comparable to standard separate source and channel coding schemes, with a marginal drop of up to 2% relative to the png benchmark, and a gain of up to 1.7% over that with jpeg. Moreover, for snr below 2 dB, the proposed framework achieves higher task accuracy with a smaller codebook, thanks to the lower bler obtained with shorter blocks. Lastly, Fig. 5 highlights that the proposed framework also exhibits reasonable image reconstruction performance, indicating its potential for other computer vision tasks.
Considering the latency and task accuracy results jointly, we note that the proposed framework achieves low-latency communication that scales well under limited spectrum availability. At the same time, it maintains competitive task accuracy, outperforming conventional source coding schemes by enabling task execution even under challenging channel conditions.
In this paper, we proposed a framework for task-oriented, low-latency image transmission with opportunistic spectrum access. By leveraging discrete, low-dimensional latent representations learned via a vq-vae, the framework reduces the number of transmitted bits while remaining compatible with conventional digital communication pipelines. Numerical results demonstrate a favorable latency-accuracy trade-off, with substantial latency reductions and only marginal accuracy degradation compared to standard benchmarks. Overall, the proposed framework enables efficient operation under limited spectrum availability by reducing the number of transmitted bits and avoiding retransmissions, while supporting uninterrupted task execution even under adverse channel conditions.
The implemented encoder and decoder architectures are listed from input to output in Table 1. In the table, “Conv2d” denotes a two-dimensional convolutional layer, whereas “ConvTranspose2d” denotes its transposed counterpart. “ResidualStack” denotes a stack of residual blocks following the ResNet architecture. All layers use the rectified linear unit as the activation function, denoted as “ReLU”. Further details on the hyperparameters can be found in the PyTorch 2.10.0 documentation and the source code provided with this work.
| Model | Layer type | Hyperparameters | Activation | Output channels |
|---|---|---|---|---|
| Encoder | Conv2d | kernel_size=4, stride=2, padding=1 | ReLU | 64 |
| Conv2d | kernel_size=4, stride=2, padding=1 | ReLU | 128 | |
| Conv2d | kernel_size=3, stride=1, padding=1 | ReLU | 128 | |
| ResidualStack | num_blocks=2, mid_channels=32 | ReLU | 128 | |
| Layer 1: kernel_size=3, stride=1, padding=1 | ||||
| Layer 2: kernel_size=1, stride=1, padding=0 | ||||
| Conv2d | \(kernel\_size=1\), stride=1, padding=0 | ReLU | \(\Delta\) | |
| ConvTranspose2d | kernel_size=4, stride=2, padding=1 | ReLU | 128 | |
| 2-5 | ResidualStack | num_blocks=2, mid_channels=32 | ReLU | 128 |
| Layer 1: kernel_size=3, stride=1, padding=1 | ||||
| Layer 2: kernel_size=1, stride=1, padding=0 | ||||
| 2-5 | ConvTranspose2d | kernel_size=4, stride=2, padding=1 | ReLU | 64 |
| ConvTranspose2d | kernel_size=4, stride=2, padding=1 | ReLU | 3 |
To illustrate the impact of compression and communication errors on image quality, Fig. 6 presents examples of compressed and received images obtained with the proposed framework and the benchmark transmission schemes. The label “Decoding failed” indicates cases where the received jpeg and png streams could not be decoded due to bitstream corruption, assuming a maximum of 2 retransmissions per block.
The examples show that images compressed by vq-vae exhibit smoother edges and a loss of fine detail, both of which become more pronounced as the codebook size decreases. Nevertheless, vq-vae largely preserves the shapes, edges, and colors of the original image and avoids the block-boundary artifacts observed with jpeg compression. Additionally, consistent with the trend in Fig. 5, received images using vq-vae and raw RGB exhibit increasing distortion as the snr decreases due to erroneously received blocks. For vq-vae specifically, reception errors produce distinct degradation patterns across images. For instance, at an snr of \(-2\) dB, the brass-player image compressed with vq-vae(512) is severely degraded by grain-like artifacts, whereas the truck image largely retains its original shape. At the same snr, vq-vae(8) demonstrates greater robustness, as the dog, church, and truck images preserve their shapes and edges, exhibiting mainly color distortions.
This work was supported by the SNS JU project 6G-GOALS under the EU’s Horizon Europe program under Grant Agreement No 101139232. The work by J. H. Inacio de Souza and P. Popovski was also supported by the Villum Investigator Grant “WATER” from the Velux Foundation, Denmark.↩︎
The source code used to generate these results is publicly available at https://github.com/joaohis/SemCR↩︎
In practice, link adaptation may restore communication by selecting a lower coding rate (\(k/b\)), at the cost of additional latency due to feedback exchange and the transmission of additional parity bits.↩︎