BIAS
A toolbox for detecting structural bias in continuous optimization heuristics.
Cite this software
Description
Deep-BIAS: Bias In Algorithms, Structural
A toolbox for detecting structural bias in continuous optimization heuristics.
With a deep-learning extension to better evaluate the type of bias and gain insights using explainable AI
Using the BIAS-Toolbox with Docker (Recommended)
The BIAS-Toolbox can be used inside a Docker container, eliminating the need to manually install all dependencies and packages. Follow the steps below to run the Docker image, and to start working with the toolbox in a Jupyter notebook environment. We provide the following prebuild container: ghcr.io/nikivanstein/bias:master
Prerequisites
Make sure you have Docker installed on your system. You can install Docker by following the instructions here.
Steps to Run the Docker Image
-
Pull the Prebuild Image The following command will pull the prebuild image to your system.
docker pull ghcr.io/nikivanstein/bias:master -
Run the Prebuild Docker Container: The following command will start the container and expose the Jupyter notebook interface on port
8888:docker run -p 8888:8888 ghcr.io/nikivanstein/bias:master -
Access the Jupyter Notebook: After starting the container, you should see a message with instructions to access the Jupyter notebook. It will look something like this:
To access the notebook, open this file in a browser: http://127.0.0.1:8888/?token=<token>Open the provided URL in your web browser to start using the BIAS-Toolbox within Jupyter.
Steps to Build the Dockerfile yourself
-
Clone the Repository: If you haven't already cloned the BIAS repository, do so with the following command:
git clone https://github.com/nikivanstein/BIAS.git cd BIAS -
Build the Docker Image: The
Dockerfileincluded in this repository will install all necessary dependencies (both Python and R), download required data and model files, and set up the environment.To build the Docker image, run the following command from the root of the repository (where the
Dockerfileis located):docker build -t bias-toolbox .This will create a Docker image named
bias-toolbox. -
Run the Docker Container: Once the image is built, you can run the container. The following command will start the container and expose the Jupyter notebook interface on port
8888:docker run -p 8888:8888 bias-toolbox -
Access the Jupyter Notebook: After starting the container, you should see a message with instructions to access the Jupyter notebook. It will look something like this:
To access the notebook, open this file in a browser: http://127.0.0.1:8888/?token=<token>Open the provided URL in your web browser to start using the BIAS-Toolbox within Jupyter.
Stopping the Container
To stop the running Docker container, press CTRL+C in the terminal where the container is running, or find the container's ID with the command:
docker ps
Then stop the container with:
docker stop <container_id>
Additional Notes
- The image is configured to use Jupyter Notebook with R and Python integrations.
- R version
4.1.2is installed and configured along with the necessary R packages as specified in theinstall.rscript. - Python dependencies are handled via the
requirements.txtfile.
By using Docker, you can avoid issues related to dependency installation and system setup, providing a consistent environment for running the BIAS-Toolbox.
Setup using Pip
Another way of using the BIAS-Toolbox is by installing the pip package.
This package requires an R-installation to be present.
The package is tested with R 4.1.2 (install from source https://cran.r-project.org/src/base/R-4/R-4.1.2.tar.gz)
The R packages will be installed automatically upon first importing BIAS.
Install the BIAS toolbox using pip:
pip install struct-bias
This installs the following R packages:
- PoweR
- AutoSEARCH
- nortest
- data.table
- goftest
- ddst
Detailed setup using virtual env
-
Download and install R from https://cran.r-project.org/ use version 4.1.2
Example for Ubuntu based system:sudo wget https://cran.rstudio.com/src/base/R-4/R-4.1.2.tar.gz tar zxvf R-4.1.2.tar.gz cd R-4.1.2 ./configure --enable-R-shlib --with-blas --with-lapack make sudo make install -
Download this repository (clone or as zip)
-
Create a python virtual env
python -m venv env -
Activate the env (in powershell for example:
env/Scripts/Activate.ps1) -
Install dependencies
pip install -r requirements.txt -
Checkout the
example.pyto start using the BIAS toolbox.
Example
#example of using the BIAS toolbox to test a DE algorithm
from scipy.optimize import differential_evolution
import numpy as np
from BIAS import BIAS, f0
bounds = [(0,1), (0, 1), (0, 1), (0, 1), (0, 1)]
#do 30 independent runs (5 dimensions)
samples = []
print("Performing optimization method 30 times of f0.")
for i in np.arange(30):
result = differential_evolution(f0, bounds, maxiter=100)
samples.append(result.x)
samples = np.array(samples)
test = BIAS()
print(test.predict(samples, show_figure=True))
y, preds = test.predict_deep(samples)
test.explain(samples, preds, filename="explanation.png")
Additional files
Note: The code for generating the RF used to predict the type of bias is included, but the full RF is not. These can be found on zenodo: https://doi.org/10.6084/m9.figshare.16546041. The RF models will be downloaded automatically the first time the predict function requires them.
Citation
If you use the BIAS toolbox in a scientific publication, we would appreciate using the following citations:
@ARTICLE{9828803,
author={Vermetten, Diederick and van Stein, Bas and Caraffini, Fabio and Minku, Leandro L. and Kononova, Anna V.},
journal={IEEE Transactions on Evolutionary Computation},
title={BIAS: A Toolbox for Benchmarking Structural Bias in the Continuous Domain},
year={2022},
volume={26},
number={6},
pages={1380-1393},
doi={10.1109/TEVC.2022.3189848}
}
@software{niki_van_stein_2023_7803623,
author = {Niki van Stein and
Diederick Vermetten},
title = {Basvanstein/BIAS: v1.1 Deep-BIAS Toolbox},
month = apr,
year = 2023,
publisher = {Zenodo},
version = {v1.1},
doi = {10.5281/zenodo.7803623},
url = {https://doi.org/10.5281/zenodo.7803623}
}
Participating organisations
Reference papers
Mentions
- 1.Author(s): David Ibehej, Jakub KůdelaPublished in Lecture Notes in Computer Science, Applications of Evolutionary Computation by Springer Nature Switzerland in 2025, page: 129-14410.1007/978-3-031-90065-5_8
- 2.Author(s): Sarah L. Thomson, Emma Hart, Quentin RenauPublished in Natural Computing Series, Explainable AI for Evolutionary Computation by Springer Nature Singapore in 2025, page: 117-14810.1007/978-981-96-2540-6_6
- 3.Author(s): Helena Stegherr, Michael Heider, Jörg HähnerPublished in Studies in Computational Intelligence, Computational Intelligence by Springer Nature Switzerland in 2025, page: 305-32210.1007/978-3-031-85252-7_17
- 4.Author(s): Anna V. Kononova, Diederick Vermetten, Niki van SteinPublished in Natural Computing Series, Explainable AI for Evolutionary Computation by Springer Nature Singapore in 2025, page: 93-11510.1007/978-981-96-2540-6_5
- 5.Author(s): Ridha RouabhiaPublished in Advances in Computational Intelligence and Robotics, Using AI Tools in Text Analysis, Simplification, Classification, and Synthesis by IGI Global in 2025, page: 409-43610.4018/979-8-3693-9511-0.ch014
- 6.Author(s): Niki van Stein, Sarah L. Thomson, Anna V. KononovaPublished in Lecture Notes in Computer Science, Parallel Problem Solving from Nature – PPSN XVIII by Springer Nature Switzerland in 2024, page: 36-5010.1007/978-3-031-70068-2_3
- 7.Author(s): Aidan Walden, Maxim BuzdalovPublished in Lecture Notes in Computer Science, Applications of Evolutionary Computation by Springer Nature Switzerland in 2024, page: 322-33710.1007/978-3-031-56852-7_21
- 8.Author(s): Fu Xing Long, Diederick Vermetten, Bas van Stein, Anna V. KononovaPublished in Lecture Notes in Computer Science, Applications of Evolutionary Computation by Springer Nature Switzerland in 2023, page: 380-39510.1007/978-3-031-30229-9_25
- 1.Author(s): Niki van Stein, Diederick Vermetten, Anna Kononova, Thomas BäckPublished in Proceedings of the Genetic and Evolutionary Computation Conference Companion by ACM in 2025, page: 79-8010.1145/3712255.3734245
- 2.Author(s): Kanchan Rajwar, Yogesh Kumar, Kusum DeepPublished in Proceedings of the Genetic and Evolutionary Computation Conference Companion by ACM in 2024, page: 447-45010.1145/3638530.3654312
- 3.Author(s): Sarah Thomson, Niki van Stein, Daan van den Berg, Cees van LeeuwenPublished in Proceedings of the 15th International Joint Conference on Computational Intelligence by SCITEPRESS - Science and Technology Publications in 2023, page: 555-56410.5220/0012249500003595
- 4.Author(s): Helena Stegherr, Michael Heider, Jörg HähnerPublished in Proceedings of the 15th International Joint Conference on Computational Intelligence by SCITEPRESS - Science and Technology Publications in 2023, page: 108-11810.5220/0012202100003595
- 5.Author(s): Diederick Vermetten, Furong Ye, Carola DoerrPublished in Proceedings of the Genetic and Evolutionary Computation Conference by ACM in 2023, page: 873-88110.1145/3583131.3590412
- 1.Author(s): Niki van Stein, Diederick Vermetten, Anna V. Kononova, Thomas BäckPublished in ACM Transactions on Evolutionary Learning and Optimization by Association for Computing Machinery (ACM) in 2025, page: 1-3010.1145/3716638
- 2.Author(s): Shaocong Guo, Junhao Wang, Zhenfeng ZhuPublished in Cluster Computing by Springer Science and Business Media LLC in 202510.1007/s10586-025-05380-3
- 3.Author(s): Kanchan Rajwar, Kusum DeepPublished in Swarm and Evolutionary Computation by Elsevier BV in 2025, page: 10181210.1016/j.swevo.2024.101812
- 4.Author(s): Chia-Hung Wang, Kun Hu, Xiaojing Wu, Yufeng OuPublished in Mathematics by MDPI AG in 2025, page: 215810.3390/math13132158
- 5.Author(s): Katarzyna Skowronek, Marek Arendarczyk, Anna K. Panorska, Tomasz J. Kozubowski, Agnieszka WyłomańskaPublished in Journal of Computational and Applied Mathematics by Elsevier BV in 2025, page: 11658710.1016/j.cam.2025.116587
- 6.Author(s): Lauren Hayward, Andries EngelbrechtPublished in IEEE Transactions on Evolutionary Computation by Institute of Electrical and Electronics Engineers (IEEE) in 2025, page: 262-27410.1109/tevc.2023.3346672
- 7.Author(s): Kanchan Rajwar, Kusum DeepPublished in Information Sciences by Elsevier BV in 2025, page: 12244410.1016/j.ins.2025.122444
- 8.Author(s): Teo Prica, Aleš ZamudaPublished in Mathematics by MDPI AG in 2025, page: 168110.3390/math13101681
- 9.Author(s): Mohammed Riyadh Abdmeziem, Amina Ahmed NacerPublished in SECURITY AND PRIVACY by Wiley in 202510.1002/spy2.70061
- 10.Author(s): Hao Gao, Qingke ZhangPublished in Engineering Applications of Artificial Intelligence by Elsevier BV in 2024, page: 10920210.1016/j.engappai.2024.109202
- 11.Author(s): Rawan AlMakinah, Mahsa Goodarzi, Betul Tok, M. Abdullah CanbazPublished in AI and Ethics by Springer Science and Business Media LLC in 2024, page: 1995-201410.1007/s43681-024-00609-0
- 12.Author(s): Kanchan Rajwar, Kusum DeepPublished in Expert Systems with Applications by Elsevier BV in 2024, page: 12233210.1016/j.eswa.2023.122332
- 13.Author(s): Katarzyna Skowronek, Marek Arendarczyk, Radosław Zimroz, Agnieszka WyłomańskaPublished in Journal of Computational and Applied Mathematics by Elsevier BV in 2024, page: 11612210.1016/j.cam.2024.116122
- 14.Author(s): Manish Kumar, Kanchan Rajwar, Kusum DeepPublished in Alexandria Engineering Journal by Elsevier BV in 2024, page: 38-4910.1016/j.aej.2024.03.060
- 15.Author(s): Anna V. Kononova, Diederick Vermetten, Fabio Caraffini, Madalina-A. Mitran, Daniela ZahariePublished in Evolutionary Computation by MIT Press in 2024, page: 3-4810.1162/evco_a_00333