(CVPR 2022) Energy-based Latent Aligner for Incremental Learning

Overview

Energy-based Latent Aligner for Incremental Learning

Accepted to CVPR 2022

paper

We illustrate an Incremental Learning model trained on a continuum of tasks in the top part of the figure. While learning the current task , the latent representation of Task data gets disturbed, as shown by red arrows. ELI learns an energy manifold, and uses it to counteract this inherent representational shift, as illustrated by green arrows, thereby alleviating forgetting.

Overview

In this work, we propose ELI: Energy-based Latent Aligner for Incremental Learning, which:

  • Learns an energy manifold for the latent representations such that previous task latents will have low energy and the current task latents have high energy values.
  • This learned manifold is used to counter the representational shift that happens during incremental learning.

The implicit regularization that is offered by our proposed methodology can be used as a plug-and-play module in existing incremental learning methodologies for classification and object-detection.

Toy Experiment

A key hypothesis that we base our methodology is that while learning a new task, the latent representations will get disturbed, which will in-turn cause catastrophic forgetting of the previous task, and that an energy manifold can be used to align these latents, such that it alleviates forgetting.

Here, we illustrate a proof-of-concept that our hypothesis is indeed true. We consider a two task experiment on MNIST, where each task contains a subset of classes: = {0, 1, 2, 3, 4}, = {5, 6, 7, 8, 9}.

After learning the second task, the accuracy on test set drops to 20.88%, while experimenting with a 32 dimensional latent space. The latent aligner in ELI provides 62.56% improvement in test accuracy to 83.44%. The visualization of a 512 dimensional latent space after learning in sub-figure (c), indeed shows cluttering due to representational shift. ELI is able to align the latents as shown in sub-figure (d), which alleviates the drop in accuracy from 89.14% to 99.04%.

The code for these toy experiments are in:

Implicitly Recognizing and Aligning Important Latents

latents.mp4

Each row shows how latent dimension is updated by ELI. We see that different dimensions have different degrees of change, which is implicitly decided by our energy-based model.

Classification and Detection Experiments

Code and models for the classification and object detection experiments are inside the respective folders:

Each of these are independent repositories. Please consider them separate.

Citation

If you find our research useful, please consider citing us:

@inproceedings{joseph2022Energy,
  title={Energy-based Latent Aligner for Incremental Learning},
  author={Joseph, KJ and Khan, Salman and Khan, Fahad Shahbaz and Anwar, Rao Muhammad and Balasubramanian, Vineeth},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2022}
}

Our Related Work

  • Open-world Detection Transformer, CVPR 2022. Paper | Code
  • Towards Open World Object Detection, CVPR 2021. (Oral) Paper | Code
  • Incremental Object Detection via Meta-learning, TPAMI 2021. Paper | Code
You might also like...
Implementation of the paper
Implementation of the paper "Self-Promoted Prototype Refinement for Few-Shot Class-Incremental Learning"

Self-Promoted Prototype Refinement for Few-Shot Class-Incremental Learning This is the implementation of the paper "Self-Promoted Prototype Refinement

Official repository of the paper 'Essentials for Class Incremental Learning'

Essentials for Class Incremental Learning Official repository of the paper 'Essentials for Class Incremental Learning' This Pytorch repository contain

[TPAMI 2021] iOD: Incremental Object Detection via Meta-Learning
[TPAMI 2021] iOD: Incremental Object Detection via Meta-Learning

Incremental Object Detection via Meta-Learning To appear in an upcoming issue of the IEEE Transactions on Pattern Analysis and Machine Intelligence (T

The code repository for
The code repository for "PyCIL: A Python Toolbox for Class-Incremental Learning" in PyTorch.

PyCIL: A Python Toolbox for Class-Incremental Learning Introduction • Methods Reproduced • Reproduced Results • How To Use • License • Acknowledgement

💡 Learnergy is a Python library for energy-based machine learning models.

Learnergy: Energy-based Machine Learners Welcome to Learnergy. Did you ever reach a bottleneck in your computational experiments? Are you tired of imp

 Learning Energy-Based Models by Diffusion Recovery Likelihood
Learning Energy-Based Models by Diffusion Recovery Likelihood

Learning Energy-Based Models by Diffusion Recovery Likelihood Ruiqi Gao, Yang Song, Ben Poole, Ying Nian Wu, Diederik P. Kingma Paper: https://arxiv.o

PyTorch implementation of: Michieli U. and Zanuttigh P.,
PyTorch implementation of: Michieli U. and Zanuttigh P., "Continual Semantic Segmentation via Repulsion-Attraction of Sparse and Disentangled Latent Representations", CVPR 2021.

Continual Semantic Segmentation via Repulsion-Attraction of Sparse and Disentangled Latent Representations This is the official PyTorch implementation

[CVPR 2020] Interpreting the Latent Space of GANs for Semantic Face Editing
[CVPR 2020] Interpreting the Latent Space of GANs for Semantic Face Editing

InterFaceGAN - Interpreting the Latent Space of GANs for Semantic Face Editing Figure: High-quality facial attributes editing results with InterFaceGA

Sound and Cost-effective Fuzzing of Stripped Binaries by Incremental and Stochastic Rewriting
Sound and Cost-effective Fuzzing of Stripped Binaries by Incremental and Stochastic Rewriting

StochFuzz: A New Solution for Binary-only Fuzzing StochFuzz is a (probabilistically) sound and cost-effective fuzzing technique for stripped binaries.

Comments
  • question about aligning during inference

    question about aligning during inference

    From the following code: https://github.com/JosephKJ/ELI/blob/main/detection/detectron2/modeling/roi_heads/roi_heads.py#L558 It seems that at the inference time, we need to know the gt class of objects in the image. Please correct me if I am wrong.

    opened by shuangshuangguo 3
  • How to reproduce the results in the paper?

    How to reproduce the results in the paper?

    I followed the ELI/detection/INSTALL.md and builded detectron2 successfully.

    conda create --name ELI ......
    pip install .....
    # DO NOT git clone from https://github.com/facebookresearch/detectron2.git
    git clone https://github.com/JosephKJ/ELI.git
    cd ELI/detection
    python setup.py build develop
    

    And I copied these files from IODML. I put them in the ELI/detection/output/

    ELI/detection/output/
    ├── 10_p_10/
    ├── 10_p_10_ft/
    ├── 15_p_5/
    ├── 15_p_5_ft/
    ├── 19_p_1/
    ├── 19_p_1_ft/
    ├── first_10/
    ├── first_15/
    └── first_19/
    

    Then I used this command in run.sh.

    # 1st
    python tools/train_net.py --num-gpus 4 --dist-url 'tcp://127.0.0.1:52191' --config-file ./configs/PascalVOC-Detection/iOD/align_19_p_1.yaml SOLVER.IMS_PER_BATCH 8 SOLVER.BASE_LR 0.005
    # 2nd
    python tools/train_net.py --num-gpus 4 --dist-url 'tcp://127.0.0.1:52190' --eval-only --config-file ./configs/PascalVOC-Detection/iOD/align_19_p_1.yaml SOLVER.IMS_PER_BATCH 8 SOLVER.BASE_LR 0.005 MODEL.ROI_HEADS.LEARN_INCREMENTALLY False
    

    Finally, I got very bad results.

    # 1st
    [06/17 14:54:02 d2.evaluation.pascal_voc_evaluation]: Evaluating voc_2007_test using 2007 metric. Note that results do not use the official Matlab API.
    [06/17 14:54:14 d2.evaluation.pascal_voc_evaluation]: ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor']
    [06/17 14:54:14 d2.evaluation.pascal_voc_evaluation]: AP__: ['0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000']
    [06/17 14:54:14 d2.evaluation.pascal_voc_evaluation]: AP50: ['0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000']
    [06/17 14:54:14 d2.evaluation.pascal_voc_evaluation]: AP75: ['0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000', '0.000']
    # 2nd
    [06/17 15:08:58 d2.evaluation.pascal_voc_evaluation]: Evaluating voc_2007_test using 2007 metric. Note that results do not use the official Matlab API.
    [06/17 15:09:19 d2.evaluation.pascal_voc_evaluation]: ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor']
    [06/17 15:09:19 d2.evaluation.pascal_voc_evaluation]: AP__: ['0.000', '0.028', '0.019', '0.008', '0.000', '0.022', '0.033', '0.022', '0.006', '0.004', '0.020', '0.457', '0.003', '0.025', '0.018', '0.022', '0.009', '0.005', '0.006', '0.000']
    [06/17 15:09:19 d2.evaluation.pascal_voc_evaluation]: AP50: ['0.000', '0.060', '0.065', '0.039', '0.000', '0.095', '0.056', '0.095', '0.033', '0.041', '0.079', '1.136', '0.031', '0.118', '0.064', '0.077', '0.057', '0.025', '0.028', '0.000']
    [06/17 15:09:19 d2.evaluation.pascal_voc_evaluation]: AP75: ['0.000', '0.020', '0.000', '0.000', '0.000', '0.000', '0.056', '0.000', '0.000', '0.000', '0.016', '0.008', '0.000', '0.000', '0.005', '0.000', '0.000', '0.000', '0.000', '0.000']
    
    opened by ChibisukeDragon 2
  • The version of software

    The version of software

    Can you share the version of some important softwares, such as pytorch, python, detectron2, fvcore, opencv-python, gcc and so on. According to your supported dockerfille, running the code carries out the bug.

    opened by shuangshuangguo 1
Owner
Joseph K J
CS PhD Student at IIT-H
Joseph K J
Official Pytorch implementation of Online Continual Learning on Class Incremental Blurry Task Configuration with Anytime Inference (ICLR 2022)

The Official Implementation of CLIB (Continual Learning for i-Blurry) Online Continual Learning on Class Incremental Blurry Task Configuration with An

NAVER AI 34 Oct 26, 2022
[CVPR 2022] CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation

CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation Prerequisite Please create and activate the following conda envrionment. To r

Qin Wang 87 Jan 8, 2023
Official code of the paper "Expanding Low-Density Latent Regions for Open-Set Object Detection" (CVPR 2022)

OpenDet Expanding Low-Density Latent Regions for Open-Set Object Detection (CVPR2022) Jiaming Han, Yuqiang Ren, Jian Ding, Xingjia Pan, Ke Yan, Gui-So

csuhan 64 Jan 7, 2023
Minimal PyTorch implementation of Generative Latent Optimization from the paper "Optimizing the Latent Space of Generative Networks"

Minimal PyTorch implementation of Generative Latent Optimization This is a reimplementation of the paper Piotr Bojanowski, Armand Joulin, David Lopez-

Thomas Neumann 117 Nov 27, 2022
Attention-based Transformation from Latent Features to Point Clouds (AAAI 2022)

Attention-based Transformation from Latent Features to Point Clouds This repository contains a PyTorch implementation of the paper: Attention-based Tr

null 12 Nov 11, 2022
PyTorch implementation of Algorithm 1 of "On the Anatomy of MCMC-Based Maximum Likelihood Learning of Energy-Based Models"

Code for On the Anatomy of MCMC-Based Maximum Likelihood Learning of Energy-Based Models This repository will reproduce the main results from our pape

Mitch Hill 32 Nov 25, 2022
Imposter-detector-2022 - HackED 2022 Team 3IQ - 2022 Imposter Detector

HackED 2022 Team 3IQ - 2022 Imposter Detector By Aneeljyot Alagh, Curtis Kan, Jo

Joshua Ji 3 Aug 20, 2022
The 7th edition of NTIRE: New Trends in Image Restoration and Enhancement workshop will be held on June 2022 in conjunction with CVPR 2022.

NTIRE 2022 - Image Inpainting Challenge Important dates 2022.02.01: Release of train data (input and output images) and validation data (only input) 2

Andrés Romero 37 Nov 27, 2022
Code for "Learning Structural Edits via Incremental Tree Transformations" (ICLR'21)

Learning Structural Edits via Incremental Tree Transformations Code for "Learning Structural Edits via Incremental Tree Transformations" (ICLR'21) 1.

NeuLab 40 Dec 23, 2022
The official PyTorch code for 'DER: Dynamically Expandable Representation for Class Incremental Learning' accepted by CVPR2021

DER.ClassIL.Pytorch This repo is the official implementation of DER: Dynamically Expandable Representation for Class Incremental Learning (CVPR 2021)

rhyssiyan 108 Jan 1, 2023