Memory Replay with Data Compression for Continual Learning

Liyuan Wang, Xingxing Zhang, Kuo Yang, Longhui Yu, Chongxuan Li, Lanqing Hong, Shifeng Zhang, Zhenguo Li, Yi Zhong, Jun Zhu

Deep neural networks are notoriously bad at "continual learning"—the ability to learn new tasks sequentially without forgetting old ones. They typically suffer from catastrophic forgetting, where newly acquired information overwrites and erases previously learned knowledge.

The current gold standard for mitigating this issue is memory replay: saving a small "buffer" of samples from previous tasks to periodically show the model during new training phases. However, most existing methods store original, uncompressed images. Because memory buffers are strictly limited in size, they can only hold a tiny fraction of past data, which fails to capture the full diversity of the original data distribution.

While biological brains solve this by storing memories in highly compressed, encoded forms, AI research has largely overlooked the potential of lossy compression to fit more "memories" into the same space. This paper introduces Memory Replay with Data Compression (MRDC), a strategy that boosts continual learning by storing a larger number of compressed old samples instead of a few high-quality ones.

The MRDC Approach

The authors propose applying standard JPEG compression to training samples before they enter the memory buffer. This introduces a critical new degree of freedom: the trade-off between Quality ($q$) and Quantity ($N$).

The core technical challenge is determining the right compression quality $q$. If the quality is too high, the buffer cannot store enough samples to represent the distribution. If it is too low, the images become "out-of-distribution" (OOD) artifacts that confuse the model and degrade performance.

Instead of relying on an expensive "grid search"—training the model dozens of times with different settings to see what works—the authors developed a highly efficient selection method based on Determinantal Point Processes (DPPs):

  1. Geometric Interpretation: They treat the features of the images as vectors in space. The "information content" of a set of images is represented by the volume spanned by these vectors.
  2. The Optimization: The algorithm searches for the lowest quality $q$ that still maintains a feature volume similar to the original, uncompressed subset.
  3. Efficiency: This calculation utilizes the current model's feature extractor, making it over 100x faster than traditional hyperparameter tuning.

Balancing Quality and Quantity

The most surprising insight from the research is that a model often learns better from a larger quantity of "fuzzy" images than from a small handful of "perfect" ones. The increased coverage of the data distribution outweighs the loss of per-pixel detail.

Effect of compression quality on averaged accuracy across different incremental phases.

However, there is a clear "OOD cliff." As shown in the performance curves across different phase settings, there is an optimal compression threshold (often around $q=50$). Beyond this point, aggressive compression destroys the semantic meaning of the features, causing compressed features to drift too far away from the original data clusters and sharply reducing accuracy.

Key Results and Performance

The researchers evaluated MRDC across several demanding benchmarks, including CUB-200-2011, ImageNet-sub, ImageNet-full, and SODA10M (a massive dataset for autonomous driving object detection).

Averaged accuracy versus training time for various methods across 5, 10, and 25 phases.

The results demonstrate a massive leap in continual learning performance:

  • Performance Boost: On ImageNet-sub (25-phase), adding MRDC to the standard "LUCIR" baseline improved accuracy from 61.44% to 70.53%.
  • State-of-the-Art (SOTA): MRDC consistently outperformed recent, more complex methods like AANets and DDE.
  • Computational Savings: While other SOTA methods require heavy extra computation (like distilling features or learning extra parameters), MRDC adds negligible overhead. It achieves higher accuracy in a fraction of the training time.
  • Real-World Applicability: In the autonomous driving scenario (SODA10M), MRDC improved the Mean Average Precision (mAP) by several percentage points compared to standard replay, proving its viability for large-scale, real-world incremental data.

Limitations and Future Directions

While MRDC establishes a strong new baseline, the authors note a few areas for future exploration:

  • Fixed Compression Algorithm: This paper relies on JPEG, a "hand-crafted" algorithm. Using learned neural compression (like autoencoders) could potentially squeeze even more semantic information into the buffer.
  • Feature Drift: The DPP selection relies on the feature extractor at a specific point in time. As the model continues to learn and its internal representations change, the optimal compression quality might shift.
  • Data Imbalance: If the algorithm chooses drastically different compression levels for different tasks, it might create a data imbalance where the model "prefers" tasks with higher-quality images. Alleviating this imbalance remains a promising direction for future research.

Summary updated

BibTeX
@inproceedings{wang2022memory,
  author = {Liyuan Wang and Xingxing Zhang and Kuo Yang and Longhui Yu and Chongxuan Li and Lanqing Hong and Shifeng Zhang and Zhenguo Li and Yi Zhong and Jun Zhu},
  title = {{Memory Replay with Data Compression for Continual Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=m1qP0K-4vEv},
}
Figure