Abstract
Classical machine learners are designed only to tackle one task without capability of adopting new emerging tasks or classes whereas such capacity is more practical and human-like in the real world. To address this shortcoming, continual machine learners are elaborated to commendably learn a stream of tasks with domain and class shifts among different tasks. In this paper, we propose a general feature-propagation based contrastive continual learning method which is capable of handling multiple continual learning scenarios. Specifically, we align the current and previous representation spaces by means of feature propagation and contrastive representation learning to bridge the domain shifts among distinct tasks. To further mitigate the class-wise shifts of the feature representation, a supervised contrastive loss is exploited to make the example embeddings of the same class closer than those of different classes. The extensive experimental results demonstrate the outstanding performance of the proposed method on six continual learning benchmarks compared to a group of cutting-edge continual learning methods.
Introduction
A fundamental goal in artificial intelligence is the development of agents that can learn new skills sequentially without losing previously acquired knowledge. However, standard neural networks suffer from catastrophic forgetting, where training on a new task causes the model's weights to shift such that performance on prior tasks degrades significantly.
Existing solutions generally fall into three categories: regularization-based methods that penalize weight changes, rehearsal-based methods that maintain a small buffer of old data, and architectural approaches that expand the network for new tasks. Despite these efforts, many existing methods overlook the stability of the representation space. If the internal mapping of data shifts too drastically between tasks, the model loses its semantic foundation. This research introduces CCL-FP+, a framework designed to address domain and class shifts by anchoring the current representation space to its historical state.
Methodology: CCL-FP+
The proposed Contrastive Continual Learning with Feature Propagation (CCL-FP) method integrates three primary components to maintain representation stability during sequential learning.
Feature Propagation
When encountering a new task, the model utilizes a frozen copy of the previous task's feature extractor ($\psi_o$). The current embeddings are "amended" by fusing them with a weighted sum of embeddings from the old model. This process forces the evolving model to absorb the global structure of the previous representation space, acting as a structural anchor.
Contrastive Representation Rehearsal ($L_{cl}$)
To prevent drift in the feature space, a contrastive loss is employed. This loss encourages the current embedding of an image to remain close to the embedding generated by the previous version of the model, while simultaneously pushing it away from other images in the current batch.
Supervised Contrastive Replay ($L_{scl}$)
In the enhanced CCL-FP+ version, supervised contrastive learning uses class labels to pull embeddings of the same class together and push different classes apart. This is particularly effective in Domain Incremental Learning (Domain-IL) scenarios, where the environment changes but the underlying categories remain consistent.
Experimental Results
The framework was evaluated across six benchmarks covering Task-IL, Domain-IL, and Class-IL scenarios, including Split MNIST, Permuted/Rotated MNIST, Split CIFAR-10/100, and Split Tiny ImageNet. The model was trained in a challenging single-epoch setting.
CCL-FP+ consistently outperformed strong baselines such as GEM, A-GEM, and standard Experience Replay (ER). On the complex Split CIFAR-100 benchmark (Class-IL), CCL-FP+ achieved 14.05% accuracy, significantly higher than ER (9.74%) and HAL (6.31%) when using a limited buffer of 200 images. Furthermore, the "forgetting measure" was notably lower for CCL-FP+, indicating superior stability. The method also demonstrated robustness even with very small memory buffers, making it suitable for resource-constrained edge devices.
Conclusion
CCL-FP+ addresses catastrophic forgetting by prioritizing the stability of the representation space. By anchoring the new feature space to the old one through feature propagation and contrastive learning, the model retains "muscle memory" of previous tasks while adapting to new ones. While the method introduces hyperparameters that may require tuning, its efficiency and generalizability across different continual learning scenarios represent a significant advancement. Future work may involve integrating this approach with advanced memory management techniques to further optimize sample selection in the rehearsal buffer.
Summary updated