Pattern recognition in the presence of noise