Detection of inhomogeneities in sets of NIR spectra