Probing Image Compression For Class-Incremental Learning

Justin Yang, Zhihao Duan, Andrew Peng, Yuning Huang, Jiangpeng He, Fengqing ZhuarXiv 2024

TL;DR

To combat "catastrophic forgetting" in Class-Incremental Learning (CIL), researchers often store a small buffer of historical images (exemplars). This paper demonstrates that using low-bitrate image compression allows systems to store significantly more exemplars within the same memory budget, and introduces a novel framework to resolve the resulting domain shift and optimize compression configurations.

What Problem Does This Paper Address?

In Class-Incremental Learning (CIL), deep learning models learn from a sequential stream of data where new classes appear over time. The primary challenge here is catastrophic forgetting—the tendency of neural networks to completely overwrite previously learned knowledge when training on new data.

A standard remedy is memory replay, which retains a small buffer of representative samples (exemplars) from past tasks. However, physical memory constraints severely limit the size of this buffer, preventing it from adequately representing the historical data distribution.

While compressing these exemplars seems like an obvious way to pack more images into the buffer, it introduces two major hurdles:

  1. Domain Shift: Training a model on low-bitrate compressed exemplars but testing it on original, uncompressed images causes a severe drop in accuracy due to the discrepancy in data characteristics.
  2. The Quality vs. Quantity Trade-off: How do we choose the right compression algorithm and bitrate? Standard image quality metrics like Peak Signal-to-Noise Ratio (PSNR) do not necessarily align with how well a neural network can classify an image.

Methods

The authors propose a multi-step framework to seamlessly integrate image compression into existing CIL baselines:

  1. Compression Pre-processing (Domain Alignment): To eliminate the domain shift between compressed training exemplars and uncompressed test data, the authors apply the chosen compression algorithm as a uniform pre-processing step across the entire dataset—both training and testing phases.
  2. Data-Efficient Rate Selection: Instead of performing an expensive grid search across dozens of bitrates, the framework uses data solely from the very first task ($T^0$). It splits this initial data in half, simulates a mini 2-step incremental learning task, and measures the forgetting percentage. The bitrate that minimizes forgetting is selected.
  3. Feature-Space Algorithm Selection: Rather than relying on pixel-level metrics like PSNR, the authors introduce Feature Mean Squared Error (FMSE). FMSE measures the distortion between the feature vectors of original and compressed images extracted by the network's ResNet backbone: $$\text{FMSE} = \frac{1}{M} \sum_{i=1}^{M} (\phi(x_i) - \phi(x'_i))^2$$ The compression method yielding the lowest FMSE is selected, as it preserves the semantic features most critical for classification.
Fig. 1: Comparative analysis of different compression methods for (a) CIFAR-100 and (b) ImageNet-100 datasets. The x-axis represents data rate (bpp), while the y-axis denotes the Peak Signal-to-Noise Ratio (PSNR). Numbers on the graph highlight the compression level.

Datasets

The framework was evaluated using two widely recognized computer vision benchmarks under the Learn From Scratch (LFS) protocol, partitioned into 10 sequential tasks:

  • CIFAR-100: An uncompressed dataset containing 100 classes of $32 \times 32$ images.
  • ImageNet-100: A 100-class subset of the large-scale ImageNet dataset, which is initially JPEG-compressed and features varying image resolutions.

Key Insights and Ideas

  • PSNR is a Deceptive Metric for ML: Traditional image compression metrics favor smooth pixel reconstruction, but neural networks care about semantic features. WebP often achieved higher PSNR values than neural compressors but resulted in worse final classification accuracy.
  • FMSE is a Better Predictor: Minimizing feature distortion (FMSE) consistently correlated with superior final CIL accuracy.
  • Test-Set Compression is Crucial: Compressing the test set during inference to match the training exemplar compression level drastically recovers performance that would otherwise be lost to domain shift.
Fig. 2: Previously seen class accuracy with and without compression pre-processing. The testing set is not compressed for (a) and showed significant performance degradation compared with (b) where the testing set is compressed during pre-processing. Note that the model is trained on compressed exemplars and original new class data.

Key Results

The authors integrated their compression framework into four prominent CIL baseline algorithms: iCaRL, WA, PODNet, and FOSTER.

  • Substantial Accuracy Gains: Across all baselines and datasets, utilizing compressed exemplars significantly outperformed uncompressed baselines. For instance, on CIFAR-100 with a strict 2.93MB buffer, integrating a Neural Compressor boosted FOSTER's final step accuracy from 45.63% to 55.87%.
  • Neural Compressors Dominate on Small Images: For low-resolution datasets like CIFAR-100, learned neural compressors (e.g., the Factorized model) and WebP vastly outperformed traditional JPEG compression, which introduces harsh blocking artifacts at low bitrates.
  • Outperforming Existing Methods: The proposed framework consistently beat specialized compression-based CIL methods like MRDC and CIM in both LFS and Learn From Half (LFH) protocols.

Limitations and Future Work

While the paper successfully addresses image classification, the authors do not extensively discuss the computational overhead introduced by running neural compression algorithms during the pre-processing phase, which could be a bottleneck for resource-constrained edge devices. Additionally, future work could explore how this framework scales to more complex downstream vision tasks like object detection or semantic segmentation within a continual learning environment.

Summary updated

BibTeX
@misc{yang2024probing,
  author = {Justin Yang and Zhihao Duan and Andrew Peng and Yuning Huang and Jiangpeng He and Fengqing Zhu},
  title = {{Probing Image Compression For Class-Incremental Learning}},
  year = {2024},
  eprint = {2403.06288},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.06288},
}
Figure