Constrained neural networks for thermal vision