README

It's DONE: Direct ONE-shot learning with Hebbian weight imprinting

This README.md is a description of a simple code file code_done_simple.py, which contains the implementation of DONE as the most important part of the paper.
In addition to the simple code file, the supplementary material contains the following three Jupyter Notebook files.

--- Mistake found ---

We noticed that the calculation results using the following conditions were incorrect in the paper: modelname = 'efnetb0'(backbone model was EfficientNet) with witype = 'QIWI'(type of weight imprinting was Qi's method). Therefore, a part of Figure 2(b)-(ii) and the relevant text should change slightly. However, the abstract and conclusion of the paper (all but a small part in results) do not change at all. This supplementary material also contains a revised manuscript file (NeurIPS2022_DONE_220526_revised_supplement.pdf, the changes are highlighted).


Requirements

To install requirements (probably no problem even if the package versions are different):

pip install -r requirements.txt
pip install -r requirements.txt

For example, we have confirmed that code_done_simple.py can be executed in Anaconda by creating a new environment with conda create -n test_env python=3.9.12 and installing the requirements with the above command.

We have also prepared the following two requirements files:


Pre-trained Models, Training, Evaluation

Run this command:

python code_done_simple.py
python code_done_simple.py

By this command, you get CIFAR images, pre-trained backbone model, new-class-added model with training by DONE, and evaluation results..


Results

Executing code_done_simple.py should output the following results:

Input image Model Top 1 answer Top 1 softmax value
baby (new class) Original model nipple 11.7%
baby (new class) Added model baby 99.9% (in 1003 classes)
lion (original class) Original model lion 89.5%
lion (original class) Added model lion 89.5% (the same)

See code_done_complete.ipynb for a complete reproduction of the results in the paper.


Notes

The code will be released later as OSS, but we are still in the process of applying for permission at our institution, and thus please treat it as confidential material only for peer review now.