Code Monkey home page Code Monkey logo

eli's Introduction

Energy-based Latent Aligner for Incremental Learning [arXiv | Poster | Video]

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

eli's People

Contributors

josephkj avatar salman-h-khan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eli's Issues

How to obtain the test results?

I have run your code successfully. But I do not know how to see the test results. Could you give me some advice?

Thank you.

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.

Do you selecet 'difficult'=0 and 'difficult'=1 samples for each category, when spliting VOC datasets?

Thanks for your amazing works and open-source repositories from ORE, META-IOD to ELI.

According to your code https://github.com/JosephKJ/ELI/blob/93ddce7c35b1b38a55cf237fc3f51e36ba92fbc2/detection/detectron2/data/datasets/pascal_voc.py#LL56C1-L57C70
I assume that you select both 'difficult'=0 and 'difficult'=1 samples for each category, when spliting VOC datasets.
Therefore, there are 3002 training imgs in first10 dataset, and 3340 training imgs in last 10 dataset.

Please let me know if i was wrong.

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']

How can I get "./base_50.pt"?

image
In the classfication/main.py,there is a parameter named ckpt_dir_fg in line26,the default value of it was ./base_50.pt. How
can I get this file?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.