This repository contains the code for the research paper titled "Sensitivity Analysis of Image Classification Models using Generalized Polynomial Chaos", which is currently published as a preprint on arXiv. Here, we provide all the necessary information and resources to reproduce the results presented in our paper.
Integrating advanced communication protocols in production has accelerated the adoption of data-driven predictive quality methods, notably machine learning (ML) models. However, ML models in image classification often face significant uncertainties arising from model, data, and domain shifts. These uncertainties lead to overconfidence in the classification model's output. To better understand these models, sensitivity analysis can help to analyze the relative influence of input parameters on the output. This work investigates the sensitivity of image classification models used for predictive quality. We propose modeling the distributional domain shifts of inputs with random variables and quantifying their impact on the model's outputs using Sobol indices computed via generalized polynomial chaos (GPC). This approach is validated through a case study involving a welding defect classification problem, utilizing a fine-tuned ResNet18 model and an emblem classification model used in BMW Group production facilities.
If you find this work useful for your research, please cite our paper:
@article{bahr2024sensitivity,
title={Sensitivity Analysis of Image Classification Models using Generalized Polynomial Chaos},
author={Bahr, Lukas and Possner, Lucas and Weise, Konstantin and Gröger, Sophie and Daub, Rüdiger},
journal={arXiv preprint arXiv:2506.18751},
year={2025}
}git clone https://github.com/lpossner/gPC_Image_Classification.git
cd gPC_Image_Classificationpip install uv
uv syncDownload the TIG Aluminium 5083 dataset from Kaggle and place it in the data/ directory.
The workflow consists of three main steps:
Train the ResNet18 model on the welding defect classification task:
python fine_tune_model.pyGenerate augmented datasets with distributional shifts:
python create_data.pyCompute Sobol indices to quantify input parameter influence:
python run_gpc.pyThis project is licensed under the MIT License - see the LICENSE file for details.
For any queries regarding the paper or the code, please open an issue on this repository or contact the authors directly at: