CBR-Lime is a Lime configuration recommender, which uses human perception to acquire knowledge of what is an explanation of good quality.
To install the required libraries with pip
pip install -r requirements
All the elements must be executed in order
- 00_image_resize
- 01_filter_images
- 02_calc_similitude
- 03_calc_explications
- 04_adquire_information
- 05_compute_acquired_information
- 06_compare_neighborhood
- 07_check_hypothesis
- 08_process_experiment_data
(Optional) Script to resize the image dataset to the required dimensions.
Filter and select the top image predictions.
For each image in the input folder recived obtain the top classification value, select the most accurate and copy it to the output folder.
Calculate the similitude between images in the dataset.
Calculate the similitude comparing the neural net classification and generate two csv files one with all the dataset images and other with the top 3 related images for each one.
Calculate the perturbed image dataset for the experiment.
Calculate the perturbed image dataset to use in the experiemnt, generates nine perturbed images for each one in the original image dataset.
Application for adquire the users explication preferences.
Shows a windows with nine options, the user must choose based on her best human perception explication.
Process the results of the experiment.
Process the results generated in the LimeExperiment, generates a csv file with the information and returns the file path.
Generates the similarty comparation.
Generate the similarity matrix between images and similar neighborhood.
Application for choose the best Lime configuration between the default configuration and the process configuration.
Process the results of the experiments.
Process the results generated in the check hypothesis experiment and generates a csv file with the information and returns the file path.
Additionally two applications have been created to complement the software:
This application implement the full CBR cycle. Shows the original image, its associated perturbation and the result explication, the configuration can be revised and modified by the user.
Shows the three more similar images for each one in the dataset, the similarity value and the classification information.