Abstract
Our brains extract durable, generalizable knowledge from transient experiences of the world. Artificial neural networks come nowhere close: when tasked with learning to classify objects by training on non-repeating video frames in temporal order (online stream learning), models that learn well from shuffled datasets catastrophically forget old knowledge upon learning new stimuli. We propose a new continual learning algorithm, Compositional Replay Using Memory Blocks (CRUMB), which mitigates forgetting by replaying feature maps reconstructed by recombining generic parts. Just as crumbs together form a loaf of bread, we concatenate trainable and re-usable "memory block" vectors to compositionally reconstruct feature map tensors in convolutional neural networks. CRUMB stores the indices of memory blocks used to reconstruct new stimuli, enabling replay of specific memories during later tasks. CRUMB's memory blocks are tuned to enhance replay: a single feature map stored, reconstructed, and replayed by CRUMB mitigates forgetting during video stream learning more effectively than an entire image, even though it occupies only 3.6% as much memory. We stress-tested CRUMB alongside 13 competing methods on 5 challenging datasets. To address the limited number of existing online stream learning datasets, we introduce 2 new benchmarks by adapting existing datasets for stream learning. With about 4% of the memory and 20% of the runtime, CRUMB mitigates catastrophic forgetting more effectively than the prior state-of-the-art.
Introduction
One of the most persistent challenges in artificial intelligence is Online Stream Learning. While biological systems learn continuously from a temporal flow of information, artificial neural networks typically require shuffled, independent, and identically distributed (i.i.d.) data. When exposed to a stream—highly correlated video frames where objects are seen from different angles before moving to the next—standard models suffer from "catastrophic forgetting." This occurs because the model's weights shift to favor the most recent data, completely overwriting previously acquired knowledge.
To mitigate this, researchers often use "experience replay," storing past images to retrain the model periodically. However, storing millions of high-resolution raw images is computationally expensive and poses privacy risks for edge devices or autonomous agents.
The CRUMB Framework: Compositional Replay
The authors introduce CRUMB (Compositional Replay Using Memory Blocks), a method that allows models to learn from a single pass of video-like data while maintaining high performance and a minimal memory footprint. The core innovation is Compositional Replay. Instead of storing raw pixels, CRUMB stores a "recipe" for rebuilding the internal activations (feature maps) of the network.
As shown in the architecture diagram, the process involves several key steps:
- The Codebook: The model maintains a trainable matrix $B$ of "memory blocks"—generic feature fragments that act as a library for neural activations.
- Reconstruction: When an image passes through the early layers of a CNN, it generates a feature map $Z$. CRUMB slices this map into chunks and replaces each with the most similar block from its codebook to create $\tilde{Z}$.
- Efficient Storage: To "remember" an image, the model only stores the indices of the blocks used to reconstruct it. This representation is incredibly compact, occupying only ~3.6% of the memory required for the original image.
- Replay: During training on new tasks, the model pulls these indices from a buffer, reconstructs the feature maps using the codebook, and feeds them into the later layers of the network to maintain the classifier's memory.
Experimental Evaluation
The authors evaluated CRUMB on 7 challenging datasets using two protocols: class-instance (temporal video streams) and class-i.i.d. (shuffled images). In addition to standard benchmarks like CORe50, iCub, Online-CIFAR100, and Online-ImageNet, the authors introduced two new benchmarks by adapting the Toybox and iLab datasets for stream learning. These new tools allow the community to test how models handle egocentric object transformations in a streaming context.
Results and Key Insights
CRUMB was tested against 13 competing methods, including state-of-the-art algorithms like iCARL, GEM, and REMIND.
The results demonstrate CRUMB's significant advantages:
- Superior Accuracy: CRUMB consistently outperformed competitors on video datasets. For instance, it achieved a 29.8% lead over REMIND on iLab and a 43.1% lead on the combined iLab+CORe50 benchmark.
- Resource Efficiency: CRUMB occupied only 3.7–4.1% of the peak RAM required by REMIND and was 15–43% faster to train, making it highly viable for real-time applications.
- The Benefit of Shape Bias: Interestingly, the reconstruction process acts as a regularizer. By forcing the network to use a discrete codebook, the model becomes biased toward global object shapes rather than local textures. This "shape bias," a hallmark of human vision, makes the model more robust to forgetting across tasks.
Conclusion and Future Work
CRUMB represents a significant step toward efficient, human-like stream learning. By leveraging compositional replay and a shared codebook, it achieves state-of-the-art performance with a fraction of the memory and time requirements of previous methods.
While the current implementation relies on a frozen feature extractor, future work could explore end-to-end training of the backbone. Additionally, the compositional approach could be extended to Transformers or applied to Reinforcement Learning, where agents must learn from non-stationary streams of experience.
Code is available at https://github.com/MorganBDT/crumb.git.
Summary updated