Bayesian optimization of quantum cascade detectors