This repository was created with the aim of incorporating an Explanatory System in the Conditional Adversarial Autoencoder (CAAE). The main source of inspiration was the paper Age Progression/Regressionby Conditional Adversarial Autoencoder proposed by (Zhang, Song, et al.). Moreover, the paper xAI-GAN: Enhancing Generative Adversarial Networks via Explainable AI Systems proposed by (Nagisetyy, Graves, et al.) formed the base of adding xAI methods in CAAE. Endly, thanks to Mattan Serry and the AgeProgression work, we devoloped our code in PyTorch.
The dataset we used for training was the CACD + UTKFace which consists of 21267 images in 7 age classes. FGNET with 1002 images used for the test purpose. The data folder can be downloaded through Google Drive.
- Python 3.7
- Pytorch 1.2.0
- Captum 0.4.0
- Lime 0.2.0.1
The control and change of the Explainable Artificial Intelligence system is achieved through the net.teachSplit() in mainCAAEsplit_ver2_lime.py script. If it is a need to train the Original CAAE, without the addition of the xAI system, explainable is set to False. The xAI system is activated by setting explainable to True. LIME can be added by setting the explanation_type to 'lime'.
conda create -n limecaae python=3.7 anaconda
conda activate limecaae
pip install -r requirements.txt
python mainCAAEsplit_ver2_lime.py --mode train --epochs 140 --input data/CACD_UTKFace --output checkpoints
python mainCAAEsplit_ver2_lime.py --mode test --load checkpoints/epoch140 --input data/FGNET --output results/checkpoints/epoch140 --age <0 to 6> --gender <0 or 1>
LIME-CAAE
│ consts.py
│ mainCAAEsplit_ver2_lime.py
│ modelSplit_v2_lime.py
│ README.md
│ my_lime_image.py
| requirements.txt
│ utils.py
| utils_xai.py
└───data
└───CACD_UTKFace
└───FGNET
Feel free to send us a message for any issue.
Christos Korgialas (ckorgial@csd.auth.gr)