A new detection method could provide an effective way of detecting contaminants in milk, according to new research.