Abstract
Classification of images within the compressed domain offers significant benefits, including reduced memory and computational requirements. This paper proposes two methods as a proof of concept: the first classifies within the JPEG image transform domain (DCT data), and the second classifies the JPEG compressed binary bitstream directly. These methods are implemented using Residual Network CNNs and an adapted Vision Transformer. Top-1 accuracy of approximately 70% and 60% were achieved on the Caltech C101 database. While trailing state-of-the-art pixel-based methods, this work demonstrates for the first time that direct bitstream image classification is possible, offering potential for high-speed screening in resource-constrained environments.
Introduction
In traditional computer vision, images must be fully decompressed from formats like JPEG into raw RGB pixels before a model can process them. This decompression step is computationally expensive and memory-intensive, creating a bottleneck for real-time applications or large-scale network screening. As global data volumes grow, there is an increasing need for "first-pass" screening—identifying image content while it is still in transit or stored in a compressed state.
The challenge lies in the nature of compressed data. Entropy-encoded bitstreams are highly decorrelated and lack the spatial structure that traditional Convolutional Neural Networks (CNNs) exploit. This research investigates whether modern architectures can bypass decompression entirely, learning directly from the frequency domain or raw binary bits.
Methodology
The researchers evaluated two primary approaches for compressed-domain classification using the Caltech 101 (C101) dataset, which contains 9,146 images across 101 categories. All images were preprocessed to 256x256 pixels and encoded with a JPEG quality factor of 95.
Transform Domain Classification (Method 1)
This approach uses de-quantized Discrete Cosine Transform (DCT) coefficients as input. By operating in the frequency domain, the model preserves the spatial arrangement of the underlying 8x8 JPEG blocks while avoiding the final stages of decompression.
Bitstream Domain Classification (Method 2)
This more radical approach classifies the raw, Huffman-coded binary bitstream. To make the bitstream "digestible" for a neural network, the researchers developed a specific formatting pipeline to restore spatial structure.
As shown in the figure above, "End of Block" (EoB) markers are used to segment the bitstream into macroblocks. These segments are then rearranged, cropped, or zero-padded to a fixed width to form a structured 3D input tensor. This allows the network to treat the bitstream as a spatial signal.
Results and Analysis
The experimental results confirm that direct bitstream classification is feasible, though performance currently sits below pixel-based state-of-the-art (~95% on C101).
As detailed in the table above, the Transform Domain method (Method 1) achieved the highest accuracy at 68.1%. The Bitstream Domain method (Method 2) reached 59.5% accuracy, representing a significant milestone as the first successful demonstration of direct bitstream classification. Interestingly, adapted Vision Transformers (Method 4) performed notably worse (48.1%), suggesting that standard convolutions are currently more effective at extracting features from the structured macroblock data.
Discussion and Future Work
A key insight from this work is that spatial consistency is vital. The uniform 8x8 grid of JPEG provides a stable structure that allows CNNs to function even on non-pixel data. However, several limitations remain. The current models are sensitive to JPEG quality factors; real-world bitstreams vary based on different quantization tables. Additionally, the current implementation converts bits into floating-point variables, which is computationally inefficient. Future research will focus on developing binary-based networks to fully realize the efficiency gains of bitstream processing and improving robustness to varying compression levels.
Conclusion
This proof of concept demonstrates that neural networks can "read" compressed data directly. While accuracy needs improvement to match pixel-domain models, the ability to classify images without decompression opens new possibilities for ultra-fast screening in network routers, IoT devices, and other resource-constrained environments.
Summary updated