/CBCL-PR

Primary LanguagePythonMIT LicenseMIT

CBCL-PR: A Cognitively Inspired Model for Class-Incremental Learning in Robotics

Pytorch code for the paper: CBCL-PR: A Cognitively Inspired Model for Class-Incremental Learning in Robotics

Abstract

For most real-world applications, robots need to adapt and learn continually with limited data in their environments. In this paper, we consider the problem of Few-Shot class Incremental Learning (FSIL), in which an AI agent is required to learn incrementally from a few data samples without forgetting the data it has previously learned. To solve this problem, we present a novel framework inspired by theories of concept learning in the hippocampus and the neocortex. Our framework represents object classes in the form of sets of clusters and stores them in memory. The framework replays data generated by the clusters of the old classes, to avoid forgetting when learning new classes. Our approach is evaluated on two object classification datasets resulting in state-of-the-art (SOTA) performance for class-incremental learning and FSIL. We also evaluate our framework for FSIL on a robot demonstrating that the robot can continually learn to classify a large set of household objects with limited human assistance.

Applied on CIFAR-100, Caltech-101, and F-SIOL-310 datasets

Requirements

  • Pytorch (Currently working with 1.3.1)
  • Scipy (Currently working with 1.2.1)
  • Scikit Learn (Currently working with 0.21.2)
  • Download the datasets in */data directory

Usage

  • First run get_features.py to get the ResNet features for all the images in the dataset. For Caltheh-101 and F-SIOL-310 use ResNet-18 instead of ResNet-34. Store the features in a separate */features folder.
  • Features are extracted using an updated version of the img2vec.py file from https://github.com/christiansafka/img2vec repo. Check that repo if you want more details.
  • After feature extraction, simply run main_file.py to get the results for all increments.
  • The code currently has parameters set for CIFAR-100. Just change the appropriate parameters to run it on other datasets.
  • The code currently runs on full datasets. For few-shot incremental learning, simply replace k_shot variable to 5 or 10 in main_file.py.

If you consider citing us

@ARTICLE{ayub_tcds_2023,
  author={Ayub, Ali and Wagner, Alan R.},
  journal={IEEE Transactions on Cognitive and Developmental Systems}, 
  title={CBCL-PR: A Cognitively Inspired Model for Class-Incremental Learning in Robotics}, 
  year={2023},
  doi={10.1109/TCDS.2023.3299755}
}