A method for identifying the presence of at least one adulterant substance in a sample. The method comprises receiving sets of sample spectral data, reference spectral data, validation spectral data each set for a respective validation example, and adulterant substance spectral data for said at least one adulterant substance. From these residue data which is representative of a residue which would remain after performing a least squares fitting process between the sample spectral data and the reference spectral data is determined and modified sample residue data which is representative of a residue which would remain after performing a least squares fitting process between the sample spectral data, the reference spectral data and the adulterant substance spectral data is determined. The corresponding two residue data sets are also determined for each validation example. The method then includes performing at least one comparison amongst the sample residue data, the modified sample residue data, the validation residue data, and the modified validation residue data; and determining a likelihood value for the presence of said at least one adulterant substance in said sample in dependence on said at least one comparison; and outputting said likelihood value.