Sample code of Concept Bottleneck Model with Additional Unsuperviead Concepts (CBM-AUC).
These codes are based on Self-Explaining Neural Networks (SENN) and partially based on Concept Bottleneck Models (CBM).
Please check Dockerfile
Please download the datasets and pretrained models.
-
CUB-200-2011: http://www.vision.caltech.edu/visipedia/CUB-200-2011.html
-
Faster RCNN for BDD100k: https://github.com/JiqianDong/BDD-100-CV
-
inception v.3 for CUB-200-2011: https://github.com/yewsiang/ConceptBottleneck
The original label of BDD-OIA is written in json format, while our model uses pkl. So, after downloading, please use convert_json_to_pkl.ipynb
to convert the json to pkl format and merge the action and reason file.
Then, make data
, models
, out
folders, and store the downloaded data to data
and the pretrained models to models
, respectively (out
is used to store results).
# CUB-200-2011
python main_cub.py --train --cuda --load_model --h_type fcc --epochs 5 --batch_size 64 --nconcepts 128 --nconcepts_labeled 112 --h_sparsity 7 --opt sgd --lr 0.001 --weight_decay 0.00004 --h_labeled_param 1.0 --theta_reg_lambda 0.001 --info_hypara 0.5
# BDD-OIA
python main_bdd.py --train --cuda --load_model --h_type fcc --epochs 5 --batch_size 16 --nconcepts 30 --nconcepts_labeled 21 --h_sparsity 7 --opt adam --lr 0.001 --weight_decay 0.00004 --h_labeled_param 1.0 --theta_reg_lambda 0.001 --info_hypara 0.5 --obj bce
If you want to full train, please change the epoch number according to our paper.
Yoshihide Sawada and Keigo Nakamura. "Concept Bottleneck Model with Additional Unsupervised Concepts". IEEE Access (2022).
The open source license is in LICENSE file. This software is also available for licensing via AISIN Corp.